Statement Step Type

TestStand 2017 Help

Edition Date: November 2017

Part Number: 370052W-01

»View Product Info

Download Help (Windows Only)
NI TestStand 2014 Help
NI TestStand 2014 SP1 Help
TestStand 2016 Help
TestStand 2016 SP1 Help
TestStand 2017 Help

Purpose

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 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


Open Example

<TestStand Public>\Examples\Built-In Step Types\Statement Step Type\Statement Step Type.seq

Highlighted Features

Expressions

Major API

None

Prerequisites

None

How to Use This Example

Complete the following steps to use this example.

  1. On the Steps pane, select the Numeric Limit Test step.
  2. 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.
  3. On the Steps pane, select the A Statement that changes the numeric limits step, which is a Statement step.
  4. 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:

    'RunState.NextStep.Limits.High'
  5. Select Execute»Single Pass to run the sequence.
  6. 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.

WAS THIS ARTICLE HELPFUL?

Not Helpful