There are three main steps to build a C/C++ model compatible with VeriStand:
1. Install the Required Software
2. Adapt Your C/C++ Code for Building a VeriStand Model
-
- Create a model.h header file.
- Adapt template.c to serve as your model code.
- Create a makefile to compile your model code.
For more details on these steps, consult the NI VeriStand Model Framework documentation.
3. Compile the Model with NI VeriStand Model Framework and Command Prompt Tools
Note: Use the ModelInterface folder associated with the VeriStand Model Framework installed for your VeriStand environment. The Model Framework version might differ from the VeriStand version, and more than one ModelInterface folder might be present under C:\VeriStand. For example, VeriStand 2026 Q3 installs VeriStand Model Framework 2025 Q1, so use C:\VeriStand\2025\ModelInterface for Windows and Linux RT 64-bit targets.
Note: When installing VeriStand, make sure to select VeriStand Model Framework in the installer. If this component is not selected, the files required to build C or C++ models are not installed.
Windows and PharLap Targets:
-
- Open the Developer Command Prompt for VS 2022 through the Start menu or by executing
VsDevCmd.bat located at: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools. - Set the appropriate environment based on host PC and target architecture:
- Call
VsDevCmd.bat with defined host_arch and arch arguments. For example, VsDevCmd.bat -host_arch=amd64 -arch=amd64 is used to compile the model for a 64-bit system using a likewise system as the host. Architectures available can be found in Use the Microsoft C++ toolset from the command line | Microsoft Learn. - Alternatively, you can use the Developer command prompt shortcuts or predefined configurations located at
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build, instead of VsDevCmd.bat.
- Navigate to the location of the model source files, for example:
cd C:\VeriStand\2021\ModelInterface\custom\examples\engine.
Example for VeriStand 2026 Q3: cd C:\VeriStand\2025\ModelInterface\custom\examples\engine. - Use
nmake with the corresponding makefile, for example: nmake /f engine.mak.

-
- Navigate to the folder where the files are located and look for the .dll file. This file is the successful build you can import into VeriStand to run this model.

Linux RT 64-bit Targets:
-
- Open the command line or the Developer Command Prompt and execute the setup script:
C:\VeriStand\2021\ModelInterface\tmw\toolchain\Linux_64_GNU_Setup.bat.
Example for VeriStand 2026 Q3: C:\VeriStand\2025\ModelInterface\tmw\toolchain\Linux_64_GNU_Setup.bat. - Navigate to the location of the model source files:
cd C:\VeriStand\2021\ModelInterface\custom\examples\engine.
Example for VeriStand 2026 Q3: cd C:\VeriStand\2025\ModelInterface\custom\examples\engine. - Execute
cs-make.exe with the makefile: cs-make.exe -f engine-linux64.mk.

-
- Navigate to the folder where the files are located and search for the .so file. This file is the built model that you can import into VeriStand.

Linux RT 32-bit ARM Targets:
-
- Open the command line and execute the setup script:
C:\VeriStand\2021\ModelInterface\tmw\toolchain\Linux_ARM_32_GNU_Setup.bat. - Navigate to the location of the model source files: cd
C:\VeriStand\2021\ModelInterface\custom\examples\engine. - Execute
cs-make.exe with the makefile: cs-make.exe -f engine-linux.mk. - Navigate to the folder where the files are located and search for the .so file. This file is the built model that you can import into VeriStand.
Note: Make sure to move your .so file out of the source code folder before building for a second OS. Otherwise, there is a chance that building a second time will conflict with the first build.