How do I get a TestStand™ Property Object for “MainSequenceResult” in LabWindows/CVI™?

Updated Jul 6, 2026

Reported In

Software

  • TestStand
  • LabWindows/CVI

Issue Details

I have a TestStand sequence file where I can successfully access the MainSequenceResult PropertyObject inside the PostMainSequence callback in the sequence file. I am trying to implement the same logic in a LabWindows™/CVI™, but I cannot access the MainSequenceResult PropertyObject. When I attempt to retrieve it using the TestStand API, I get runtime error:
 
Error code: -17306; unknown variable or property name.
 
How can I get the property object of the MainSequenceResult in LabWindows/CVI?
 

Solution

When using a LabWindows/CVI code module with a valid SequenceContext, the correct approach is to retrieve Parameters.MainSequenceResult directly using TS_PropertyGetValIDispatch, otherwise this operation will result in the same error shown above. The example demonstrates how achieve this from a CVI code module that reads values from the TestStand Parameters.MainSequenceResult object reference.Equivalent TestStand expression:

ThisContext.AsPropertyObject.GetValInterface("Parameters.MainSequenceResult",0).AsPropertyObject.GetValNumber("Error.Code", 0)

In CVI, the TS_PropertyGetValIDispatch returns the object reference as a CAObjHandle, which can then be passed directly to other TestStand PropertyObject API functions such as TS_PropertyGetValNumber, TS_PropertyGetValString, and TS_PropertyGetValBoolean. The following code shows how to obtain that reference and call the TS_PropertyGetValNumber:

CAObjHandle mainSequenceResult = 0;

tsErrChk(TS_PropertyGetValIDispatch(seqContextCVI, &errorInfo, "Parameters.MainSequenceResult", 0, &mainSequenceResult));

tsErrChk(TS_PropertyGetValNumber(mainSequenceResult, &errorInfo, "Error.Code", TS_PropOption_NoOptions, &mainSeqErrorCode));

Additional Information

The attached PostMainSeqTest.zip has the complete guide on how to implement this. When compiling the code into a dll for TestStand 64-bit use make sure to unload the Easy Tab Control Instrument Library. 

 

Otherwise, the build will result in the following error:   26, 1    error: #error this custom control is not supported in 64-bit applications