Detecting Modbus/TCP Connection Disconnected

Hi,
I would like to put in two feature request for the Modbus/TCP interface:
First a option to check if a Modbus server/client has disconnected in the URScript.
What I would imagine is either something like:

  1. modbus_open(IP, slave_number) which returns a bool depending on if the server is connected.
  2. modbus_open(signal_name) which returns a bool depending on if the signal/server is OK.

Of course both options would also be nice :slight_smile:

Secondly a URScript command to refresh the Modbus/TCP signals of a server which acts like the refresh button under Modbus in the installation tab.
This would be nice because I’ve had some trouble where an external Modbus server has been restarted so the connection to it was lost and I was first able to connect to it again after refreshing in the Modbus tab.
I do not mind if this refresh is for all connected devices or if it is possible to refresh the signals of only one device.

br
Lukas

4 Likes

I also Need this!
I have a measurement gauge that looses connection when taken our of measurement mode (which the operator uses to change parameters).
I need to be able to know when its been disconnected, Pause the program, continue refreshing the status until connection has been re-established.

2 Likes

I also need this too.

When I test driving due to the project, MODBUS client signal is dead sometimes.
I want a UR function that has the same MODBUS refresh button.
[ ex : modbus_refresh() ]

1 Like

I also need this refresh function, Please.

In your application, is it possible to create a heartbeat style signal? Where you turn on a modbus address, and get a response from the device?
I have used that style code to create a timeout if the response fails.

Hi mricchino,
It is sadly not, the problem is not with the device not being able to handle it, but with the UR script capabilities.
When the modbus signal or device goes into error, either deliberately due to shutdown or because of an error, then if you try to access those signals, then the urscript throws an error and closes the program and there is no good way to get the communication up an running again automatically or detect and handle it in the script.
Currently there are only two ways to reestablish the connection to the device/signals:

  1. Manually go into the modbus table settings and refresh.
  2. Restart the controller - which can be accomplished automatically, but takes ages.

Neither of which are good options for an automatic solution.

1 Like

I’m also running into this issue. A dashboard command or urscript command to perform the “refresh” functionality is absolutely needed!!