VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to loop a stimulus profile?

Solved!
Go to solution

I need to close a Fault Insertion Channel for 1 second every 20 seconds.  What is the best way to do this?  I need the ability to stop and restart the loop on demand, but most of the time the loop will be running.

I considered making some type of virtual instrument, but this is such a simple task I don't know if that is necessary.  Also I don't know if this is going to solve my larger problem and I need to fail fast.  I've never made a virtual instrument and if it's going to take several days to figure out how that is too long.  I do have experience in C so if I can make this CVI in a matter of hours that would be great.

0 Kudos
Message 1 of 5
(7,187 Views)
Solution
Accepted by topic author jaime_c

I created a user channel to determine whether the loop should continue.  At the end of the stimulus profile if the channel is true the profile starts over.  If not it stops.   This gives me basic functionality - now my only concern is whether it will interfere with the other things I'm doing in VeriStand.

Message 2 of 5
(7,183 Views)

I haven't tried this but I think it should work: Try creating a low priority alarm whose limits are always tripped.  Set the alarm delay to 20 seconds.  Inside the alarm action add code (you will need to create a procedure for this alarm) that checks a user variable for enable/disable so it will bypass the 1 second on dwell if not enabled.  This should always run every 20 seconds or so (you may have to tweak the alarm delay) regardless of whatever else you are doing (aside from a higher priority alarm).

Message 3 of 5
(7,140 Views)

The approach you used should work pretty well. The main consequence it will have is that since you can only run one stimulus profile at a time in NI VeriStand 2010, you won't be able to run any other tests while this loop is running.

 

FYI, NI VeriStand 2011 just released. The main new feature is a new stimulus profile editor and execution system. The new system contains looping and branching structures, which should make creating these types of test sequences much easier than in 2010. Also, in 2011 you can have multiple of the new real-time sequences running at the same time, so you would be able to run other tests while your fault insertion loop ran. Here is what your fault insertion loop would look like in the new profile system available in 2011. For more info on the new features refer here.

 

FaultInsertionLoop.PNG

Jarrod S.
National Instruments
0 Kudos
Message 4 of 5
(7,068 Views)

Thanks Jarrod.  I have been hoping VeriStand 2011 would support execution multiple Stimulus Profiles at once.  I will be staying with 2010, though, until I get a new project because of the risk involved with switching over.

Message 5 of 5
(7,038 Views)