Create a Real-Time Sequence with Channel References and Local Variables
- Updated2025-10-27
- 3 minute(s) read
Create a Real-Time Sequence with Channel References and Local Variables
Create a real-time sequence that uses channel references to measure how long the engine takes to settle at a specified RPM.
- In the Stimulus Profile Editor, click the Start Page tab.
- Click New Real-Time Sequence.
- Save the sequence as Measure Set Preference tutorial in the <Common Data>\VeriStand Projects\Engine Demo\Stimulus Profiles\Engine Demo Channel References directory.
-
Create variables.
- In the Primitives palette, expand Variables, drag a Double into the Return Variable section of the Variables pane, and enter its Identifier as SettleTime
-
Create and configure the following Double parameters and local variable.
Variable Type Name Evaluation Method Units Parameter Setpoint ByValue rpm Parameter Tolerance ByValue rpm Parameter Timeout ByValue s Local variable StartTime ByValue s - In the Variables pane, right-click Channel References and click Insert Channels.
- In the Select channels dialog box, expand Aliases, enable ActualRPM and DesiredRPM, and click OK.
The Variables pane will look like the following image.
-
Add a setup expression for the set point of the engine.
- In the Primitives pane, expand Miscellaneous and drag Comment into Setup.
- In the Property Browser, enter the Comment as Set the desired set point for the engine.
- In the Variables pane, drag DesiredRPM into Setup.
- In the Property Browser, enter the Expression as DesiredRPM = Setpoint.
The Setup block of the sequence code uses the DesiredRPM channel reference to change the value of the DesiredRPM channel to the specified Setpoint. You specify the value of the Setpoint parameter when you call this sequence from the stimulus profile. By configuring the real-time sequence this way, you can call this sequence from the stimulus profile to measure the settle time of various set points. -
Add main expressions to measure how long it takes for the engine to settle at its RPM
set point.
- In the Primitives pane, drag Comment into Main.
- In the Property Browser, enter the Comment as Measure how long it takes for the engine to settle at its RPM set point.
- In the Variables pane, drag StartTime into Main.
- In the Property Browser, enter the Expression as StartTime = abstime().
- In the Sequences pane, expand and drag WaitUntilSettled into Main.
- In the Property Browser, enter the Expression as WaitUntilSettled(ActualRPM, DesiredRPM + Tolerance, DesiredRPM - Tolerance, 1.0, Timeout).
- In the Variables pane, drag SettleTime into Main.
- In the Property Browser, enter the Expression as SettleTime = abstime() - StartTime.
The Main block of the sequence stores the absolute time at which the sequence starts to the StartTime local variable. The code waits for the RPM, as read from the ActualRPM channel, to settle into a range between the DesiredRPM plus or minus the specified Tolerance for at least one second or until it reaches the specified Timeout. When the RPM either settles or times out, the code returns how long it took the engine to settle at the specified RPM. - Save the real-time sequence.
The real-time sequence code will look like the following image.

Related Information
- 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.
- VeriStand Directories and Aliases
VeriStand uses directories and aliases for project files, models, and custom devices.
- Creating a Stimulus Profile that Calls a Channel Referencing Sequence
Configure a stimulus profile to turn on the engine and measure how long it takes the engine to settle at various RPMs.