You're correct - there are two counts, which are a bit redundant. The first register is the byte count (call it "N"). The second register is the queue count (call it "M"). It turns out that "M" should always be ((N - 2) / 2).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have an problem with your Read FIFO Queue implementation.
The Modbus frame response format should be
...
Function code (1Byte)
Byte count (2Byte)
FIFO count (2Byte)
FIFO data (2 * FIFO count)
and your code for reading this response:
ReadFIFOQueueResponse.java Line 148
so m_Count is now the Byte count but it should be the FIFO count.
My Fix for that looks like this
Am I right or had I misunderstood the read FIFO queue message?
btw. thanks for the great modbus stack.
You're correct - there are two counts, which are a bit redundant. The first register is the byte count (call it "N"). The second register is the queue count (call it "M"). It turns out that "M" should always be ((N - 2) / 2).