Real-Time Workshop    

Simulink Data Objects and Code Generation

Before using Simulink data objects with Real-Time Workshop, please read the following:

Overview

Within the class hierarchy of Simulink data objects, Simulink provides two classes that are designed as base classes for signal and parameter storage. These are:

The RTWInfo properties of parameter and signal objects are used by Real-Time Workshop during code generation. These properties let you assign storage classes to the objects, thereby controlling how the generated code stores and represents signals and parameters.

Real-Time Workshop also writes information about the properties of parameter and signal objects to the model.rtw file. This information, formatted as Object records, is accessible to Target Language Compiler programs. For general information on Object records, see Object information in the model.rtw file in the Target Language Compiler Reference Guide.

The general procedure for using Simulink data objects in code generation is as follows:

  1. Define a subclass of one of the built-in Simulink.Data classes.
  2. Instantiate parameter or signal objects from your subclass and set their properties appropriately, using the Simulink Data Explorer.
  3. Use the objects as parameters or signals within your model.
  4. Generate code and build your target executable.

The following sections describe the relationship between Simulink data objects and code generation in Real-Time Workshop.


  Parameter Tuning via MATLAB Commands Parameter Objects