NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically set limits of a test step

I am rather new to TestStand and was wondering how can I programmatically set limits based on the value of a global variable?
0 Kudos
Message 1 of 3
(3,349 Views)
Quintin,
 
You can use the property loader step type to load your limit values from a source file or database.
If you want to set them based on a global variable you can use a pre-expression.
Right Click on your step...
Go to Properties...->Expressions->PreExpression
Add a expression to set your step limits. For example for a numeric Limit Test Step you could add the following pre-expression:
Step.Limits.Low = StationGlobals.Global1,Step.Limits.High = StationGlobals.Global2
 
Pre-Expression is evaluated before the module is executed.
 
If you want to learn more about the 'order of actions that a step performs' you can go to the Step Execution Section in Reference Manual Chapter 3.
 
Hope it Helps.
 
Antonio Lie.
 
0 Kudos
Message 2 of 3
(3,334 Views)
Thanks Antonio,
 
I ended up using expession statesments inside IF, ELSE flow control steps, if that doesn't work I will rework to use your method.
 
Quintin
0 Kudos
Message 3 of 3
(3,316 Views)