NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting step results/parameters on PostStepFailure Engine Callback

I'm trying to do some fault isolatio in my tests. I've enabled the PostStepFailure Engine Callback and I'm passing the step and result handles to a C function as CAObjHandles. My problem is that I can't find any of the step result/parameters like:
 
TS.StepName
TS.StepType
Comp
Measurement
Limits.Low
Limits.High
 
The callback works fine, but I need to access these variables in order to do the fault isolation. Can any one tell me how I can access these six variables?
 
I've tried to access these variables both in the sequence file and then passing the values to the C-function as well as in the C-function, but both methods yield errors
 
Hurst
0 Kudos
Message 1 of 6
(3,363 Views)

Hi Hurst,

The main problem here is going to be dealing with all the different step types.  Because Numeric Limit Test will pass different information to the parameters than a Pass/Fail Step.  You won't see any of the information there during development but if you put a breakpoint in your SequenceFilePostStepFailure callback then you will be able to look at the parameters in the Context tab.  You will see that if you fail a Numeric Limit Test you can get access to the limits by using Parameters.Step.Limits.Low/Parameters.Step.Limits.High.  However, this wouldn't exist if you had a different step type. By looking at the Context tab when you put in a breakpoint you will be able to look for the other variables as well.

Hope this helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(3,346 Views)
Hi Hurst,

Just to add to Sam's comments, you can get the name and type of the step using the expression functions "NameOf()" and "TypeOf()", respectively.  Here's a knowledgebase article that may help as well.

Have a great day,

Ecleamus Ricks, Jr.
National Instruments
Applications Engineer
Message 3 of 6
(3,334 Views)

Ok, that was good info. I've got the basic part of the fault isolation function implemented and working great. However, the callback causes a new problem, which I hope some knows how to solve.

I have a custom Operator Interface (OI) based upon the full featured OI that came with TestStand 2.0 (it runs fine under TS 3.0). In this OI I am using the Trace Callback to display a list of executed steps in the execution window. The problem is that when a step failure occurs, both the PostStepFailure and Trace callbacks are called (I haven't determined the order). But when I extract the step information in the Trace callback I find that it is giving me the information from the step being executed by the PostStepFailure Engine Callback. The test report, however, has the correct information for the steps in question so I know that TestStand knows how to do it correctly.

Hurst

0 Kudos
Message 4 of 6
(3,320 Views)
Hi Hurst,

Glad to hear you were able to get the callback to work the way you wanted.

As for the second question, I suggest checking what tracing options you have checked on the Execution tab under the Configure » Stations Options menu. When tracing is enabled, a trace event is fired between each step that executes and in turn, your callback function is called.  This means that if you have Allow Tracing into Pre-/Post-Step Callbacks checked then your trace callback will be called between each step that executes within your PostStepFailure callback along with each step in your sequence.  I assume you don’t want the PostStepFailure steps to be displayed in the execution window in which case you just need to disable the aforementioned option.

Let me know if I’ve misinterpreted what you are doing.

Have a great day,

Ecleamus R.
Message 5 of 6
(3,293 Views)
That was the right answer, everything works great now (and no more side effects).
 
Thanks again.
0 Kudos
Message 6 of 6
(3,264 Views)