NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Executing a delay while looping

The simplest solution would be to implement the delay in the SequenceFilePostStepFailure callback. You can use a variable to toogle/configure the waiting in this callback since it is executed for every failing step within the sequence file, not only the looping ones.

 

If you are concerned that other developer have to implement this functionality but you are unsure if they can work with the callback (e.g. when to set the toggle/config of the variable?), you should create a custom step type incorporating a wait time.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 11 of 14
(1,294 Views)

Hi Norbert

 

I like that idea.

 

And if one puts this expression in the step preexpression:

 

Step.AsPropertyObject.SetValNumber("Delay",0x1,1)

Creating a new property of the step.

(For reference the first argument is the property name, second argument is the option - in this case "Insert if missing, and the last argument is the value the property is set to.)

Afterwards you could implement this this in the PostStepFailure callback:

Capture.PNG

 

This way you probably wouldnt confuse other developers, as the delay would only be active on steps where you create the variable "Delay".

 

As always good documentation is in order - so other developers dont remove it just because they dont understand what you're trying to do.

 

 

 

Message 12 of 14
(1,224 Views)

You can try Runstate.Execution.WaitForEndEx(timeout in milliseconds, ...).  It returns in (timeout + 100 milliseconds).

Message 13 of 14
(1,133 Views)

that works for me thanks

loop.png

Message 14 of 14
(732 Views)