NI VeriStand Add-Ons Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

stop stimulus profile execution automatically in case of an alarm is triggered

Hii All

How to create an automated stop procedure to stop a stimulus profile using stimulus editor in case of an alarm in the system is triggered.

0 Kudos
Message 1 of 6
(4,347 Views)

What I usually do is have 2 tasks (multi-threads) loops running, one running the profile, the other looking for an alarm condition (EStop).  If the alarm is triggered, the alarm task loop stops the profile task loop (end task), does cleanup (establish a safe condition) and the procedure will end.  Just make sure when your profile loop ends, it tells the alarm loop to also end.  That way the profile will exit cleanly.

0 Kudos
Message 2 of 6
(3,844 Views)

Hii Joshe

Thank you for your prompt reply. I will try the 2 loops.

0 Kudos
Message 3 of 6
(3,844 Views)

Hi,

You will need some channel in your system definition that signals that an alarm has happened or the alarm channel itself.  You can also set a User Channel to True in your sys def alarm if you want.  Then in your Stimulus Profile, have the Alarm Loop thread watch that "alarm" channel.  I have attached an example.  Hope it works for you.

0 Kudos
Message 4 of 6
(3,844 Views)

Wanted to also mention that we added a feature in VeriStand 2015 that allows procedures to stop all running sequences.  You could have the alarm trip a procedure that calls this step:

2016-02-01 12_24_48-Photos.png

The difference between "stop" and "abort" is whether or not the sequences run their Clean Up steps.  Joshe's method is totally viable as well, and gives you a bit more control within the sequence.  Just letting you know an alternative if you need it.

0 Kudos
Message 5 of 6
(3,844 Views)

@ Thor

Thanks for the info. I am using VeriStand 2013. Therefore, using the 2 loops concept is a good choice.

@joshe: Thanks

0 Kudos
Message 6 of 6
(3,844 Views)