Target Language Compiler    

Object Information in the model.rtw File

During code generation, Real-Time Workshop writes information about signal and parameter objects to the model.rtw file. An Object record is written for each parameter or signal that meets certain conditions. These conditions are described in Object Records For Parameters and Object Records For Signals.

The Object records contain all of the information corresponding to the associated object. To access Object records, you must write Target Language Compiler code (see Accessing Object Information via TLC).

Object Records For Parameters

An Object record is included in the in the ModelParameters section of the model.rtw file for each parameter, under the following conditions:

  1. The parameter resolves to a Simulink.Parameter object (or to a parameter object that comes from a class derived from the Simulink.Parameter class).
  2. The parameter's symbol is preserved in the generated code. The symbol is preserved when:

The following is an example of an Object record for a parameter.

Object Records For Signals

An Object record is included in the BlockOutputs section of the model.rtw file for each signal which meets the following conditions:

  1. The signal resolves to a Simulink.Signal object (or to an object that comes from a class derived from the Simulink.Signal class).
  2. The signal's symbol is preserved in the generated code. The symbol is preserved if:

The following is an example of an Object record for a signal:

Accessing Object Information via TLC

This section provides sample code to illustrate how to access object information from the model.rtw file using TLC code. For more information on TLC and the model.rtw file, see model.rtw.

Accessing Parameter Object Records.   The following code fragment iterates over the ModelParameters section of the model.rtw file and extracts information from any parameter Object records encountered.

Accessing Signal Object Records.   The following code fragment iterates over the BlockOutputs section of the model.rtw file and extracts information from any signal Object records encountered.


  Using Scopes in the model.rtw File Using Library Functions to Access model.rtw Contents