Hi, EPICS mates,
I have a motor driver(Oriental AZ series) with built-in encoder.
Its RS-485 2-wire interface is adapted by a MOXA Nport 5150A to ethernet(TCP/IP).
I use Modbus to read its encoder position.
I tested it on my own computer, and successfully read out the encoder position.
However after transfered to a production EPICS/IOC server, the encoder position value became strange.
Please notice that the versions of modbus module are different.
On my computer(asyn-4-26, modbus-2-7), the read value is:
decimal -271,289
hex FFFB DC47
On EPICS/IOC server(asyn-R4-42, modbuus-R3-2), the read value is:
decimal 1,205,664,767
hex 47DC FBFF
Following is my settings and EPICS record:
## drvAsynIPPortConfigure("portName", "hostInfo", priority, noAutoConnect, noProcessEos)
## modbusInterposeConfig("portName", linkType, timeoutMsec, writeDelayMsec)
modbusInterposeConfig("AZPORT01", 1, 1000, 100)
##drvModbusAsynConfigure("portName", "tcpPortName",slaveAddress, modbusFunction, modbusStartAddress, modbusLength, dataType, pollMsec, "plcType")
drvModbusAsynConfigure("AZPORT01_CH1ENC", "AZPORT01", 1, 0x03, 0x00CC, 0x02, 6, 100, "AZPORT01")
record(longin, "$(P)$(R)Xenc") {
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT)_CH1ENC 0)MODBUS_DATA")
field(SCAN, "I/O Intr")
}
By the way, if I changed the "dataType" from 6(INT32_BE) to 5(INT32_LE), the value became:
decimal -599,261,189
hex DC47 FFFB