From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-18-2012 11:29 AM
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
Solved! Go to Solution.
07-18-2012 11:33 AM
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.
07-18-2012 12:34 PM
Nice..thanks.
07-19-2012 05:30 AM
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
07-19-2012 07:02 AM
Thanks as well.
07-19-2012 01:07 PM
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?
07-19-2012 01:36 PM
Override the SequenceFilePostStepFailure callback and put your dialog in there.
07-19-2012 11:41 PM
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.
07-20-2012 06:10 AM
Thanks..I think that'll work !!
07-20-2012 06:44 AM
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"