NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to loop over a vi call from a watchdog timer "timeout"

I am trying to set up a watchdog timer to watch an action that opens up a com port between my pc and a device. sometimes the device might time out and just sit there for 5 minutes when it should only take 3 seconds tops. after it times out, the next time i run through it, the com port and pc are able to communicate no problem. So, i want to set up a watchdog timer to see if the communication is taking longet thatn 5 seconds to establish. I found an example of a watchdog timer here on the forums but i am not sure how to implement it into my code to do what i want it to do. 

 

I want to set a WatchDogVariable right away. then begin the watchdog timer by executing a new thread for the timer sequence. If the WatchDogVariable is non zero, then it will enter a loop that has a wait set for 5 seconds, ie the amount of time i am limiting this communication to be established between PC and device. After the wait, if the main sequence has not reset the WatchDogVariable, ie successfuly opened up communication, before the wait expires, i want to try to open the communication one more time. I want to run this same timer agian on the same step and if it fails again i want the execution of the main sequence to run to cleanup. 

 

I have attached a rough example of what i have so far. any ideas or pointers? 

 

Thanks!

Download All
0 Kudos
Message 1 of 4
(2,758 Views)

Why don't you try to do this watchdog inside of the code module? All the logic of timeout checking, looping of step you can do there; and will have "clean" sequence.

B/c what if you will need to take care about steps timeouts for other code modules? 

I'd recommend to go this way - to do it inside code modules...

 

Sincerely, kosist90

 

logos_middle.jpg

Message 2 of 4
(2,732 Views)

How do you do this inside the module?

0 Kudos
Message 3 of 4
(2,704 Views)

Hi,

 

You might take a look at this whitepaper for a better explanation of how to implement this within a LabVIEW code module:

 

http://www.ni.com/product-documentation/14616/en/

Adam
Message 4 of 4
(2,691 Views)