Hi,
You should not be using longout.template, that can only write a single 16-bit value to a single Modbus register.
You should be using longoutInt32.template. That will write a 32-bit value to Modbus registers N and N+1.
This is that template file.
corvette:modbus/modbusApp/Db>more longoutInt32.template
# longout record template for register inputs
record(longout,"$(P)$(R)") {
field(DTYP,"asynInt32")
field(OUT,"@asyn($(PORT) $(OFFSET))$(DATA_TYPE)")
}
You need to set the $(DATA_TYPE) macro to either INT32_LE or INT32_BE, depending on whether the value should be stored with the least significant byte first (Little Endian = INT32_LE) or most significant byte first (Big Endian = INT32_BE).
Mark
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Fabian
Sent: Friday, August 31, 2012 11:40 AM
To: [email protected]
Subject: modbus R2-4 write 32bit int with modbus function 16
Hello all,
im trying to write a huge number which ist splitted into 2 Words (4
bytes) via modbus. But it doesn't work because I receive an asyn error.
epics> dbpf IOC01MINI8:RTC_SP 0
DBR_LONG: 0 0x0
epics> 2012/08/31 18:14:45.105 drvModbusAsyn::writeUInt32D port
mini8_RTC_SP invalid request for Modbus function 16
2012/08/31 18:14:45.105 IOC01MINI8:RTC_SP devAsynUInt32Digital process
error
I use the longout.template as epics record, and got asyn 4-20
The configuration for the port is here:
#drvModbusAsynConfigure(portName, tcpPortName, slaveAddress,
modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec,
plcType);
drvModbusAsynConfigure("mini8_RTC_SP", "mini8_1", 1,
16, 40293, 2, 6, 1000,
"EuroTherm-mini8") #0x9d65
*any ideas would be appreciated.*
<http://www.healthboards.com/boards/lung-respiratory-disorders-copd/834289-any-ideas-would-appreciated-post4676978.html?highlight=aware+of+my+breathing#4676978>
- References:
- modbus R2-4 write 32bit int with modbus function 16 Fabian
- Navigate by Date:
- Prev:
modbus R2-4 write 32bit int with modbus function 16 Fabian
- Next:
asyn R4-20 available Mark Rivers
- 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:
modbus R2-4 write 32bit int with modbus function 16 Fabian
- Next:
asyn R4-20 available Mark Rivers
- 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
|