NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing a Guard Timer per test step

Justin -
If you want a set of steps to run before and/or after every step in a client sequence file and any step in a sequence that the client calls, you can use the ProcessModelPreCallback and ProcessModelPostCallback. The purpose of the callbacks are to wrap every step that is executed outside of the process model. One disadvantage is that this can slow down execution because you might not need to execute the callback steps for every step.

If you only want to wrap the steps in a specific sequence file, you can create the SequenceFilePreStepCallback and/or SequenceFilePostStepCallback in the specific file. These callbacks only apply to the steps in the file and not any other steps
in other sequence files that it calls.

If you wanted to target specific steps and not all steps in a sequence file, you could just add the create and delete steps around the step the requires the guard.

Lastly, if the guard timer always surrounds a specific step type, such as a sequence call, you could copy the the sequence call to create a custom step type, and add a presubstep and a postsubstep to the custom step type. These substeps would wrap the sequence call. This way the wrapper substeps only apply the custom sequence call step type.

Lots of options, what you choose just depends on what your long term goal is in your development. I typically do not recommend using pre and post callbacks unless they are really necessary because they always run no matter what step executes.

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 11 of 11
(715 Views)