Table Of Contents

Declaring Variables in a Real-Time Sequence

Last Modified: June 10, 2021

Declare and define the variables a real-time sequence can access and act on.

Before you begin, create a real-time sequence. Real-time sequences can contain four different sections of variables that appear in the Variables pane.
Section Description
Return Variable The value the real-time sequence returns after it executes.
Parameters The inputs and outputs that the sequence accepts when called and can pass out to other sequences or the stimulus profile.
Local Variables Variables you want to access from statements within the current sequence.
Channel References References that allow you to read/write system definition channels directly from a real-time sequence.
spd-note-note
Note  

Channel references bind to specific system definition channels when added to a real-time sequence. The sequence that contains them is bound to that system definition file. If you want to write a sequence that you can reuse across multiple system definition files, use Parameters.

  1. Open a real-time sequence.
  2. Declare a Return Variable.
    1. Determine the data type you want the sequence to return:
      • Boolean—Returns a true/false value that indicates if the sequence passes.
      • Void Return Value—If you do not need to perform a pass/fail evaluation on the sequence.
    2. In the Primitives palette, drag a data type from the Variables folder to the Return Variable section of the Variables pane.
    3. In the Variables pane, select the variable and use the Property Browser to configure its name and, for a Boolean, default value.
  3. Declare a Parameter.
    1. To conserve memory, select the smallest possible data type that can hold the value you want to pass into or out of the sequence.
      spd-note-note
      Note  

      Use Double or Boolean primitives to create parameters to map to system definition channels. All channels in VeriStand are 64-bit floating point numbers (doubles), but many can also accept Boolean values.

    2. In the Primitives palette, drag a data type from the Variables folder to the Parameters section of the Variables pane.
    3. In the Variables pane, select a variable and use the Property Browser to configure its Default Assignment, or the channel it maps to.
  4. Declare a Local Variable.
    1. To conserve memory, select the smallest possible data type that can hold the value you want to pass into or out of the sequence.
    2. In the Primitives palette, drag a data type from the Variables folder to the Local Variables section of the Variables pane.
    3. In the Variables pane, select a variable and use the Property Browser to configure its Default Value.
  5. Declare a Channel Reference.
    1. In the Variables pane, right-click the Channel References section and click Insert Channels.
    2. Use the configuration tree to select the channels you want to add as Channel References and click OK.
After you declare variables, you can include them in expressions that you add to the sequence code. When you begin entering an Expression in the Property Browser, VeriStand automatically includes the names of defined variables to the list of values that appears.

Recently Viewed Topics