Il contenuto non è disponibile nella lingua selezionata.

Verrà mostrato il contenuto in un'altra delle lingue disponibili. Il tuo browser potrebbe avere delle funzionalità di traduzione.

NI VeriStand Models Built with The MathWorks, Inc. Simulink® Not Compiling

Updated Jul 31, 2023

Reported In

Software

  • VeriStand
  • VeriStand Model Framework

Operating System

  • PharLap
  • NI Linux Real-Time
  • VxWorks

Issue Details

I have a model in The Mathworks, Inc. Simulink® software that I am trying to use in NI VeriStand, but my model compilation is failing.

I recieve the following error when trying to compile my model for VeriStand: 

Warning: You have selected an unsupported compiler. Attempting to locate a supported installation of the Microsoft Visual Studio C++ tool chain.

What steps should I take to troubleshoot the problem?

Solution

First, verify the following items: 

1. Check the Version Compatibility of VeriStand and the The MathWorks, Inc. Software using the following document: VeriStand Modeling Version Compatibility

2. Check that the the NI Real-Time target and The MathWorks, Inc. MATLAB® Software have been configured correctly by following the operating system-specific steps:

Note: NI VeriStand added support for NI Linux Real-Time CompactRIO controllers with the release of VeriStand 2015. If you are unsure which operating system your NI Real-Time device is running, check the following Product Documentation: Real-Time Controllers and Real-Time Operating System Compatibility .
3. Verify that the VeriStand Model Framework has been installed on your computer. If the framework has been installed on your computer, it should be located at C:\VeriStand\<version>

If the VeriStand Model Framework files are missing, you will need to install them. To install the VeriStand Model Framework, please reference Compiling DLLs for Use with VeriStand Without Development License.  

If you have recently just updated The Mathworks, Inc. Simulink® Software, uninstall and reinstall VeriStand Model Framework. Only repairing the installation will not work.


4. Verify the correct compiler and the correct solver options and .tlc file have been selected in MATLAB® and Real-Time Workshop®/Simulink Coder® respectively. Steps 3 and 4 of the following help article discuss these settings: Compiling a Model from The MathWorks, Inc. Simulink® Software


5. If you are building models for Phar Lap or Windows targets and you are using NI VeriStand 2015 SP1 or newer, a patch may be required for the Windows 7.1 SDK. See VeriStand Models Fail to Compile with LNK 1123 Error  for details.


6. If you are having difficulties installing the Windows SDK 7.1 on a Windows 8.1 or Windows 10 machine, please reference Problem Installing the Windows SDK 7.1 for VeriStand Model Compilation.


7. ​​If you are using Bus Arrays, make sure that these are defined in your workspace.


If the standard steps above do not resolve the issue, please try the following troubleshooting steps:
  • If a simple test model compiles successfully, remove sections of the large (failing) model to isolate the problem.  
  • Run MATLAB® as administrator and attempt to compile the model.  
  • If the model is on a network drive, move the model to a drive that has both the VeriStand Model Framework and the correct compiler installed on your local machine.  
  • Try compiling the model with grt.tlc selected in the Real-Time Workshop®/Simulink Coder®. If that compilation fails, try changing the compiler back to the built-in MATLAB® compilier- as the problem may be with the installed compiler. If using different .tlc files and different compilers does not result in a success compilation, the problem is likely with the model.  
  • Investigate the build files directory. If [modelname]_vc.bat was created, run the .bat file from the command prompt. If a .dll, .so, or .out file was created, test the model with known input and output values.

If none of the above troubleshooting steps resolve the issue, please contact NI or further technical support . Before contacting support, please secure a copy of the build log (available via the Command Window and saved in the build directory).

Additional Information

MATLAB®, Simulink®, Simulink Coder®, and Real-Time Workshop® are registered trademarks of The MathWorks, Inc. All other trademarks are the property of their respective owners.

The .tmf file is a file that will define how the C code is compiled. It is installed with the model framework, when you choose to add this during the installation of VeriStand. If you wish to add this you will need to reinstall VeriStand and include the model framework.