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,115 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,114 Views)

Nice..thanks.

0 Kudos
Message 3 of 17
(4,110 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,102 Views)

Thanks as well. 

0 Kudos
Message 5 of 17
(4,099 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,090 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,086 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,078 Views)

Thanks..I think that'll work  !!

0 Kudos
Message 9 of 17
(4,070 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,066 Views)