Real-Time Workshop    

Inlined and Tunable Parameters

By default, all parameters (except those listed in Limitations of External Mode) in an external mode program are tunable; that is, you can change them via the download mechanism described in this section.

If you select the Inline parameters option (on the Advanced page of the Simulation Parameters dialog box), Real-Time Workshop embeds the numerical values of model parameters (constants), instead of symbolic parameter names, in the generated code. Inlining parameters generates smaller and more efficient code. However, inlined parameters, since they are effectively transformed into constants, are not tunable.

Real-Time Workshop lets you improve overall efficiency by inlining most parameters, while at the same time retaining the flexibility of run-time tuning for selected parameters that are important to your application. When you inline parameters, you can use the Model Parameter Configuration dialog to remove individual parameters from inlining and declare them to be tunable. In addition, the Model Parameter Configuration dialog offers you options for controlling how parameters are represented in the generated code.

For further information on tunable parameters please see Parameters: Storage, Interfacing, and Tuning.

Automatic Parameter Uploading on Host/Target Connection

Each time Simulink connects to a target program that was generated with Inline parameters on, the target program uploads the current value of its tunable parameters (if any) to the host. These values are assigned to the corresponding MATLAB workspace variables. This procedure ensures that the host and target are synchronized with respect to parameter values.

All workspace variables required by the model must be defined to an initial value at the time of host/target connection. Otherwise the uploading cannot proceed and an error will result. Once the connection is made, these variables are updated to reflect the current parameter values on the target system.

Note that automatic parameter uploading takes place only if the target program was generated with Inline parameters on. The Download Mechanism describes the operation of external mode communications with Inline parameters off.


  The Download Mechanism The TCP/IP Implementation