Unfortunately, the device you are communicating with appears to be sending incorrectly formatted Modbus responses to the request it receives from VTScada. Looking at the request message, we are asking the device for 2 consecutive 16 bit registers (which is correct if we want to read a single precision floating point value):
32 03 1B CA 00 02
The reply, however, contains 8 bytes of data, not the 4 bytes that would be expected in response to a query for 2 registers:
32 03 08 41 CB
Our driver is interpreting this as an improperly formatted response to the request (i.e. 8 bytes instead of 4) and is not accepting it.
For reference, see Modbus specification "MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3" section 6.3 "03 (0x03) Read Holding Registers" (available from www.modbus.org):
This function code is used to read the contents of a contiguous block of holding registers in a remote device. The Request PDU specifies the starting register address and the number of registers. In the PDU Registers are addressed starting at zero. Therefore registers numbered 1-16 are addressed as 0-15.
The register data in the response message are packed as two bytes per register, with the binary contents right justified within each byte. For each register, the first byte contains the high order bits and the second contains the low order bits.
Unfortunately, the device you are communicating with appears to be sending incorrectly formatted Modbus responses to the request it receives from VTScada. Looking at the request message, we are asking the device for 2 consecutive 16 bit registers (which is correct if we want to read a single precision floating point value):
32 03 1B CA **_00 02_**
The reply, however, contains 8 bytes of data, not the 4 bytes that would be expected in response to a query for 2 registers:
32 03 **_08_** 41 CB
Our driver is interpreting this as an improperly formatted response to the request (i.e. 8 bytes instead of 4) and is not accepting it.
For reference, see Modbus specification "_MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3_" section 6.3 "_03 (0x03) Read Holding Registers_" (available from www.modbus.org):
_This function code is used to read the contents of a contiguous block of holding registers in a remote device. The Request PDU specifies the starting register address **and the number of registers**. In the PDU Registers are addressed starting at zero. Therefore registers numbered 1-16 are addressed as 0-15.
The register data in the response message are packed as **two bytes per register**, with the binary contents right justified within each byte. For each register, the first byte contains the high order bits and the second contains the low order bits._
Lawrence MacNeil
Trihedral Engineering Limited
edited May 8 '17 at 1:30 pm