Look at modbusApp/Db/ai.template and ao.template. They do the scaling on input and output.
You define the EGUL and EGUF macro parameters, which are the engineering units at the minimum and maximum word values respectively.
Mark
________________________________
From: [email protected] [[email protected]] on behalf of JaeRyong Seo [[email protected]]
Sent: Tuesday, April 07, 2015 4:43 AM
To: [email protected]
Subject: problem scale word data
Hi, all
for communication with PLC via using modbus, I used modbusR2-5 version.
i want to know how to scale word data.
for example.
this is Trans1.substitution file
file "../../db/mbbiDirect.template" { pattern
{P, R, PORT, OFFSET, MASK, SCAN}
{CIS:TRANS1:, YWIn10, T1_Yn_In_Word, 0x10, 0xFFFF, "I/O Intr"}
{CIS:TRANS1:, YWIn11, T1_Yn_In_Word, 0x11, 0xFFFF, "I/O Intr"}
}
file "../../db/intarray_in.template" { pattern
{P, R, PORT, NELM, SCAN}
{CIS:TRANS1:, YWIn0Array, T1_Yn_In_Word, 80, "I/O Intr"}
}
file "../../db/asynRecord.template" { pattern
{P, R, PORT, ADDR, TMOD, IFACE}
{CIS:TRANS1:, YWIn0Asyn, T1_Yn_In_Word, 0, Read, asynInt32}
}
file "../../db/statistics.template" { pattern
{P, R, PORT, SCAN}
{CIS:TRANS1:, YWIn0St, T1_Yn_In_Word, "10 second"}
}
file "../../db/poll_delay.template" { pattern
{P, R, PORT}
{CIS:TRANS1:, YWIn0PollDelay, T1_Yn_In_Word}
}
# These are the Yn outputs done with bit access. Y0-Y7
file "../../db/bo_bit.template" { pattern
{P, R, PORT, OFFSET, ZNAM, ONAM}
{CIS:TRANS1:, YWOut10, T1_Yn_Out_Word, 0x10, 0xFFFF, "I/O Intr"}
{CIS:TRANS1:, YWOut11, T1_Yn_Out_Word, 0x11, 0xFFFF, "I/O Intr"}
}
file "../../db/asynRecord.template" { pattern
{P, R, PORT, ADDR, TMOD, IFACE}
{CIS:TRANS1:, YWOut0Asyn, T1_Yn_Out_Word, 0, Read, asynInt32}
}
file "../../db/statistics.template" { pattern
{P, R, PORT, SCAN}
{CIS:TRANS1:, YWOut0St, T1_Yn_Out_Word, "10 second"}
}
file "../../db/poll_delay.template" { pattern
{P, R, PORT}
{CIS:TRANS1:, YWOut0PollDelay, T1_Yn_Out_Word}
}
and this is log file
[sjr@localhost ~]$ caget CIS:TRANS1:YWInA
CIS:TRANS1:YWInA 200
[sjr@localhost ~]$ caput CIS:TRANS1:YWOutA 250
Old : CIS:TRANS1:YWOutA 200
New : CIS:TRANS1:YWOutA 250
[sjr@localhost ~]$ caget CIS:TRANS1:YWInA
CIS:TRANS1:YWInA 250
[sjr@localhost ~]
there is need to display value of CIS:TRANS1:YWInA after change scale via using medm.
(ex. if received data from plc is 200, need to display 2.00 )
and also need to send user-input data to PLC after change scale
(ex. if user input 5.00 , need to send 500 to plc)
I need some hints for solve this problem.
regards,
JaeRyong
- References:
- problem scale word data JaeRyong Seo
- Navigate by Date:
- Prev:
problem scale word data JaeRyong Seo
- Next:
MTCA.4 board with IO modules Dalesio, Leo
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
problem scale word data JaeRyong Seo
- Next:
Program Available for the Spring 2015 EPICS Collaboration Meeting Spring 2015 EPICS Collaboration Meeting
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|