Tutorial: Getting Started with Stimulus Profiles in NI VeriStand

Publish Date: Dec 22, 2015 | 6 Ratings | 4.17 out of 5 | Print | Submit your review

Overview

VeriStand includes a stimulus profile editor that enables you to author and run sophisticated real-time tests. This tutorial shows you how to use the Stimulus Profile Editor to create and run tests, and it introduces new features in VeriStand.

Table of Contents

  1. What's New in the NI VeriStand 2015
  2. Example 1: Setting up a Basic Test Using the Stimulus Profile Editor
  3. Example 2: Executing Multiple Parallel Tasks
  4. Example 3: Configuring Failure Notification
  5. Example 4: Logging Data to a File
  6. Example 5: Calling a CSV File as a Real-Time Sequence
  7. Example 6: Playing Back Previously Recorded Test Data

1. What's New in the NI VeriStand 2015

VeriStand 2015 software is easier to use and more flexible than ever. With support for the NI Linux Real-Time OS on CompactRIO devices, you can always choose the right I/O for your application. VeriStand 2015 makes real-time testing even easier with expanded simulation integration, better support for distributed systems, and an improved DAQ configuration experience. To reduce overall costs and offer more convenient installation, VeriStand is offered as part of the LabVIEW HIL and Real-Time Test Suite. Some of the new features are listed below:

Run Veristand on NI Linux Real-Time: Configure and run real-time tests on CompactRIO devices that use the NI Linux Real-Time OS. Combine a small, rugged form factor and conditioned I/O for powerful real-time performance from the latest mobile processors and FPGAs.


Faster Configuration and More Options for Data Acquisition: VeriStand can now help you quickly identify which types of I/O are available during configuration. It detects board settings and disables I/O types that aren’t compatible with your module. VeriStand also responds to system changes more intuitively by auto-repairing connections that were changed during configuration. Also you can select and configure new measurement types such as force, pressure, and torque as DAQ options without requiring unit conversions.


Expanded and Improved Hardware Integration: VeriStand has native support for the PXIe-4339 module, which gives you the ability to combine high-precision bridge-based measurements for data acquisition and direct voltage measurements for closed-loop control applications.


In-Situ Calibration for Strain Measurements: When used with the PXIe-4339, VeriStand can perform in-situ calibration prior to the execution of a test run. This ensures maximum accuracy of your measurements and increases the reliability of your results.

 

Back to Top

2. Example 1: Setting up a Basic Test Using the Stimulus Profile Editor

You can use the Stimulus Profile Editor to create, modify, and execute stimulus profiles and real-time sequences. A stimulus profile is a test executive that can call real-time sequences, open and close NI VeriStand projects, and perform data-logging and pass/fail analysis. It also connects real-time sequences to system definition files to bind channel data within the system definition file to variables in the real-time sequence.

A real-time sequence is a program that deploys to a target with a system definition file and read/write channels defined in the system definition file. Real-time sequences can feature a wide array of programming constructs, including while loops, for loops, variables, and conditional statements. Because a real-time sequence cannot execute on its own, you must connect it to a stimulus profile in order for it to execute. A stimulus profile executes on the host computer, while a real-time sequence executes on the target.

In this tutorial, you use the Stimulus Profile Editor to create a real-time sequence that turns on a car engine, sets the engine speed to 2500 RPM, holds this speed for 20 seconds, and then turns off the engine. You also create a stimulus profile that opens the Workspace window and then executes this real-time sequence.

To complete this task, you perform the following steps:

  1. Deploy a project representing the car engine.
  2. Launch the Stimulus Profile Editor.
  3. Create and configure a real-time sequence.
    1. Create a new real-time sequence and add blocks.
    2. Create variables.
    3. Add variables and set their values.
    4. Call an additional real-time sequence.
    5. Set the return value.
  4. Create a new stimulus profile that opens the Workspace window and calls the real-time sequence.
  5. Run the stimulus profile and observe the execution.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\1. Engine Demo Basics directory.

Deploying a Project and Launching the Stimulus Profile Editor

