NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get step status

Solved!
Go to solution

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?

 

0 Kudos
Message 1 of 8
(4,498 Views)

Try:  (StrComp(Parameters.Step.Result.Status, "Failed") == 0)

 


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

Even this desn not work! Any other way to get the Step Status?

0 Kudos
Message 3 of 8
(4,492 Views)
Solution
Accepted by sonotk

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 4 of 8
(4,489 Views)

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.

0 Kudos
Message 5 of 8
(4,465 Views)

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"

0 Kudos
Message 6 of 8
(4,456 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 7 of 8
(4,446 Views)

Thanks, that explains. I will set up the data source for testing in that case.

0 Kudos
Message 8 of 8
(4,438 Views)