NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestSand SequenceFile LoadModules function

I have an C++ application interacts with TestStand engine callback through C/C++ dll adapter, which needs to migrate to TestStand 2019 from version 1.0. The application uses Microsoft MFC Wrapper (Ole Automation) to interact with TestStand engine for building and executing TestStand sequence files through MFCCOleDispatchDriver class. First, it creates TestStand Engine

d_engine = new Engine;

rtnVal = d_engine->CreateDispatch(L"TestStand.Engine");

There is a “template.seq” sequence file defined all the application custom test steps with its defined properties and default modules to call for each test step, it is loaded into the TestStand engine

IDispatch *d_templateSeqFileDisp = d_engine->GetSequenceFile(L"C:\\Temp\\Template.seq", 0x10);

Next, when create a new sequence file and insert a step which is already defined in the template.seq, the corresponding properties and default modules of that step was copied to the newly inserted step when defined the module load option = 4 in the original application and as below:

The original call was: d_newSeqFile->SetModuleLoadOption(TS_LoadOption_UseStepLoadOption);

Constant LoadOption_UseStepLoadOption = 4
Member of TS.ModuleLoadOptions
(Value: 4) Loads each code module according to the load option for the step that uses it. This option is valid only for the SequenceFile.ModuleLoadOption property.

 

However, the SetModuleLoadOption function no longer existed in TestStand 2019 and seems it is replaced by another function named "LoadModules" in SequenceFile as below :

Member of TS.SequenceFile - 

Function LoadModules([ByVal loadOptions As Long], [ByVal sequenceContextParam]) As Boolean
Loads the code modules for all steps in all sequences of the sequence file.

 

Purpose: Loads the code modules for all steps in all sequences of the sequence file.

Parameters - loadOptions As Long

[In] Specifies one or more LoadModuleOptions using the bitwise-OR operator to modify the behavior of this method. This parameter has a default value of 0.

 

- sequenceContextParam As Variant

[In] [Optional] If you are passing the LoadModule_EvaluateExpressions flag to the loadOptions parameter, pass a SequenceContext object for this parameter to use when evaluating the expressions. Also, if you are calling this method from a step in an execution, pass the sequence context of the execution.

 

LoadModule_EvaluateExpressions–(Value: 0x4) Loads modules of Sequence Call steps that specify the module by expression. Pass a sequence context to the method when using this option.

 

Question :
I think the loadOptions still be LoadOption_UseStepLoadOption = 4 in the first parameter, but not sure how to create and pass the sequenceContextParam as the second parameter in the LoadModules.

0 Kudos
Message 1 of 1
(1,551 Views)