NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

what TestStand GetNumElements return?

You are using the GetNumElements of RunState.Sequence.Main This property has the number of steps in the main group of your main sequence. It does not matter if your sequence fails, terminates, passes, or anything that number does not change. You should be getting the number of elements of Locals.ResultList instead of RunState.Sequence.Main since that is the array you are reading in your for-loop.
Good luck!
0 Kudos
Message 11 of 15
(1,707 Views)
Hello Marcela,
Thank you very much, I have learned a lot in the last two days. I can get step name, step result.status. and database. wow.
I appreciate and value your advices.
0 Kudos
Message 12 of 15
(1,546 Views)
I'm glad I could help
0 Kudos
Message 13 of 15
(1,546 Views)


@Marcela Maldonado wrote:
You can use the following property path

Locals.ResultList[x].TS.SequenceCall.ResultList[y].Measurement[z].Data

x is the step in your main sequence that calls the sub-sequence
y is the multiple numeric limit test index in your sub-sequence
z is the measurement you are trying to get

-----------
I'm curious to find out a bigger picture of what you are trying to accomplish. You might be taking a more complicated route.


From CVI, how can I return the entire Locals.ResultList array?

Is this available after the step runs (e.g. in the cleanup part of a sub sequence?

How do I determine the number of results in the array once I have it?

What I want to do is to have a sub-sequence that has a number of numeric limit tests, call each of these tests, have a callback function that logs the results of that tests.

I do this currently with sub-sequences that have only one test using:

        TS_PropertyGetValNumber(thisContext, NULL,
            "ThisContext.Locals.ResultList[0].Numeric", 0, &numMeasurement);

But the 0 implies only one test per sub-sequence.

Thanks
0 Kudos
Message 14 of 15
(1,431 Views)
mhousel,
 
You can try the TS_PropertyGetValVariant function. You can find cope snipet in the help topic for this function.
 
    TS_PropertyGetValVariant(propObj, &errorInfo,
                             "Locals.NumArray", 0, &tmpVariant);
    CA_VariantGet1DArray(&tmpVariant, CAVT_DOUBLE, &numArray,
                         &numElements);
    CA_FreeMemory(numArray);
        CA_VariantClear(&tmpVariant);
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 15 of 15
(1,418 Views)