Device RTU & TCP is live testing


svego

Recommended Posts

Posted

Hi,

What is the best way to test connectivity of RS485 and TCP devices ?

I want to test devices and if connection fails (like wire broken, radio connection lost etc ) device will be on alarm list..?

I guess that result can be added to virtual channel like 0 or 1 for each device ??

Posted

The easiest way is to simply look at the time stamp on one of the channels you are reading and see if it has been awhile:

systime() - myChannel.time[0] > 2

for example would == 1 if no data had come into myChannel in the last 2 seconds.

Posted

you mean like one sequence ...infinite loop that check one channel of each device ?

What if I want to display LED component and show with red / green light, this example is not appropriate  ???

Posted

There are lots of ways.  You can put that expression right in the LED component if that's the only place you want it.  Other people will put it in a loop they already have or create a new loop and assign the result to a global variable that the LED component accesses.  Then they can add logic as well to actually do something when comms fails like attempt to reinit the port.  

  • 2 weeks later...
Posted

hi,

I tried to put that expression in LED component ...

systime() - x_300_temp1.time[0] > 2,

but value of that expression is changing 0 to 1, so LED is blinking from red to green and vice versa

any suggestion ?

 

 

Archived

This topic is now archived and is closed to further replies.