Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadRegisters returns data only on second read #70

Open
pfried opened this issue Jun 9, 2021 · 1 comment
Open

ReadRegisters returns data only on second read #70

pfried opened this issue Jun 9, 2021 · 1 comment

Comments

@pfried
Copy link

pfried commented Jun 9, 2021

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

@Shaco74
Copy link

Shaco74 commented Nov 18, 2021

Having exactly the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants