NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Step Fail Causes Sequence Fail state from LW/CVI Custom Code Generator

Solved!
Go to solution

Hi,

 

I have a CVI Code Generator as part of the ATML Importer Toolkit.  NI have kindly provided me with an example of how to change the Step Type as part of the Custom Code Generator DLL and that works fine.

 

However if I try to change the Step Fail Causes Sequence Fail value to VTRUE it appears not to fix the value when the Sequence is looked at in Test Stand.

 

The code I use is:

 

TS_StepChangeStepType (stepHandle, &errorInfo, typeDefinition);  

                         -where typeDefinition can be changed to change the step type, this works and I can change the step type as needed.

 

TS_StepSetStepFailCausesSequenceFail (stepHandle,&errorInfo, VTRUE); 

                         -which doesn't work, the tickbox is always set to VFALSE.

    

 

 

Is there something I'm missing?  

 

Many thanks,

 

Steve

0 Kudos
Message 1 of 4
(3,871 Views)
Solution
Accepted by topic author kellymidge10101

Steve-

 

You must use the PropertyObject of the Step to modify the Step Failure Option. There should be a line of code the in Custom Code Generator that calls:

 

// Get the step as a PropertyObject in case there is a need to modify general step properties
tsErrChk(TS_StepAsPropertyObject(stepHandle, &errorInfo, &stepObject));

 

The stepObject is what you should pass to the function TS_StepSetStepFailCausesSequenceFail as follows:

 

// Set the Step Failure Option of the step

tsErrChk(TS_StepSetStepFailCausesSequenceFail(stepObject, &errorInfo, VTRUE));

 

Please let us know if this gets you to the correct outcome.

 

-Jeff

Message 2 of 4
(3,857 Views)

HI, Thanks for the reply,

 

I have used PropertyObject of the Step as you suggested:

 

errChk (TS_StepAsPropertyObject(stepHandle, &errorInfo, &stepObject);

 

I then pass stepObject to TS_StepSetStepFailCausesSequenceFail

 

The step generated still does not reflect the setting (VTRUE) I pass in the Step Set function.

 

Out of curiosity for debug I stepped through the CVI code with the following calls:

 

TS_StepSetStepFailCausesSequenceFail (stepObject,&errorInfo,VFALSE);

TS_StepGetStepFailCausesSequenceFail (stepObject,&errorInfo,&boolSetting); - boolSetting = -1

TS_StepGetStepFailCausesSequenceFail (stepHandle,&errorInfo,&boolSetting); - boolSetting = 0

 

Yet the step is still showing FALSE (the checkbox is unchecked).

 

I'm obviously getting a bit confused, addded to which  - if a step is dragged in from the pallette, the default setting for 'Step Causes Sequence Failure' is TRUE (Checked) so I assume that it's being set somewhere else after the callback in the CVICodeGenerator??

 

Thanks,

 

Steve

0 Kudos
Message 3 of 4
(3,834 Views)

Jeff,

 

Thanks for your help.  It all works swimmingly now I've put the code in the correct post translation callback!

 

It's the details that matter.....Smiley Frustrated

0 Kudos
Message 4 of 4
(3,732 Views)