Complete the following steps to open the Engine Demo example project and launch the Stimulus Profile Editor:

  1. Launch NI VeriStand.
  2. From the Getting Started window, click Browse  and navigate to <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
    NI VeriStand displays Engine Demo.nivsproj and Engine Demo.nivssdf in the Active Project field.
  3. Click Configure Project to display the Project Explorer window.
  4. Select Operate»Deploy to deploy the system definition file to the target, which in this case is also the host computer.
    Note: While you can create and modify stimulus profiles and real-time sequences in the Stimulus Profile Editor without deploying a system definition file to the target, you cannot execute a stimulus profile unless you first deploy a system definition file.
  5. Selecting Deploy launches the Running Project dialog box, which displays the progress of the VeriStand Gateway as it deploys the project. Enable the Close on successful deployment checkbox to close the Running Project dialog box after the project deploys.
  6. Select the Profiles node in the tree in the Project Explorer window and click Launch Stimulus Profile Editor  to display the Stimulus Profile Editor.

Creating a Real-Time Sequence and Adding Blocks to Organize Your Code

You configure a real-time sequence by adding statements to the Sequence Code pane in the Real-Time Sequence File tab. The Sequence Code pane divides the statements in a real-time sequence into the following execution sections:

  • Setup- Contains the initialization code for the real-time sequence.
  • Main- Contains the main execution code.
  • Clean Up- Contains the finalization code. Tasks under the Clean Up node execute after all tasks under the Main node complete, or when you abruptly stop the stimulus profile that is executing the real-time sequence.

Within the Setup, Main, and Clean Up sections, you can organize and reuse your code using blocks, which make it easy to move or duplicate a group of related statements.

Complete the following steps to create a new real-time sequence and add blocks:

  1. Click New Real-Time Sequence on the Start Page to create a new real-time sequence file and open the Real-Time Sequence File tab.
    This tab contains the Sequence Code pane, which is where you build the code for the sequence.
  2. In the Primitives pane on the left side of the screen, expand the Miscellaneous node. Drag Block onto the Setup section of the real-time sequence.
  3. In the Property Browser, enter Turn on engine in Name to name the block.
  4. Add a Block to the Main section. Name it Set engine speed to 2500 and wait.
  5. Add a Block to the Clean Up section. Name it Turn off engine.

You add statements to these blocks later in the tutorial.

Creating Variables

The Variables pane displays all the variables that the real-time sequence has access to at run time and that it can reference in expressions.

Complete the following steps to create variables that control engine power and RPM:

  1. In the Primitives pane, expand the Variables node. Drag Boolean onto the Parameters section of the Variables pane.
    When you add this parameter, the Property Browser pane displays several properties you can use to configure the parameter.
  2. Click Browse  next to Default Assignment to display the system definition channel tree.
  3. Click Aliases  to display the aliases defined in the system definition file.
  4. Double-click EnginePower to assign this alias to the parameter.
  5. Enter EnginePower in Identifier.
  6. Enter On/Off in Units.
    The Property Browser now appears similar to the following figure.
  7. Select Double from the Primitives pane and drag it to Parameters to add a double-precision numeric parameter after EnginePower.
  8. Using the Property Browser, name the new parameter DesiredRPM. Map the parameter to the corresponding alias and set rpm as the units.
  9. Save the sequence as Engine Demo Basics tutorial.nivsseq in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\1. Engine Demo Basics directory.

Adding Variables to the Sequence Code and Setting Their Values

Adding variables to the real-time sequence code enables the sequence to access the corresponding system definition channels and read or write the channel values.

Complete the following steps to add variables that turn on the engine, set the desired RPM, and then turn off the engine when the task is complete:

  1. From the Variables pane, drag EnginePower onto the Turn on engine block.
  2. In the Property Browser, modify the Expression statement so that EnginePower = true. When the real-time sequence executes, this variable turns on the engine.
  3. Drag DesiredRPM onto the Set engine speed to 2500 and wait block under Main.
  4. Set DesiredRPM to 2500 to increase the RPM to 2500 when the block executes.
  5. From the Set engine speed to 2500 and wait block under Main, select DesiredRPM and press <Ctrl> while dragging DesiredRPM onto the Turn off engine block under Clean Up.
    Selecting an item and pressing <Ctrl> while dragging creates a copy of the selected item.
  6. Set DesiredRPM to 0 to decrease the RPM to 0 when the block executes.
  7. Drag EnginePower onto Turn off engine. Leave the value as false to turn off the engine when the block executes.

Calling a Real-Time Sequence from another Sequence

You can call another real-time sequence as a subroutine of the current sequence by adding the secondary sequence to the code of the calling sequence. By adding sequences as subroutines, you can reuse sequences that perform specific tasks. The Sequences pane, shown in the following figure, contains several default real-time sequence files installed with NI VeriStand, as well as sequences you create.

You can use the Wait sequence that NI VeriStand installs to set the amount of time that an expression that precedes the Wait sequence executes.

Complete the following steps to configure the Engine Demo Basics sequence to hold the engine’s RPM at 2500 for 20 seconds:

  1. In the Sequences pane, expand Real-Time Sequence Library»Standard»Timing. Drag Wait onto the Set engine speed to 2500 and wait block.
    Notice the sequence appears as Wait(Duration). When you add a sequence to the Sequence Code pane, parameters of that sequence appear in parentheses as a comma-separated list.
  2. In the Property Browser, modify the Expression to replace Duration with 20 to hold the DesiredRPM value at 2500 for 20 seconds when this step executes.

The code now appears similar to the following figure.

Setting a Return Value for a Real-Time Sequence

You can configure a real-time sequence to return a value after it executes by setting the return value in the Variables pane. The return value always appears first in the Variables tree. If the sequence does not need to return a specific value, you can set the return value to return a Void Return Value.

The sequence does not require a specific return value, so complete the following steps to configure the sequence to return void:

  1. Expand the Variables node in the Primitives pane. Drag Void Return Value onto the return value ( ) node in the Variables pane. By default, the return value node is named Pass.
  2. Enter Output in the Identifier text box to change the name of the return value node.
    The return value node should appear similar to the following figure:
  3. Save the sequence.

Creating a Stimulus Profile and Calling a Real-Time Sequence

Because a real-time sequence cannot run on its own, you must connect it to a stimulus profile in order for it to execute. A stimulus profile executes on the host computer and acts as a test executive that manages real-time sequences, which execute on the target.

Complete the following steps to create a stimulus profile that opens the Workspace window and calls the real-time sequence you created:

  1. On the Start Page, click New Stimulus Profile to create a new stimulus profile and open the Stimulus Profile File tab.
  2. In the Steps pane, expand the VeriStand Project Control node. Drag Open VeriStand Workspace onto the Setup section of the stimulus profile.
    When the stimulus profile runs, this step opens the Workspace window so you can observe the effects of the stimulus profile execution.
  3. In the Steps pane, expand the Real-Time Sequences node. Drag Real-Time Sequence Call onto the Main section of the stimulus profile.
    The Real-Time Sequence Call calls the real-time sequence you specify in the Property Browser.
  4. Select the Real-Time Sequence Call step in the Stimulus Profile pane to specify the real-time sequence to call.
    The Property Browser displays several properties you can use to configure the step. Each step in a stimulus profile contains properties. These properties are editable attributes that determine how the step executes.
  5. In the Property Browser, click Browse  next to File Path and navigate to the real-time sequence you created in the previous sections.
  6. Select Controller from Target Name to execute the real-time sequence on the Controller target.
    For projects containing multiple targets, Target Name lists all of the available targets.
  7. Save the stimulus profile as Engine Demo Basics tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\1. Engine Demo Basics directory.

The code now appears similar to the following figure.

Running a Stimulus Profile

When you run a stimulus profile, the Stimulus Profile Editor first compiles all the open and referenced real-time sequence files. The Warnings and Errors pane lists any errors, warnings, or messages that you must resolve before the stimulus profile can successfully execute. Each time you run a stimulus profile, NI VeriStand produces a test results file that adheres to the Automatic Test Markup Language (ATML) standard. Refer to the NI VeriStand Help for more information about the ATML standard.

Complete the following steps to run a stimulus profile and view the results:

  1. Click the arrow  next to Execution Results, located directly under the Stimulus Profile pane, to maximize the Execution Results pane.
    After each step executes, the Execution Results pane displays the name of the step and the result of the step execution.
  2. Click Run  on the Home tab.
    Run compiles all the open and referenced real-time sequence files and runs the stimulus profile.
  3. Notice that Open VeriStand Workspace is highlighted. The Stimulus Profile pane highlights the currently executing step.
  4. When the Open VeriStand Workspace step executes, bring the Workspace window to the front. Observe the graph output change as the real-time sequence executes.
    Note: Do not click any of the Workspace controls, as this modifies the behavior of the execution.
  5. When the stimulus profile completes its execution, the ATML Test Report opens automatically.
    This results file displays details about the stimulus profile execution. If you run the stimulus profile again, the previous results are overwritten.

Back to Top

3. Example 2: Executing Multiple Parallel Tasks

In this tutorial, you use the Stimulus Profile Editor to create a stimulus profile and a real-time sequence that incorporates multitasking, which executes multiple parallel tasks.

The real-time sequence you create in this tutorial turns on a car engine, sets the engine speed to 2500 RPM, holds this speed for 25 seconds, and then raises the engine speed to 8000 RPM and holds this speed for another 25 seconds. In addition to controlling the engine speed, the sequence multitasks to monitor engine temperature. If the engine temperature exceeds 110 degrees, the engine shuts down and the sequence aborts.

You also create a stimulus profile that opens the Workspace window and then executes this real-time sequence.

To complete this task, you perform the following steps:

  1. Create and configure a real-time sequence.
    1. Create a new real-time sequence and add blocks, and create parameters and local variables.
    2. Add variables and set their values.
    3. Enable multitasking.
  2. Create and run a stimulus profile.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\2. Engine Demo Advanced directory.

Creating a Real-Time Sequence

Complete the following steps to create a new real-time sequence, add blocks, specify parameters as variable references, and add a local variable:

  1. Open and deploy <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
  2. Launch the Stimulus Profile Editor and create a new real-time sequence.
    Note: If you have not closed the real-time sequences or stimulus profiles from a previous tutorial, be sure to close these files.
  3. Add a Block to the Setup section of the real-time sequence. Name it Turn on engine.
  4.  Add a Block to the Clean Up section. Name it Turn off engine.
  5. From the Primitives pane, drag Boolean onto the Parameters section of the Variables pane.
  6. Rename this new parameter EnginePower, assign to it the alias EnginePower and set the units to On/Off.
  7. Add a Double primitive to the Variables pane, under EnginePower.
  8. Rename this new parameter DesiredRPM, assign to it the alias DesiredRPM and set the units to rpm.
  9. Add another Double primitive under DesiredRPM. Rename it ActualRPM and assign to it the alias ActualRPM.
  10. Add another Double primitive. Rename it EngineTemperature and assign to it the alias EngineTemp.
  11. Drag a Boolean primitive to the Local Variables section of the Variables pane.
    Local variables are variables you use within the real-time sequence as a way to hold values you get or set in statements.
  12. Rename this new local variable WarmUpComplete.
  13. Set the return value to .
  14. Save the sequence as Engine Demo Advanced tutorial.nivsseq in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\2. Engine Demo Advanced directory.

The Variables pane now appears similar to the following figure.

Adding Variables to the Real-Time Sequence

Complete the following steps to add variables to the real-time sequence and set their values:

  1. Drag EnginePower from the Variables pane onto the Turn on engine block under Setup in the Sequence Code pane.
  2. In the Property Browser, modify the Expression statement so that EnginePower = true. When the real-time sequence executes, this variable turns on the engine.
  3. Drag WarmUpComplete onto Setup so that this variable is at the same level in the tree as the Turn on engine block. Adding WarmUpComplete to Setup initializes the variable to a known value so that the real-time sequence can then write values to the variable during execution.
    The Setup code now appears similar to the following figure.
  4. Drag EnginePower onto the Turn off engine block under Clean Up. Leave the value as false to turn off the engine when the block executes.
  5. Drag DesiredRPM onto the Turn off engine block under Clean Up. Leave the value as 0 to decrease the RPM to 0 when the block executes.
    The Clean Up code now appears similar to the following figure.

Enabling Multitasking

Complete the following steps to configure the real-time sequence to execute multiple parallel tasks:

  1. In the Primitives pane, expand Structures»Multitasking. Drag MultiTask onto the Main section of the Sequence Code pane.
  2. In the Property Browser, change Task1 to EngineWarmUp. Change Task2 to MonitorEngineTemperature.
  3. Modify the EngineWarmUp task with the following code.
    Note: You can find WaitUntilSettled in the Sequences pane by expanding Real-Time Sequence Library»Standard»Timing.

    The EngineWarmUp task sets the engine speed (DesiredRPM) to 2500 RPM, and then waits until the RPM (ActualRPM) settles into a range between 2450 and 9999999 RPM for 25 seconds before raising the engine speed to 8000 RPM and then waiting until the RPM settles into a range between 7800 and 9999999 RPM for another 25 seconds. When the task successfully completes, it sets the WarmUpComplete variable to true, which will be relevant to the MonitorEngineTemperature task.
  4. Modify the MonitorEngineTemperature task with the following code.
    Note: You can find DoWhile Loop in the Primitives pane by expanding Structures»Loops. You can find If Else in the Primitives pane by expanding Structures»Conditional.
    Task2.gif
    For as long as the WarmUpComplete variable is false, the MonitorEngineTemperature task monitors the engine temperature (EngineTemperature) to ensure it does not exceed 110 degrees. If the engine temperature exceeds 110 degrees, the engine shuts down and the sequence aborts. If the engine temperature remains below 110 degrees, the sequence completes its execution and turns off the engine.
  5. Save the sequence.

