question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modbus Reader does not recover from temporary loss of Modbus TCP Slave

See original GitHub issue

With the modbus reader set to poll at 1s, we successfully read several bytes over several intervals. On physically disconnecting the slave from the network, the reader node shows its state change from ‘active’ to "error: “FSM not ready to Read” then to “error{}”, then alternates several times before staying in “error{}”.

Meanwhile the debug trace shows “Error: Port Not Open”

On reconnecting the slave, the node stays in the “error{}” state the “Error: Port Not Open” traces continue.

Proper operation can only be restored by redeploying.

Sample flow below

[ { "id": "mb_reader_mb_client_192.168.1.11_mr_0", "type": "modbus-read", "z": "tab_Main", "name": "mb_client_192.168.1.11_mr_", "showStatusActivities": false, "unitid": "", "dataType": "HoldingRegister", "adr": "12388", "quantity": "2", "rate": 1, "rateUnit": "s", "server": "mb_client_192.168.1.11", "x": 165, "y": 55, "wires": [ [], [] ] }, { "id": "mb_client_192.168.1.11", "type": "modbus-client", "z": "tab_Main", "name": "AMCS1", "clienttype": "tcp", "tcpHost": "192.168.1.11", "tcpPort": "502", "serialPort": "/dev/ttyS0", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "unit_id": "1", "clientTimeout": "5000", "reconnectTimeout": "5000" } ]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:43 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
biancodecommented, Apr 8, 2017

should work with v1.0.9-kappa+ or release v1.0.9

0reactions
joshuatreenlcommented, Mar 31, 2017

Hi

You followed the discussion in modbus-serial. I came to the conclusion that some error handling should be installed in the Node-Red part. It could be automatically, then you might to have change the Modbus Read part (and other Modbus parts) or add new functions Modbus Close of Modbus Clear. If I encounter an error than I have to close the connection. Another option could be an extra input (asynchrone trigger) on the Modbus Read and other modules e.g. Reset Modbus trigger. I can set this trigger if I encounter a timeout or connection refused. Maybe you have some other ideas as well?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modbus TCP Slave problem
Hi, I have a problem with some FMD16 PLC's. We have 15 of them controlling pumps around a site and all of them...
Read more >
recover connection after changing slave ID in easymodbus ...
i cant close the port without closing my entire application, there is no respond to modbusClient.Disconnect(); how can i please recover the ...
Read more >
MBDC-200 Modbus Data Concentrator and Gateway User ...
The MBDC-200 is a Modbus/TCP data concentrator for Modbus RTU networks. The data concentrator features an Ethernet port and two serial ports which...
Read more >
Open MODBUS/TCP Specification
This specification of MODBUS/TCP is being published by being publicly visible on the World Wide Web. It is intended for the benefit of ......
Read more >
ModbusIP Master for SoftPLC® Runtime
SoftPLC also provides a Modbus IP Slave TLM, which is documented here. A single SoftPLC machine can be both a master and a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found