Stop Program when UR has no connection to MODBUS-Server

I’m not sure if I understand that correctly, but current behavior is that program is stopped whenever it tries to access modbus signal that is not connected.
You could have a script running in separate program thread that periodically reads all modbus signals that are critical for you.
Something like:

thread checkModbus():
while True:
modbus_get_signal_status(“critical_signal”, False)
sleep(1)
end
end