Accessing Built-in Properties in LabWindows/CVI
- Updated2025-07-23
- 1 minute(s) read
TestStand defines a number of built-in properties that are always present for objects, such as steps and sequences. Nearly every kind of TestStand object has built-in properties that are static with respect to the TestStand API, which you can use to access the properties in the programming language you specify. The Sequence.Name and SequenceContext.Sequence properties are examples of built-in properties.
In LabWindows/CVI, you access built-in properties using a property function in the ActiveX driver. The following code obtains the value of the Sequence.Name property:
int GetSequenceName(CAObjHandle sequence)
{
int error = 0;
ErrMsg errMsg = "";
ERRORINFO errorInfo;
char *sequenceName = NULL;
tsErrChk(TS_SequenceGetName (sequence, &errorInfo, &sequenceName));
Error:
// Free Resources
if (sequenceName)
CA_FreeMemory(sequenceName);
return error;
}
The following function obtains a reference to a step named CVI Pass/Fail Test from a Sequence object:
int GetStepInSequence(CAObjHandle sequence)
{
int error = 0;
ErrMsg errMsg = "";
ERRORINFO errorInfo;
CAObjHandle step = 0;
tsErrChk(TS_SequenceGetStepByName (sequence, &errorInfo, "CVI Pass/Fail Test", StepGroup_Main, &step));
Error:
// Free Resources
if (step)
CA_DiscardObjHandle(step);
return error;
}