TestStand 2019 Help
»View Product Info
This example demonstrates how to use an expression in a Statement step to dynamically change the high and low limits of a Numeric Limit Test step.
||Note National Instruments typically recommends that you use expressions when you configure a Numeric Limit Test step or to use a Property Loader step to change limits, but this example demonstrates how to change step properties.
Example File Location
<TestStand Public>\Examples\Built-In Step Types\Statement Step Type\Statement Step Type.seq
How to Use This Example
Complete the following steps to use this example.
- On the Steps pane, select the Numeric Limit Test step.
- On the Step Settings pane, click the Limits tab. The comparison type for the step is currently GELE (>= <=), with a high value of 10 and a low value of 0.
When accessed from the Numeric Limit Test step, the numeric limits for the Numeric Limit Test step are Step.Limit.High and Step.Limit.Low. However, another step cannot access the variables Step.Limit.High and Step.Limit.Low, as shown in this example. Instead, you must explicitly specify the step that specifies the properties you want to access.
- On the Steps pane, select the A Statement that changes the numeric limits step, which is a Statement step.
- On the Step Settings pane, click the Expression edit tab. The Expression tab contains two expressions, separated by a comma, that specify the high limit as 11 and the low limit as 0:
RunState.Sequence.Main["Numeric Limit Test"].Limits.High = 11, RunState.Sequence.Main["Numeric Limit Test"].Limits.Low = 0
The expressions specify that you want to use the Numeric Limit Test step to specify the properties you want to access.
Alternatively, you could use the following expression:
- Select Execute»Single Pass to run the sequence.
- When the execution completes, review the report. For the Numeric Limit Test step, the High Limit value is 11, and the Low Limit value is 0.
Because the Statement step executed before the Numeric Limit Test step in the sequence, changing the limits after the Numeric Limit Test executes does not change the limit values.