Modbus ON-Line / OFF-line status

I would like to monitor the OFFLINE status of Modbus device.
For now I'm using SERIAL comunication.
If the device is OFFLINE I would lit RED LIGHT.
If it is ONLINE the light would be GREEN.
I tried with STATUS (link below), but if device goes OFFLINE the function does not execute...

How can I show OFFLINE status?


I have figured out.
For now I use simple function (connected to button):

var status = msg.status.text;
var error = false;
msg = {};
if(status.indexOf('active') == -1){
msg.background = "RED"; //COMM ERROR
msg.background = "GREEN"; //COMM OK
return msg;

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.