NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS precondition help

Hi, newbie here.
(Apologies if this has been posted before. I have searched, but cannot find a suitable answer)
 
I have a main sequence of 20+ steps.
In the cleanup of the main sequence I want to run a step, ONLY if all steps in the main sequence have passed.
 
I realise I could use the precondition function:
 
AllOf(
RunState.Sequence.Main["step1 name"].Result.Satus == "Passed",
RunState.Sequence.Main["step2 name"].Result.Satus == "Passed",  
etc....
)    
 
But, I want a more elegant solution than this so I can add this cleanup step to other
sequences (with different steps) without having to build this function for each.   
 
Is there a way to do this?
Perhaps by looking up an overall pass status, rather than individual steps?        
Even better would be a lookup variable that can be accesed through CVI.   
 
Any thoughts appreciated.
 
(TS4.0, CVI 8.5)
0 Kudos
Message 1 of 6
(3,643 Views)

Hi,

Try

!RunState.SequenceFailed

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 6
(3,628 Views)
Thanks Ray, spot on!
0 Kudos
Message 3 of 6
(3,621 Views)

Hi again.

Is there a CVI accesible variable which can be checked to see if the test sequence has been terminated?

 

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

Hi,

Are you in a code module that is probably performing some loop and you want to check that the operator hasn't pressed the Terminate or Abort button?

If the answer is Yes, then you probably need to use TS_ExecutionGetTerminationMonitorStatus.

Attached is a piece of CVI code which shows its use. The TestStand Programmer Reference will also help.

I think this is from an example from the NI website

Hope it helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(3,579 Views)
Thanks Ray, that looks ideal.
Appreciate your swift reply. Smiley Happy
0 Kudos
Message 6 of 6
(3,576 Views)