NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect a step's "Record Results" setting from C-Sharp

1) When the test execution is complete the AxApplicationMgr EndExecution event is raised.

2) My EndExecution event handler method stores the ResultList via a call to

myReport = item.GetValString("TS.StepName", PropertyOptions.PropOption_NoOptions);

3) Then I walk through each entry:

int numElements = myReport.GetNumElements();
for (int i = 0; i < numElements; ++i)
{
    PropertyObject resultData = myReport.GetPropertyObjectByOffset(i, PropertyOptions.PropOption_NoOptions);
    WalkTree(resultData);
}

4) WalkTree() is recursive, but eventually I get to a method with logic like this:

if (item.Exists("TS.StepType", PropertyOptions.PropOption_NoOptions))
{
    if (StepTypes.StepType_SequenceCall == item.GetValString("TS.StepType", PropertyOptions.PropOption_NoOptions))
    {
        return;
    }

    if (item.Exists("TS.StepName", PropertyOptions.PropOption_NoOptions))
    {
        name = item.GetValString("TS.StepName", PropertyOptions.PropOption_NoOptions);
    }

    if (item.Exists("Status", PropertyOptions.PropOption_NoOptions))
    {
        status = item.GetValString("Status", PropertyOptions.PropOption_NoOptions);
    }

    ... and so on ...
}

 

That's what we're doing.

0 Kudos
Message 11 of 12
(720 Views)

Hi tlaford,

 

After reading the post again, I think the value you are looking for can be found here.

 

ThisContext.RunState.Sequence.Main["Statement"].TS.NoResult

 

You have to enable Show Hidden Properties under Configure >> Station Options >> Preference in order to see them.

 

I hope this helps.

 

Regards,

 

Josh L.

Applications Engineer
National Instruments
0 Kudos
Message 12 of 12
(700 Views)