The code now appears similar to the following figure.

Creating and Running a Stimulus Profile

Complete the following steps to create and run a stimulus profile that opens the Workspace window and calls the real-time sequence you created:

  1. Create a new stimulus profile with the following code that opens the Workspace window and calls the real-time sequence you just created.
  2. Save the stimulus profile as Engine Demo Advanced tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\2. Engine Demo Advanced directory.
  3. Run the stimulus profile and observe the graph output in the Workspace window.

Back to Top

4. Example 3: Configuring Failure Notification

In this tutorial, you modify the Engine Demo Advanced tutorial.nivsseq real-time sequence created in the previous example tutorial by adding a return value that reflects the success or failure of the warm-up task. If the engine temperature does not exceed 110 degrees, the warm-up task completes and the sequence returns true, which indicates that the warm-up task succeeded. If the engine temperature exceeds 110 degrees, the engine shuts down and the return value is false, which indicates that the warm-up task failed.

You will create a stimulus profile that opens the Workspace window, executes the real-time sequence you create, and displays a message box based on whether you configure the stimulus profile to stop execution when a step fails.

To complete this task, you perform the following steps:

  1. Configure a real-time sequence to return a pass/fail value.
  2. Configure stimulus profile execution behavior after step failure.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\3. Engine Demo Advanced & Return Value directory.

Configuring a Real-Time Sequence to Return a Pass/Fail Value

Complete the following steps to set a return value and add it to the sequence:

  1. Open and deploy <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
  2. Launch the Stimulus Profile Editor and open Engine Demo Advanced tutorial.nivsseq.
  3. Save a copy of the sequence as Engine Demo Advanced & Return Value tutorial.nivsseq in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\3. Engine Demo Advanced & Return Value directory.
    Note: If you have not closed the real-time sequences or stimulus profiles from a previous tutorial, be sure to close these files.
  4. From the Primitives pane, drag Boolean onto the return value in the Variables pane to change the data type of the return value from Void to Boolean.
  5. Name the return value WarmUpSucceeded.
  6. From the Variables pane, drag WarmUpSucceeded onto the Then section of MonitorEngineTemperature in the Sequence Code pane. Leave the value as false.
    If the Then section of the code executes, the return value will be false, which indicates that the warm-up task failed because the engine temperature exceeded 110 degrees.
  7. Drag WarmUpSucceeded onto the Else section of MonitorEngineTemperature and modify the Expression statement so that WarmUpSucceeded = true.
    If the Else section of the code executes, the return value will be true, which indicates that the warm-up task succeeded because the engine temperature remained below 110 degrees.
  8. Save the sequence.

The code in the MonitorEngineTemperature section now appears similar to the following figure.

Configuring Stimulus Profile Execution Behavior after Step Failure

