Skip to content

ReadRegisters returns data only on second read #70

Open
@pfried

Description

I do read Input / Holding registers via

int[] registerValues = this.modbusMaster.readHoldingRegisters(slaveAddress, startAddress, quantity);

But the first read will timeout saying no data received before timeout. If I run the query twice the seconds attempt succeeds. I guess the "old" data is read on the second command. This would explain it fails every time the amount of data to be received fails. Subsequent queries succeed if they have the same length, if the length changes it fails.

Data is coming in correctly and in the correct time which I verified on the Oscilloscope.

Is there any known issue? I would try changing the timeouts but due to #49 it seems I cannot do that in blocking read.

JSerialComm 2.4.0 (not able to upgrade due to #53)
JLibModbus 1.2.9.7
Windows 10 64bit

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions