NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Implement buttons in Test Stand Sequence

Hi

I would like to find out how I could implement some buttons within my sequence. I am taking a measurement, if that measurement fails I want the user to be prompted to either 'continue through the sequence' or 'repeat the step' or 'terminate the sequence'. 

 

I have set up my 'if statement' and the three button options 'continue', 'repeat' and terminate', now I need some help to discover how to execute the buttons to do what is mentioned above. 

 

Thanks

0 Kudos
Message 1 of 5
(2,457 Views)

Hi,

 

I think a possible approach would be to use a model callback. This KnowledgeBase article includes some useful steps to get you started:

Programmatically Abort Execution upon Step Failure

 

Best regards,

// Marcus Bengths

0 Kudos
Message 2 of 5
(2,435 Views)

Hi Marcus

 

The article is useful for terminating on each failure. Please see attached, I want to implement these button for one step in my sequence and they should execute depending on what the user selects.

 

Thanks

0 Kudos
Message 3 of 5
(2,426 Views)

Hi Bilalm,

 

I might not be understanding this correctly, but it sounds like you just want to programmatically know which button the operator selected? If so, then Step.Result.ButtonHit will have a numeric value representing the button selected by the operator. Set a local variable to this value, and use the local value in your IF/ELSEIF/ELSE statement.

 

I hope this helps.

 

-Jack

0 Kudos
Message 4 of 5
(2,416 Views)

So if I understand you correctly, once a step fails you would like the user to be prompted with a dialog box with three buttons. Depending on what button the user selects the sequence will either continue stepping, terminate the sequence, or repeat the step that failed. 

 

You should be able to achieve these features by adding a SequenceFilePostStepFailure callback. This callback sequence will run every time a step in the sequence file fails.

  • Add a Message Popup with the buttons you mentioned
  • Implement an if/if else/else-statement and identify what button has been pressed as Captain_Jack suggests
  • Then add action steps for each case
    • The RunState.Execution Object has multiple methods for you to explore. See Execution for a detailed list.
    • For instance you can call the method Execution.terminate to terminate the sequence, or Execution.resume to continue the stepping.

The KnowledgeBase Article I linked before is good as a reference:

Programmatically Abort Execution upon Step Failure

 

Cheers!

//Marcus Bengths

Message 5 of 5
(2,409 Views)