NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fill step parameters with CVI

Hi,

 

I am trying to create a new step using TestStand API and i am wandering how to fill the step parameters.

In fact, i can create a step (an activeX step) using :

 // Création d'un step
 ErrChkTS (TS_EngineNewStep (gEngine, &errorInfo, TS_AutomationAdapterKeyName, TS_StepType_Action, &gStep));
 // Ajout du nom du step
 ErrChkTS (TS_StepSetName (gStep, &errorInfo, "UIMessage"));

 // Récupération d'un handle sur la séquence
 ErrChkTS (TS_SeqFileGetSequenceByName (gCurrentSequenceFile, &errorInfo, szSequenceName, &gSequence));
 // Récupération du nombre de steps
 ErrChkTS (TS_SequenceGetNumSteps (gSequence, &errorInfo, TS_StepGroup_Main, &iNumberOfSteps));
 // Insertion d'un step à la fin du Main
 ErrChkTS (TS_SequenceInsertStep (gSequence, &errorInfo, gStep, iNumberOfSteps, TS_StepGroup_Main));
 // Sauvegarde de la séquence 
 ErrChkTS (TS_SeqFileSave(gCurrentSequenceFile,NULL,szSequencePath));

But how do i fill the step (inserting Automation server, Object reference, Object Class, the call method and the parameters)

0 Kudos
Message 1 of 2
(3,263 Views)

Hello Nanor,

 

I invite you to browse to this page and to take a look on this example. In the CVI example, you can find those lines, used to insert and configure a step, including step parameters:

////////////////////////////////////////////////////////////
// Create a LabVIEW string value test that calls "StringValueTest.vi"
//

// Note that in this case we specify both the module adapter and the step type
tsErrChkMsgPopup(   TS_EngineNewStep (engine, &errorInfo, TS_GAdapterKeyName, "StringValueTest", &lvStep));
// Set the step name
tsErrChkMsgPopup( TS_StepSetProperty (lvStep, &errorInfo, TS_StepName, CAVT_CSTRING, "LabVIEW String Value Test"));
// Set the VI that it calls
tsErrChkMsgPopup( TS_PropertySetValString (lvStep, &errorInfo, labviewVIPropertyPath, 0, "StringValueTest.vi"));
// Set the expected string value
tsErrChkMsgPopup( TS_PropertySetValString (lvStep, &errorInfo, expectedStringValuePropertyPath, 0, "System OK"));
// Add the new step to the sequence
errChk( InsertStepAtEndOfSequence(sequence, lvStep, TS_StepGroup_Main));

 

////////////////////////////////////////////////////////////
// Create a CVI numeric limit test that calls "NumericLimitTest.c"
//

// Note that in this case we specify both the module adapter and the step type
tsErrChkMsgPopup(   TS_EngineNewStep (engine, &errorInfo, TS_StdCVIAdapterKeyName, "NumericLimitTest", &cviStep));
// Set the step name
tsErrChkMsgPopup( TS_StepSetProperty (cviStep, &errorInfo, TS_StepName, CAVT_CSTRING, "CVI Numeric Limit Test"));
// Set the module that it calls
tsErrChkMsgPopup( TS_PropertySetValString (cviStep, &errorInfo, cviModulePathPropertyPath, 0, "NumericLimitTest.c"));
// Set the module type: 1 = source file (.c)
tsErrChkMsgPopup( TS_PropertySetValNumber (cviStep, &errorInfo, cviModuleTypePropertyPath, 0, 1.0));
// Set the source file for the module (in this case it is the same as the module file)
tsErrChkMsgPopup( TS_PropertySetValString (cviStep, &errorInfo, cviSourceFilePathPropertyPath, 0, "NumericLimitTest.c"));
// Set the function that it calls
tsErrChkMsgPopup( TS_PropertySetValString (cviStep, &errorInfo, cviFunctionNamePropertyPath, 0, "NumericLimitTest"));
// Set the high limit
tsErrChkMsgPopup( TS_PropertySetValNumber (cviStep, &errorInfo, highLimitPropertyPath, 0, 50.0));
// Set the low limit
tsErrChkMsgPopup( TS_PropertySetValNumber (cviStep, &errorInfo, lowLimitPropertyPath, 0, -20.0));
// Set the comparison type
tsErrChkMsgPopup( TS_PropertySetValString (cviStep, &errorInfo, comparisonTypePropertyPath, 0, "GTLE"));
// Add the new step to the sequence
 errChk( InsertStepAtEndOfSequence(sequence, cviStep, TS_StepGroup_Main));

Hope this helps,

0 Kudos
Message 2 of 2
(3,224 Views)