Complete the following steps to create a stimulus profile that displays a message depending on whether or not you configure the stimulus profile to stop execution when a step fails:

  1. Create a new stimulus profile with the following code that opens the Workspace window and calls the real-time sequence you just created.
  2. In the Steps pane, expand the Other node. Drag Message Box onto Main.
    When a Message Box step executes, it displays a pop-up dialog box with a message you specify.
  3. In the Property Browser, enter the following text in Message:
    Because the Stop Execution on Fail checkbox is disabled, the Message Box step executes despite the failure of the previous step.
    Because the Message Box step executes after the Call Real-Time Sequence step, you only see this message if the Call Real-Time Sequence step executes without failure, or if the Stop Execution on Fail checkbox is disabled. You configure this checkbox later in this procedure.
  4. Enter the following text in Dialog Title:
    Checked/Unchecked - Stop Execution on Fail
  5. Enter OK in Default Text.
    The code now appears similar to the following figure.
  6. In the Stimulus Profile pane, select the primary node in the tree. This node displays the name of the file.
    When you select the primary node in the tree, the Property Browser displays items you can use to configure settings for the entire stimulus profile.
  7. Ensure that the Stop Execution on Fail checkbox contains a checkmark to specify to stop the stimulus profile execution if a step fails.
  8. Save the stimulus profile as Engine Demo Advanced & Return Value tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\3. Engine Demo Advanced & Return Value directory.
  9. Run the stimulus profile.
  10. Arrange the Stimulus Profile Editor and the Workspace window so that they are side-by-side.
  11. Observe the execution in the Workspace window. When EngineTemp exceeds 110 degrees, the stimulus profile execution stops and the Execution Results pane in the Stimulus Profile Editor reports that the Call Real-Time Sequence step has failed. Because you configured the stimulus profile to Stop Execution on Fail, the Message Box step did not execute.
  12. Configure the stimulus profile so that Stop Execution on Fail is disabled.
  13. Save and run the stimulus profile.
  14. Observe the execution. When the Execution Results pane reports that the Call Real-Time Sequence step has failed, the stimulus profile continues executing.
    When the Message Box step executes, a dialog box with the message you specified appears.
  15. Click OK to close the dialog box and complete the stimulus profile execution.

Back to Top

5. Example 4: Logging Data to a File

In this tutorial, you will use the Engine Demo Basics real-time sequence you created previously. You will create a stimulus profile that executes this real-time sequence and logs the RPM and Engine Temperature channels data to a TDMS file you specify.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\4. Engine Demo Logging directory.

Logging Channel Data

You can use the Stimulus Profile Editor to log channel data to a TDMS file. You can view TDMS files and analyze channel data using the TDMS File Viewer workspace tool or in other National Instruments software, such as NI DIAdem.

Complete the following steps to create and run a stimulus profile that logs channel data to a TDMS file:

  1. Open and deploy <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
  2. Launch the Stimulus Profile Editor and create a new stimulus profile.
    Note: If you have not closed the real-time sequences or stimulus profiles from a previous tutorial, be sure to close these files.
  3. Drag an Open VeriStand Workspace step onto the Setup section.
  4. In the Steps pane, expand the Logging node and drag Start Logging onto the Main section. A Channel Group automatically appears under the Start Logging step.
    This step logs execution data for the channels you specify in each Channel Group that appears under this step.
  5. From the Steps pane, drag another Channel Group onto the Start Logging step so it contains two groups.
  6. In the Property Browser, configure the Start Logging step with the following settings:
    - Name the data log configuration Logging Configuration Demo.
    - Specify <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\4. Engine Demo Logging\Test Results\UUT 1\Log File.tdms as the path to the data log file.
    - Overwrite an existing log file.
    - Log data at a rate of 100 Hz.
    - Specify no trigger condition.
  7. Configure the first Channel Group with the following settings:
    - Name the channel group RPM.
    - Log data from the ActualRPM and DesiredRPM channels.
  8. Configure the second Channel Group with the following settings:
    - Name the channel group Temperature.
    - Log data from the EngineTemp channel.
  9. Drag a Real-Time Sequence Call step onto the Main section. Configure the step to call Engine Demo Basics tutorial.nivsseq on the Controller target.
  10. Drag a Stop Logging step onto the Clean Up section.
    This step finalizes the channel logging.
  11. In the Property Browser, enter Logging Configuration Demo in Configuration Name.
  12. Save the stimulus profile as Engine Demo Logging tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\4. Engine Demo Logging directory.
    The code now appears similar to the following figure.
  13. Run the stimulus profile. NI VeriStand logs data from the channels in the RPM and Temperature groups to the Log File.tdms file.
    When the stimulus profile completes its execution, you can view the TDMS file using the TDMS File Viewer workspace tool.
  14. In the Workspace window, select Tools»TDMS File Viewer to open the TDMS File Viewer.
  15. In the TDMS File Viewer, open <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\4. Engine Demo Logging\Test Results\UUT 1\Log File.tdms.
  16. Examine the channel data by selecting nodes in the File Contents tree and viewing the data in the Properties, Values, and Analog values tabs.

Back to Top

6. Example 5: Calling a CSV File as a Real-Time Sequence

In this tutorial, you use the Stimulus Profile Editor to create a stimulus profile that calls two Comma Separated Values (.csv) files in the same way you call real-time sequences.

