Getting Started With Hil Software
Getting Started With Hil Software
Getting Started With Hil Software
Hardware-in-the-Loop Software
Overview
VeriStand is a software tool that provides a framework for real-time testing applications such as
embedded software validation and real-time control and monitoring of mechanical test cell applications. It
contains a wide variety of features to help you get up and running more quickly. Review this article to get
started with VeriStand and learn about some of its built-in functionality.
Contents
Software Installation ..................................................................................................................................... 2
Host PC Software Installation.................................................................................................................... 2
Software Installation on the Real-Time Target .......................................................................................... 3
VeriStand Project Setup ................................................................................................................................ 3
Selecting Deployment Targets .................................................................................................................. 4
PXI Real-Time and cRIO-908x Targets ................................................................................................... 4
All Other CompactRIO Real-Time Targets ............................................................................................. 4
Running the VeriStand Engine on the Localhost Windows Computer .................................................. 4
Configuring the VeriStand Engine Using the System Explorer ................................................................. 5
Mapping System Channels........................................................................................................................ 6
Deploying VeriStand Projects .................................................................................................................... 9
Building Simulation Models for Use With VeriStand .................................................................................... 9
Additional Modeling Environments ......................................................................................................... 10
Using the EtherCAT and Scan Engine Add-On for VeriStand ..................................................................... 10
Next Steps................................................................................................................................................... 11
ni.com/hil
Software Installation
The first step is to install VeriStand software and associated driver software on your Windows computer.
Then install VeriStand Engine software on all real-time targets to which you are deploying.
LabVIEW support adds a VeriStand palette to LabVIEW for automated control of VeriStand from
LabVIEW.
The VeriStand Model Framework adds support for building simulation models in third-party
environments such as The MathWorks, Inc. Simulink® simulation software and ANSI C.
With VeriStand LabVIEW model support, you can convert a LabVIEW VI into a simulation model
that can be used in VeriStand.
Note: The VeriStand Model Framework can be installed independently and licensed free of charge. For
machines that do not need the VeriStand environment, select only the VeriStand Model Framework for
installation. After you have installed the VeriStand Model Framework, you can license it for free by using
the VeriStand Model Generation Activation Utility at http://joule.ni.com/nidu/cds/view/p/id/2466/lang/en .
After you install the necessary VeriStand software components, install NI Device Drivers from either the
Device Drivers DVD or from ni.com/drivers. Install the following drivers:
NI-DAQmx
NI-VISA
Optional: NI-RIO (for CompactRIO or FPGA functionality)
Optional: NI-XNET (for CAN, LIN, or FlexRay functionality)
Optional: NI-Industrial Communications for EtherCAT (for CompactRIO Scan Engine and
EtherCAT functionality)
After all installations are complete on the host PC, open Measurement & Automation Explorer (MAX) to
confirm the installed software by expanding the My System»Software item within the tree structure as
shown below.
ni.com/hil
Software Installation on the Real-Time Target
After you have all the necessary software on your host computer, follow the steps below to install
software on the real-time target computer.
In MAX, select your VeriStand real-time target under the Remote Systems tree item.
Select the software item for your real-time target and choose Add/Remove Software.
For CompactRIO targets only: Select the Custom Software Installation option.
Choose to install the VeriStand Engine. This installs the VeriStand Engine as well as the software
components required to run it.
Optional: To implement a distributed real-time test system that uses GE reflective memory interfaces,
select the GE reflective memory software on the target for installation.
Optional: If you are using a CompactRIO device and want to install the Scan Engine Custom device,
select the NI-Industrial Communications for EtherCAT and I/O Variable Remote Configuration Web
Service for installation as well.
Complete the software installation process and reboot your real-time target. You can see a list of
currently installed software on your target by looking under the Remote Systems»Real-Time
Target»Software item within the MAX tree structure as highlighted above.
ni.com/hil
Note: NI recommends keeping all project dependencies relative to the project file location and placing
them in the same folder or in a subfolder. This includes items such as Workspace files (.nivsscren),
System Definition files (.nivssdf), Stimulus Profile files (.nivsstimprof), Real-Time sequence files
(.nivsseq), models, and FPGA bitfiles or configuration files.
In the NI VeriStand Project Explorer window, expand the System Definition File tree item and open the
*.nivssdf file found there by right-clicking on the file and selecting Launch System Explorer.
ni.com/hil
Configuring the VeriStand Engine Using the System Explorer
While in the Controller section, the setting for Target Rate underneath the Timing Source Settings section
sets the Primary Control Loop rate on your target. The Primary Control Loop controls the timing for the
VeriStand Engine and keeps updated channel values. Find more information on the Primary Control Loop
and other individual loops running on the VeriStand Engine in NI VeriStand Engine Architecture.
Expand Controller in the tree and note the various items you can add to your system definition.
1. Hardware: Expand Hardware and then Chassis. This is where you identify your NI-DAQ, Data
Sharing (Reflective Memory), NI-FPGA, NI-XNET, or Timing and Sync devices. You can also add
multiple chassis.
2. Custom Devices: Customize and extend the out-of-box functionality of VeriStand into a device
that you can add to a system definition file and deploy to a real-time target. VeriStand includes
three custom devices that you can add here as well as any custom devices you have created
yourself. Check the NI VeriStand Add-Ons Community to view other existing custom devices and
the NI VeriStand Custom Device Developer’s Guide when considering building your own custom
device.
3. Simulation Models: Expand Simulation Models. Add your compiled models from one of the
supported modeling environments listed in the document Using Simulation Models With NI
VeriStand. If you have multiple models, you also can set the order in which models execute on
the VeriStand Engine.
4. User Channels: User channels store a single value and can function as variables to be used in
other areas of your system definition.
5. Calculated Channels: Calculated channels are created to perform calculations on other channels
in the system. You can create your own formula or perform built-in operations such as lowpass
filter, average, or peak and valley.
ni.com/hil
6. Stimulus: View and configure the stimulus generators in the Legacy Stimulus Profile Editor,
which simulate real-world signals to perform tests on a system. If you’re starting a new project
without any legacy VeriStand dependencies, ignore this section.
7. Alarms: Configure an alarm to warn the user that the value of a channel has gone outside a
specified range of values. Alarms can also trigger a procedure to execute.
8. Procedure: Configure a procedure to execute a set of actions on the VeriStand Engine. A
procedure can be signaled to begin at startup or trigger off an alarm or another procedure.
9. NI-XNET Databases: Add any NI-XNET databases to your system. Databases can be CANdb
(.dbc), NI-CAN (.ncd), LDF (.ldf), or FIBEX (.xml) files.
10. System Channels: Expand System Channels to view the channels that monitor the state or
condition of various system items. These are often used for troubleshooting system behavior.
11. System Mappings: This section displays all defined system mappings, which are connections
between source and destination channels. These are configured in the System Configuration
Mappings window, which is examined in the next section.
12. Data Sharing Network: Add and configure a reflective memory network. To learn more about
using reflective memory with VeriStand, go to Creating a Distributed System With NI VeriStand.
13. System Initialization: If you have multiple targets, you can use this section to set the order that
targets deploy relative to each other and determine target reboot action.
14. Aliases: Configure an alias to give a channel or group of channels a unique name in your system
definition. Right-click on Alias and select Add Alias. Type in the alias name and description and
then click the Browse button next to the channel to select the channel to rename. Aliases are
useful for many reasons, including sharing one workspace with multiple system definitions and
mapping workspace objects to those aliases. Because of this, you can rename system definition
channels within an alias without the workspace losing its mapping.
Mapping System Channels
You can easily connect channels to each other in VeriStand using a mapping tool. This tool helps you
quickly connect simulation models to physical I/O as well as any other channel in your system. To
configure mappings for your VeriStand system, select Tools»Edit Mappings or click on the Configure
Mappings button, shown below, to connect channels to each other such as a model output to a physical
channel or a calculated channel to an alias.
Select a channel in the tree under Sources in the System Configuration Mappings window that just
opened.
ni.com/hil
Select a channel under Destinations and then click Connect to map the channels. Note that the Source
and Destination channels now appear under Mappings.
ni.com/hil
System channel mappings can be exported and saved to file. You can then import this file to automate
the system mapping process at a later time.
ni.com/hil
Deploying VeriStand Projects
After you have configured your system definition, save and close the System Explorer. There are two
options for running VeriStand projects.
Run: Launches the Workspace window. If you have configured the system to run on a PC, clicking
the button begins running the project. If you have configured the system to run on an real-time
target, clicking the Run button deploys the system definition file if one is not already running. If a system
definition file already is running on the real-time target, clicking the Run button connects to the target and
launches the Workspace window without redeploying the system definition file.
Deploy: Clicking the button deploys the system definition to the target that you specified in the
System Explorer. However, it does not open the Workspace window. If a system definition file already is
running on the real-time target, deploying a new system definition will replace the system definition that
is currently running.
If you are using an NI real-time target and you don't know which OS is running on the target, view What
Operating System Is My Real-Time Controller Running and Why?
For model deployment on Windows and PharLap-based systems, view Setting Up The MathWorks,
Inc. MATLAB® Environment to Work in NI VeriStand.
ni.com/hil
For deployment on VxWorks-based CompactRIO systems, go to Developing Shared Libraries for the
cRIO-901x and Other VxWorks Targets for Windows XP development computers and Generating
Models From The MathWorks, Inc. Simulink Simulation Software for Deployment on VxWorks Systems for
Windows Vista and later.
Additional Modeling Environments
For more information on interacting with models from other modeling environments and programming
languages in VeriStand, go to Using Simulation Models With NI VeriStand. This document has a complete list
of supported modeling environments that have been tested and verified as being able to create compiled
models that can be imported in VeriStand.
Note: The EtherCAT and Scan Engine add-on for VeriStand is compatible with CompactRIO targets and
the NI 9144 EtherCAT expansion chassis.
Download NI VeriStand Add-On: Scan Engine and EtherCAT custom device from the VeriStand developer
community and follow the installation instructions.
To add the Scan Engine and EtherCAT Custom Device to your VeriStand system, follow these steps:
ni.com/hil
Next Steps
VeriStand has many features you can use out of the box without programming. To see video
demonstrations of some of these features, visit ni.com/veristand/demos.
For an in-depth walkthrough of the VeriStand environment, download the VeriStand tutorial.
To learn more about creating add-ons for VeriStand, watch the VeriStand add-ons webcast.
For instructor-led training on VeriStand features, take the NI VeriStand Fundamentals training
course.
ni.com/hil