Software Installation
- Check VeriStand Modeling Version Compatibility.
- Install a version of MATLAB/Simulink that is compatible with VeriStand.
- Must include MATLAB Coder and Simulink Coder addons.
- Install the VeriStand Model Framework.
- Included with the VeriStand installer in NI Package Manager, but you can choose to just install the framework without the VeriStand IDE.
Note: Installing compatible versions and in the correct order is very important. The majority of Simulink/VeriStand issues are due to this.
Setting up and building a VeriStand compatible Simulink model
- Open your MATLAB software and verify if the Model Framework is recognized in MATLAB. When you open MATLAB, you should see this message:
- If you do not have it, check to make sure the Simulink version is compatible with VeriStand. If you have multiple versions of MATLAB/Simulink installed, you may need to add the following lines to the matlabrc.m file:
addpath('X:\VeriStand’);
NIVeriStandAddPaths;
- Open Simulink and create a model from scratch or open an example mode. You can create a simple add model by following the picture below.
- Setup the model options as stated on this link. Open Model Configuration Parameter settings from the toolbar:
- Solver >> Stop time>> inf
- Solver >> Solver Selection >>Type>> Fixed-step
- In Model Configuration Parameter settings, select the Code Generation >>Target selection >> System Target File. Browse to select the VeriStand.tlc file and use the correct toolchain, for example VeriStand Compiler for Linux63 target | gmake makaefile (64-bit Linux) if we are compiling for NI Linux Real-Time(64-bit) target.
- Build the model by selecting Code >> C/C++ Code >> Build Model. Make sure that the build process is completed successfully, the build output directory will contain:
- Generated C files and header files
- The makefile
- Other model framework files
- The compiled shared library (.dll or .so file)
Deploy Model in NI Linux Real-Time Hardware Using VeriStand
- Install the VeriStand Engine to your real-time target.
- Open an existing VeriStand project or create a new project and then open the System Explorer. Make sure to input correct real-time target Operating System and IP Address.
- To use the model in VeriStand, you can now use the build DLL or SO file and load it into VeriStand by selecting Add a Simulation Model.
- After the model has been loaded, you can find the inputs and outputs channels under your models.
- Open or create one screen file and drag all the inputs and outputs from the add models.
- Deploy the model into the VeriStand. After the status has change to Connected, change the value of the input ln1 and ln2. You can find out that the output will reflect the result from the Add model.