Sign in to follow this  
svego

Device RTU & TCP is live testing

Recommended Posts

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 ??

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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  ???

Share this post


Link to post
Share on other sites

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.  

Share this post


Link to post
Share on other sites

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 ?

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this