You can use CSV files within stimulus profiles to stimulate, fault, and evaluate channels. To run in a stimulus profile, a CSV file must define inputs, values to assign to those inputs, and timestamps at which to update the input values. The CSV file must include this data under specific column headers that NI VeriStand expects. Refer to the NI VeriStand Help for information on how to format a CSV file.

The stimulus profile you create in this tutorial executes a CSV file that turns on an engine and increases the RPM to 2500 within 10 seconds. After this CSV file completes its execution, the stimulus profile calls a sequence from the built-in library of sequences that causes the system to wait until the RPM parameters settle. Finally, the stimulus profile executes another CSV file that sets the engine RPM to various values over the course of 70 seconds.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\5. Engine Demo CSV File Replay directory.

Complete the following steps to create and run a stimulus profile that calls CSV files as real-time sequences:

  1. Open and deploy <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
  2. Launch the Stimulus Profile Editor and create a new stimulus profile.
    Note: If you have not closed the real-time sequences or stimulus profiles from a previous tutorial, be sure to close these files.
  3. In the Steps pane, expand VeriStand Project Control. Drag an Open VeriStand Workspace step onto the Setup section.
  4. Drag a Real-Time Sequence Call step onto Main.
  5. In the Property Browser, click Browse FilePathBrowse.gifnext to File Path and navigate to <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\5. Engine Demo CSV File Replay\WarmUp Phase 1.csv.
  6. Set Target Name to Controller to execute the CSV file on the Controller target.
  7. In the Sequences pane, expand Real-Time Sequence Library»Standard»Timing. Drag WaitUntilSettled onto Main and configure the sequence to execute on the Controller target. Then, configure the WaitUntilSettled sequence with the following settings:
  8. Drag a Real-Time Sequence Call step onto Main and configure the step to call WarmUp Phase 2.csv, located in the same directory as WarmUp Phase 1.csv.
  9. Configure WarmUp Phase 2.csv to execute on the Controller target.
  10. Save the stimulus profile as Engine Demo CSV File Replay tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\5. Engine Demo CSV File Replay directory.
    The code now appears similar to the following figure.
  11. Run the stimulus profile.
  12. In the Workspace window, watch the graph output change as the stimulus profile executes.
  13. To see a video demonstrating how to perform CSV file playback, go to Performing CSV File Playback Using the NI VeriStand Stimulus Profile Editor.

Back to Top

7. Example 6: Playing Back Previously Recorded Test Data

In this tutorial, you use the Stimulus Profile Editor to create and run a stimulus profile that plays back data from a previously recorded NI VeriStand macro file. A macro file is a recording of the commands sent to the target. The macro file contains data from an engine test that starts at 1500 RPM and increases to 5000 RPM, and then increases again to 15000 RPM. When the engine reaches 15000 RPM, it decreases by increments of 1000 RPM until it reaches 1000 RPM. When the engine reaches 1000 RPM, the test turns off the engine.

As a reference, you can find the complete examples you design in this tutorial in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\6. Engine Demo Macro Player directory.

Complete the following steps to create and run a stimulus profile that plays back data from a previously recorded macro file:

  1. Open and deploy <Common Data>\Examples\Stimulus Profile\Engine Demo\Engine Demo.nivsproj.
  2. Launch the Stimulus Profile Editor and create a new stimulus profile.
    Note: If you have not closed the real-time sequences or stimulus profiles from a previous tutorial, be sure to close these files.
  3. Drag an Open VeriStand Workspace step onto the Setup section.
  4. Expand Other. Drag a Macro Player step to Main.
    A Macro Player step replays the macro file you specify.
  5. In the Property Browser, click Browse FilePathBrowse.gif next to VeriStand Macro File and navigate to <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\6. Engine Demo Macro Player\Engine Demo Macro.nivsmacro.
  6. Set Playback Mode to UseTiming to play back the macro file using the timing information embedded in the file.
  7. Save the stimulus profile as Engine Demo Macro Player tutorial.nivsstimprof in the <Common Data>\Examples\Stimulus Profile\Engine Demo\Stimulus Profiles\6. Engine Demo Macro Player directory.
    The code now appears similar to the following figure.
  8. Run the stimulus profile.
  9. In the Workspace window, watch the graph output change as the macro file plays.
  10. To see a video demonstrating how to perform macro record and playback, go to Recording and Playing Macros Using the NI VeriStand Stimulus Profile Editor.

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit