02-24-2012 03:43 PM
I am using ProcessModelPostStep callback to check if the status of step is "Failed". To check the status of Step I use: (StrComp(RunState.Caller.Step.ResultStatus, "Failed") == 0)
If I insert a Step of any type and force it to fail or set the run mode to Normal and step fails, ResultStatus always detects it as "Done".
Is there a way to detect any step type if Failed when run mode is Normal or run mode set as Force Failed?
Solved! Go to Solution.
02-24-2012 05:46 PM
Try: (StrComp(Parameters.Step.Result.Status, "Failed") == 0)
02-24-2012 11:10 PM
Even this desn not work! Any other way to get the Step Status?
02-25-2012 12:20 AM
sonotk,
It works fine for me. You cannot have the run mode of a step set to anything but Normal. If it's set to Force Pass or Force Fail the step actually doesn't register this engine callback. The module doesn't even get executed.
Hope this helps,
02-27-2012 02:45 PM
Thanks jigg, I didn't know that Force Pass or Force Fail the step doesn't register this engine callback. I suppose then there is no way to get the Force Fail status then.
Thanks for the explanation.
02-27-2012 11:03 PM
Most of the NI step will always show status as "Done" for properly executed step and "Error" for failure to execute the step.
"Passed" or "Failed" are shown for steps that are tests ex numeric limit tests or pass fail tests.
In these tests the step will execute perfectly ( not an error) but the final result will be not as expected.
Also for a custom step it is the job of the underlying DLL/vi to set the status to "Passed" or "Failed".By default it will be "Done".
As a generic case you can simply check for not an "Failed" and not an "Error"
02-28-2012 08:42 AM
sonotk,
If you look in the TestStand Reference Manual (Start>>All Programs>>National Instruments>>TestStand>>Documentation>>Manuals) in chapter 3 there is a section called Step Execution. This is the most helpful table I've ever used for TestStand. Basically it breaks down the actions that occur during execution.
Look at action 6 (Check run mode for Force Pass or Force Fail). It states: "Sets the corresponding status on the step, then proceeds to Action Number 27" So basically actions 7-26 are skipped. If you look at the skipped actions you will see that the code module (action 15) gets skipped as well as the Post-Step Engine callback (action 20). The only engine callbacks after 27 are Post-Step Failure and Post-ResultList Entry. You can use either one of those to accomplish your goal. The only problem is that Post-Step Failure is only if the step status if Failed.
All that being said: I'm sure you realize this but it's not a good idea to release code with the run mode set to anything but Normal. Usually I just use it to see what the report will look like. And even then it doesn't do a great job. If I'm testing functionality I will usually change my data source for a step to something I know evaluates to either pass or fail. That way I get full functionality.
Hope this helps,
02-28-2012 11:13 AM
Thanks, that explains. I will set up the data source for testing in that case.