Create a Real-Time Sequence with a Channel Reference

Create a real-time sequence that uses a channel reference to read/write a engine power channel and a parameter to specify the value to read/write.

Before you begin, deploy the engine demo's system definition.
  1. In the VeriStand Editor, click Tool Launcher » Stimulus Profile Editor.
  2. In the Stimulus Profile Editor, click New Real-Time Sequence.
  3. Save the sequence as Set Engine Power tutorial in the <Common Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Engine Demo Channel References directory.
  4. Create variables.
    1. In the Primitives palette, expand Variables and drag a Boolean into the Parameters section of the Variables pane.
    2. In the Property Browser, enter the Identifier, as OnOff.
    3. Click the Evaluation Method pull-down, select ByReference.
      This parameter specifies whether to turn the engine on or off. You set the value when you call this sequence from the stimulus profile.
    4. In the Variables pane, right-click Channel References and click Insert Channels.
    5. In the Select channels dialog box, expand Aliases, enable EnginePower, and click OK.
      This channel reference writes the value of the OnOff parameter to the EnginePower channel.
    6. In the Primitives palette under Variables, drag Void Return Value into the Return Variable section of the Variables pane.
      This variable returns no value. Instead, you call this sequence from a stimulus profile to turn the engine on and off.
      Note By default, the return value node is named Pass.
    The Variables pane will look like the following image.

  5. Configure the real-time sequence to turn the engine on or off based on the value of the OnOff parameter.
    1. In the Variables pane, drag EnginePower into Main.
    2. In the Property Browser, enter the Expression as EnginePower = OnOff.
      This allows you to toggle the engine on or off by calling this sequence from a stimulus profile.
  6. Save the real-time sequence.

The real-time sequence code will look like the following image.



After creating this real-time sequence, create another real-time sequence.