Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01352// Views: AA-01352// Created: 2017-12-12 18:31:43// Last Updated: 2022-01-12 06:38:38
HowTo
How to confirm that Simulink Coder is not the cause of a building issue in RT-LAB

How to confirm that Simulink Coder is not the cause of a building issue in RT-LAB

Simulink Coder and the license for it are absolutely required in order to Build in RT-LAB:

  • S-functions can be compiled with Simulink Coder, thus they can be built by RT-LAB.
  • Embedded MATLAB functions can be compiled with Simulink Coder, thus they can be built in RT-LAB.
  • MATLAB functions cannot be compiled with Simulink Coder, thus they cannot be built in RT-LAB.
  • etc...

You can verify if your model can be compiled by Simulink Coder prior to building it in RT-LAB by following these steps (see also image below):

  • Open your Simulink model
  • Over Code in the top bar, select C/C++ Code and go in Code Generation Options
  • You will need to change the System target file, for that go into Code Generation and click in Browse and then select rtlab_rtmodel.tlc

  • You can then build the model in Simulink : Go over Code in the top bar, select C/C++ Code and then click in Build Model (or APPS - Simulink coder - Generate Code)
  • Look if it is compiling correctly or not
  • If you get an error, read the error message and look for a solution via Mathworks. Most common reasons are listed below.

At this point, RT-LAB is not used at all, only Simulink Coder. If it does not compile with Simulink Coder, it will not build in RT-LAB. Please verify:

  • If you have Simulink Coder when you type ver in MATLAB command prompt
  • If you have the proper Simulink Coder license and it is available (in case of floating license)
  • The compatibilities of the blocks used in your model with Simulink Coder


A few error messages you can get in RT-LAB:

1) Error: Simulink Coder Error in block ... ... block type MATLABFcn: Not yet supported by Simulink Coder


2) Error using loc_check_license - Unable to check out the Simulink Coder license which is required to generate code