How to Convert Simulink Models(.mdl Files) to .dll Files for NI VeriStand?

Updated Dec 22, 2023

Environment

Software

  • VeriStand 2015

Other

MATLAB® 2015a

I have some .mdl files which basically are Simulink models for controlling a three phase inverter. I would like to work with these .mdl files on VeriStand so that NI Hardware can further be integrated easily.

The Simulink models can easily be converted to dynamically linked libraries(.dll) files, which further can be called in NI VeriStand environment by following the steps mentioned below:

   1)  Launch Simulink® and load the model that you want to convert.
   2)  Select Simulation » Configuration Parameters to launch the Configuration Parameters dialog box.
   3)  Click the Solver Settings tab.
        a) Input inf for Stop Time.
        b) Set Solver Type to Fixed-Step.
        c) Set Solver to Discrete.
        d) Select Apply to save the changes.
   4) Click the Code Generation tab.
        a) Click the Browse button to launch the System Target File Browser dialog box.
        b) Select NIVeriStand.tlc—NI Real-Time for NI Phar Lap ETS & Windows Targets
            NIVeriStand_Linux_ARM_32.tlc—NI Real-Time Target for ARM-based targets
            NIVeriStand_Linux_64.tlc—NI Real-Time Target for Intel x64-based targets
            Note : VeriStand is not supported on x64 Intel-based cDAQ controllers running NI Linux Real-Time.
            NIVeriStand_VxWorks.tlc—NI Real-Time Target for VxWorks.
        c) Select Apply to save the changes.
        d) Select the OK button.
   5) Click the Apply button to ensure all settings are saved.
   6) Click the Build button in the Code Generation section to begin building the compiled model. The MATLAB®  command window displays the status of the build process.

Refer this tutorial for the list of software required to be installed and the detailed step by step procedure to convert the .mdl files to .dll and call them in VeriStand.

Additional Information

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