01-12-2012 11:34 AM
I'm working on a project that in some cases, (i.e.: during startup, shutdown) subsequence steps typically may fail (which is normal).
Because of these failures make it nearly impossible to set "Break on Step Failure" and stop on the failed step, because there are so many of them.
What I'd like to do is create a set of steps going into some of these startup and shutdown library routines such as:
Step1: Disable "Break on Step Failure:
Precondition: If SeqEdit "Break on Step Failure" = Enabled
Post Expression: "Break on Step Failure" = Disabled
Locals.bDisableSet = True
Step2: Enable "Break on Step Failure:
Precondition: If Locals.bDisableSet = True
Post Expression: "Break on Step Failure" = Enabled
Locals.bDisableSet = False
What I need is the commands to test to see if the SeqEdit "Break on Step Failure" is Enabled or Disable, and how to reset the value within the steps.
We're running TestStand 2010
Mike
Solved! Go to Solution.
01-13-2012 06:01 AM
You can use this function :
To read status :
Locals.flag=RunState.Engine.stationoptions.BreakOnStepFailure ( locals.flag is Boolean variable)
To set status :
RunState.Engine.stationoptions.BreakOnStepFailure=False ( or True to enable)
01-14-2012 12:23 PM
Thanks for the reply,
Looks like this is the solution, however, I've run across a condition that sort of complicates things.
I have some steps such as:
Read Parameter(x)
Looping Property is:
Loop Type: "Pass/Fail count"
Stop after "1" Itterations "pass" or after a maximum of "1000"
Basically, it's a step that loops for 1000 itteration or until it Passes.
BreakOnStepFailure stops on each itteration of "Failed".
Is there a way to disable the "BreakOnStepFailure" within the step, or am I forced to add steps before and after this step?
I can't change the Post Expression to not "Fail", but is there another STATE that I can look for so that it doesn't report "Failed" until it Passes?
I thought about Disabling the "BreakOnStepFailure" in the PreExpression and Enabling it in the Post Expression, but thats turnign it On and OFF for each itteraition (or at least I think!).
We have a lot of existing steps like this and I'd rather find a solution within the step, rather than having to add steps before and after to disable the "BreakOnStepFailure". I'm trying to figure out a way to handle these without a lot of re-writing.
Mike
01-16-2012 08:24 AM
You can check the loop count and enable the flag only after n number of loops in post expression of the looping step.This will avoid breaking of steps for each loop.
RunState.Engine.stationoptions.BreakOnStepFailure=(RunState.LoopIndex<7?False:True)
Hope this helps.
01-25-2012 09:21 AM
Turns out that I didn't need to worry about the Loop step. The step will report "Failed" as it's executing, but TestStand won't stop on the failure until it FAILS after completing the Loop option.
The solution above worked GREAT for us. Thanks.