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

Slave not responding #51

Closed
ruciuPL opened this issue Jul 30, 2019 · 5 comments
Closed

Slave not responding #51

ruciuPL opened this issue Jul 30, 2019 · 5 comments

Comments

@ruciuPL
Copy link

ruciuPL commented Jul 30, 2019

I am using NModbus to connect PC (master) to a PLC (slave).
Everything runs perfect until PLC goes to STOP or ERROR - the connection remains, however the Modbus Slave is not responding.
I am using ReadMultipleRegisters function. The telegram is sent to PLC but there is no response and program is waiting for response. Is there a response timeout method to use? Should I do it any other way?

@MichaDit
Copy link

Yes, you have to set the timeouts for e.g. tcpclient - this is out of scope of NModbus lib.

@ruciuPL
Copy link
Author

ruciuPL commented Jul 31, 2019

I am thinking about using a timer to check if "response" is != NULL. Should it work? How should I perform a "break" (or similar) istruction for a higher-level function (I am out of date in c#)

@MichaDit
Copy link

There are built-in functions for that.
For TcpClient set ReceiveTimeout and SendTimeout.
For SerialPort set ReceiveTimeout.

@ruciuPL
Copy link
Author

ruciuPL commented Jul 31, 2019

Thanks, I will try it ASAP

@ruciuPL
Copy link
Author

ruciuPL commented Jul 31, 2019

Another issue... If a PLC goes to STOP and return to RUN when I send data to it the "slace busy" exception occurs and blocks the whole program (in this case only Modbus in PLC is stopped, the TCP/IP layer is running). I have no idea how to manage this.

@jesbrd jesbrd closed this as completed Nov 21, 2019
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

3 participants