svego Posted October 11, 2016 Share Posted October 11, 2016 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 ?? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 11, 2016 Share Posted October 11, 2016 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. Link to comment Share on other sites More sharing options...
svego Posted October 12, 2016 Author Share Posted October 12, 2016 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 ??? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 12, 2016 Share Posted October 12, 2016 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. Link to comment Share on other sites More sharing options...
svego Posted October 23, 2016 Author Share Posted October 23, 2016 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 ? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 25, 2016 Share Posted October 25, 2016 How often is x_300_temp1 updated? Link to comment Share on other sites More sharing options...
svego Posted October 25, 2016 Author Share Posted October 25, 2016 Link to comment Share on other sites More sharing options...
AzeoTech Posted October 25, 2016 Share Posted October 25, 2016 The timing is 2, so you need to make it > 4 or something BIGGER than 2. Link to comment Share on other sites More sharing options...
svego Posted October 25, 2016 Author Share Posted October 25, 2016 so simple, but didn't think about it.. THX..it works Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.