- Installing the software required.
- Adapt your C/C++ code for building a VeriStand Model
There are three main steps that you require to perform for building a C/C++ model compatible with VeriStand:
- Create a model.h header file.
- Adapt template.c to serve as your model code.
- Create a makefile to compile your model code.
- Compiling the model with NI VeriStand Model Framework and the Command prompt tools.
- Open the Command prompt by typing cmd on Windows Search bar
- Open Microsoft Windows x86/x64 Debug Build Environment. To do that on your command navigate to the following directory using this command: “cd C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin”
- Windows and Pharlap Targets:
- Enter this command to pass to a x86 environment “SetEnv.Cmd /x86”
- Navigate to the folder your Model Files are located (model.h, makefile and model.c)(One of the shipping examples, For instance: write command: “cd C:\VeriStand\2019\ModelInterface\custom\examples\engine”
- Use the tool nmake to build the model for example: “nmake engine.mak”
- Navigate to the folder the files are located and look for the .dll file. That file is the successful build you can import into VeriStand to run this model.
- Linux RT 64:
- Enter this command to pass to a x86 environment “SetEnv.Cmd /x64”
- Navigate to the location your model source files are. For instance, C:\VeriStand\2019\ModelInterface\custom\examples\engine
- Once on the location Enter the following command to build a model compatible with Linux 64 bits RT targets modify the bolded section with the name of your .mk file “C:\VeriStand\2019\ModelInterface\tmw\toolchain\Linux_64_GNU_Setup.bat&s-make.exe -f engine-linux64.mk”
- Navigate to the folder the files were located and search for the .so file, that is going to be the built model that you can import into VeriStand.
- Linux RT 32-bit ARM:
- Enter this command to pass to a x86 environment “SetEnv.Cmd /x86”
- Navigate to the location your model source files are. For instance, C:\VeriStand\2019\ModelInterface\custom\examples\engine
- Once on the location Enter the following command to build a model compatible with Linux 64 bits RT targets modify the bolded section with the name of your .mk file “C:\VeriStand\2019\ModelInterface\tmw\toolchain\Linux_ARM_32_GNU_Setup.bat&cs-make -f engine-linux.mk”
- Navigate to the folder the files were located and search for the .so file, that is going to be the built model that you can import into VeriStand.
Note: Make sure that you moved your .so file out of the source code folder before building for a second OS, otherwise there is a chance that building on the second time will conflict with the first build.