From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

custom conditions

Solved!
Go to solution

I have a power supply measurement step in TS 4.2 using LV Adapter.  If the test fails the next step is a popup telling the operator of the possible cause ( Check Power Supply 1 is on).  No problem setting that up in Preconditions.  Now how do you get the sequence to terminate??  Wanted something like: If the check power supply 1 step fails then terminate.  How do you know where the pass/fail result is for a previous step??  I don't want to use the subscript in case I add more steps later.  I read the values for step 1 are stored in a variable with subscript [0] step 2 [1] etc.

 

Thanks

0 Kudos
Message 1 of 17
(4,109 Views)
Solution
Accepted by topic author clint100

I don't have TestStand with me right now, but I'm sure it is the PreviousStep.Result container.  I don't remember the last part at the top of my head.  The autofill should help out as you type it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 17
(4,108 Views)

Nice..thanks.

0 Kudos
Message 3 of 17
(4,104 Views)

You can get the status of any previously run step.An example for a step named label is shown below :

 

if(RunState.Sequence.Main["Label"].Result.Status == "Failed")

{ popup message

go to end

}

 

From the expression edit - select runstate then sequence then main then the step you want then results and finally status

 

0 Kudos
Message 4 of 17
(4,096 Views)

Thanks as well. 

0 Kudos
Message 5 of 17
(4,093 Views)

Is there some generic expression i can use to always get the "previous step"??  I have hundreds of test and if they fail I want the popup to be displayed.  If I cut and paste them by the time I get to the 2 nd test its still linked to the first test. 

ie:

Test 1

popup if test 1 fails

test 2

popup if test 2 fails.

etc

 

if I cut and paste the popup for test 2 I have to go in..delete the precondition statement then add the new one for test 2.

This is an example of what  is there:

RunState.Sequence.Main["ID#:FjhX/Kw9sEqBsghxs7PIsB"].Result.Status =="Failed"

 

The["id#:f ........ i'm guessing is refereeing to the previous step.  Why is that so cryptic?

0 Kudos
Message 6 of 17
(4,084 Views)

Override the SequenceFilePostStepFailure callback and put your dialog in there.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 17
(4,080 Views)

you can use :

if(RunState.PreviousStep.Result.Status =="Failed")

 

As for the cryptic thing :

 

Its the ID of a step stored instead of name.This takes care of somebody accidentally adding new steps or deleting the steps in between , or renaming of a step.

 

This is optional - whenever you try to link to some step there is a popup which asks you to select ID if required.

Message 8 of 17
(4,072 Views)

Thanks..I think that'll work  !!

0 Kudos
Message 9 of 17
(4,064 Views)

Does that ID change everytime you open Teststand ??  I opened Teststand and there is an error on every step I used the

precondition expression:  RunState.Sequence.Main["ID#:FjhX/Kw9sEqBsghxs7PIsB"].Result.Status =="Failed"

 

  I get   "<FAIL> Invalid Target"

0 Kudos
Message 10 of 17
(4,060 Views)