I'm trying to implement a ModBUS RTU device on a microcontroller development
board. I'm using "Qmodmaster" for testing as it can show the byte-by-byte
communication between the PC and device, and so far the device behaves
consistently.
I'm also trying to access the device from OpenAPC. I can't use Modbus RTU at
all in version 3.6, it appears to communicate something but the device only
reacts intermittently.
I've had more success with version 3.3.2, in that version I am able to send
the state of four buttons to the device as a "holding register" and read the
register back.
My specific problems:
Byte ordering. Currently I have both boxes checked and it appears to work,
but why is there a need for this? As far as I'm aware Modbus RTU 16-bit
integers are always big-endian and bits (coils) are packed as bytes so there
should be only one valid byte ordering.
Return values currently appear to be multiplied by 256. This would imply a
byte-swap. There could be a problem with my device but I doubt it as
qmodmaster can access it consistently.
When the modbus block reads a state it appears to only outputs a value when
the state changes. This would appear to mean that if a register's state
remains constant the value never propagates. It ought to be propagated at
least once on the first poll.