Getting started with Simcenter Amesim Real-Time Simulation > Changing parameters or tables in the Simcenter Amesim model on the real-time target
dSPACE SCALEXIO
This platform (ControlDesk) gives the possibility to access parameters in the Simulink model directly while the simulation is running. By adding Simcenter Amesim parameters to the Simcenter Amesim watch facility we can change also Simcenter Amesim parameters while the simulation is running. The limitation is that many Simcenter Amesim parameters are not used directly in the calculation, but they are preprocessed in the initialization phase of the simulation. A typical example is the diameter of an orifice that is used for calculating the area of the orifice. For calculating the flow through the orifice, the area is used so in this case changing the diameter will not change the results of the simulation. In general, only simple parameters can be altered during the simulation. Note that also unit conversion will influence the parameters. So if you input a mass in "pound (lb)" and the submodel is using SI units (kilogram for mass), the parameter you see in ControlDesk will be expressed in kg. So to use the parameter changing feature, we continue using the skyhook system and we add some watch parameters and variables.
Figure 21: Simcenter Amesim system with added watch parameters and variables
After adding the watch variables and parameters it is necessary to do a Generate files for Real-time to generate up-to-date files.
Since Simcenter Amesim does not know the name of the Simulink system that the code will be used in, we generate the TRC file as AMESIMMODELNAME_.trc. For the current example quartercar.ame we generate a file called quartercar_.trc. To take this into account in dSPACE, we must rename the file manually to be the SLINKMODELNAME_usr.trc. In the current example where the Simulink system is called "skyhook" we should rename (or copy) quartercar_.trc to skyhook_usr.trc. If you are an advanced user of dSPACE, you may already have created trace files manually. In that case, the contents of the Simcenter Amesim generated file should be appended to the existing file (skyhook_usr.trc).
To ensure that Simulink Coder/dSPACE will recompile the Simcenter Amesim system it may be necessary to remove the object file for the Simcenter Amesim S-function (quartercar_.o).
Note
The suffix for the file (.o) depends on the target. For example, when you use a Micro Autobox 1401/1504, the suffix is .o03.
The Simulink Coder build process should work. As previously, there should be a message in the MATLAB command window saying something like:
*** Found User Variable Description File skyhook_usr.trc from ...."
when the Simulink Coder process runs.
The main difference is visible when the model is opened in Control Desk. The list of variables/parameters should now contain an additional item User Variables that will contain the watch variables and parameters added in Simcenter Amesim. Note that the unit is not correctly displayed in the Variable column. In the Description column, it is correct.
Figure 22: Simcenter Amesim variables and parameters visible in Control Desk
The variables and parameters can now be treated as any other variables or parameters. It is for instance possible to create a plot with the accelerations in the Simcenter Amesim model. The advantage with this is that it is not necessary to add ports for all variables that are only for observing.
The parameters in the Simcenter Amesim model can be changed during the run (see exceptions above). In the current example (wheel and body mass), the mass is possible to change, which will indeed change the dynamical behavior.
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Real_Time/dSPACE_DS_or_DS · retrieved 2026-07-17