AmesimKnowledge

Getting started with Simcenter Amesim Real-Time Simulation > Generate the code for real-time in Simcenter Amesim

OPAL-RT TECHNOLOGIES RT-LAB

To configure code generation for RT-LAB you do nothing in Simulink (except the separation of console, master and slaves as shown previously in the section Additional required step for RT-LAB export ), but everything concerning the code generation is piloted from RT-LAB. In newer versions of RT-LAB this is done from an Eclipse based application RT-LAB.

In this application the import of the Simcenter Amesim model is prepared by setting certain variables and settings.

The tool used is the RT-LAB tool. Start this tool and create a new empty project. You will then need to load the Simulink model (by pressing the Add Existing Model button).

Figure 12: RT-LAB tool

This tool is used for controlling the code-generation, compilation and execution of the real-time model.

There are some special settings required for integrating an Simcenter Amesim model into a RT-LAB real-time simulation.

Procedure

  1. Set "Variables". Set to not using the Intel C compiler. See the figure below for how to set these variables.

  2. Set the development platform to Redhat and add linking with the Simcenter Amesim library.

  3. Add files to be transferred. The files are:

    quartercar_.c – the generated C file for the Simcenter Amesim S-function

    quartercar_.h - the generated H file for the Simcenter Amesim S-function

    quartercar_..h – this is the data for the model as C header files (generated with the Generate files for Real-Time feature). Note the "", which means all files starting with "quartercar_." and ends with ".h"

    libAMESim_RT_rUVWXYZ_lnxrt_32.a from $AME/misc/realtime/lnxrt_32 (for a 32-bit Linux target) or libAMESim_RT_rUVWXYZ_lnxrt_X64.a from $AME/misc/realtime/lnxrt_x64, (for a 64-bit Linux target). Note that this file must be transferred in binary mode.

    All header files from $AME/interfaces

    All header files (*.h) from $AME/lib, $AME/lib/amenum, $AME/lib/eigenvalues, $AME/lib/splines.

    All header files from $AME/interfaces/simulink

    Here the six digits UVWXYZ refer to the Simcenter Amesim release, for example 202010 for Simcenter Amesim 2020.1.

Results

The three settings are done in properties windows in RT-LAB as shown in the figures below.

Figure 13: User variables to be set. The Simcenter Amesim libraries have been compiled using GCC, and the process has not been validated using the Intel compiler.

Figure 14: Development properties to set – basically that we use a Red Hat target and that we should link with the Simcenter Amesim library (32-bit Linux example).

Figure 15: Configuration of files to be transferred to target (32-bit Linux example)

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Real_Time/OPAL-RT_TECHNOLOGIES_RT-LAB · retrieved 2026-07-17