we have stumbled upon the following issue. When reading coils, the LSB of the answer is required to equal the start address specified in the command. See the following quote from the spec:
The LSB of the first data byte contains the output addressed in the query. The other coils follow toward the high order end of this byte, and from low order to high order in subsequent bytes.
Hi,
we have stumbled upon the following issue. When reading coils, the LSB of the answer is required to equal the start address specified in the command. See the following quote from the spec:
(from http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf Chapter 6)
However, the current server implementation seems to align the coils on a fixed "grid" starting at multiples of address 8.
So e.g. when calling
readCoils(5,1)
(and assuming that the value at address5
istrue
) the expected result would be:but the actual result currently is
I figure the issue is the following line https://github.com/Cloud-Automation/node-modbus/blob/master/src/handler/server/ReadCoils.js#L55
which should probably be something like
d'accord? :-) or am I missing something? I can create a PR.
PS: that is the same for discrete inputs.