Target Language Compiler    

Model Hierarchy

The root is the top level of the block diagram. The RootSignals record contains information about the makeup of signals within the root level. This includes indices to subsystems that are visible at the root level as well as the number of input and output signals that appear at the root level. The Subsystem records contain information about the number of virtual and nonvirtual subsystems contained in the model and identifiers for these.

Each subsystem in the model includes a system identifier, a name, and a set of indices to any additional child subsystems. Counts are also provided for the number of outputs for each subsystem and number, signal information, and total number of nonvirtual blocks within each subsystem.

The RootSignals and Subsystem records enable you to reconstruct the graphical model hierarchy. This is useful for third party monitoring and parameter tuning tools.

Table A-8: Model.rtw Model Hierarchy (Blocks, Signals, and Subsystems) 
Variable/Record Name
Description
RootSignals {

Signal and block information in the root window.

  ChildSubsystemIndices

Vector of integers specifying the subsystems that are directly contained within the root system. The indices index into the CompiledModel.Subsystem record list.

  NumSignals

Number of block output signals (including virtual) blocks.

  Signal {

One record for each block output signal (i.e., length of this list is NumSignals).

    Block

[sysIdx, blockIdx] or block name string if a virtual block.

    SigLabel

Signal label if present.

    OutputPort

[outputPortIndex, outputPortWidth].

    Dimensions

Vector of the form [nRows, nCols] for the signal. Only written if number of dimensions is greater than 1.

    DataTypeIdx

Index into the CompiledModel.DataTypes.DataType record list. Only written for nonvirtual blocks and if data type index is not 0 (the default data type of 0 corresponds to real_T).

    ComplexSignal

yes/no: is the signal complex? Only written for nonvirtual blocks and if signal is complex.

    SignalSrc

Vector of length outputPortWith giving the location of the signal source.

  }

  NumBlocks

Number of nonvirtual blocks in the root window of your model.

  BlockSysIdx

System index for blocks in this subsystem.

  BlockMap

Vector of length NumBlocks giving the blockIdx for each nonvirtual block in the root system.

}

NumVirtualSubsystems

Total number of virtual (non-empty) subsystems in the model.

NumNonvirtalSubsystems

Total number of nonvirtual subsystems in the model.

Subsystem {

One record for each subsystem.

  SysId

System identifier. Each subsystem in the model is given a unique identifier of the form S# (e.g., S3).

  Name

Block name preceded with a <root> or <S#> token. The ID/Name values define an associative pair giving a complete mapping to the blocks full path name (e.g., <s2/gain1>).

  SLName

Unmodified Simulink name. This is only written if it is not equal to Name. This will occur when generating code using the rtwgen StringMapings argument. For the Real-Time Workshop C targets, any block name that contains a new-line, '/*', or '*/' will have these characters remapped. For example, suppose the Simulink block name is

    my block name
    /* comment */
    

    The model.rtw file will contain

    Name   "<Root>/my block name //+ comment +//" SLName "<Root>/my block name\n//* comment *//"
  Virtual

yes/no: Whether or not the subsystem is virtual.

  ChildSubsystemIndices

Vector of integers specifying the subsystems that are directly contained within this subsystem. The indices index into the CompiledModel.Subsystem record list.

  NumSignals

Number of block output signals (including virtual) blocks.

  Signal {

One record for each block output signal (i.e., length of this list is NumSignals).

    Block

[sysIdx, blockIdx] or block name string if a virtual block.

    OutportName

This field is written only if the signal is emanating from a subsystem. It is the Outport block name corresponding to the output signal of a subsystem block.

    SigLabel

Signal label if present.

    OutputPort

[outputPortIndex, outputPortWidth].

    Dimensions

Vector of the form [nRows, nCols] for the signal. Only written if number of dimensions is greater than 1.

    DataTypeIdx

Index into the CompiledModel.DataTypes.DataType record list. Only written for nonvirtual blocks and if data type index is not 0 (i.e., real_T).

    ComplexSignal

yes: Only written for nonvirtual blocks and if signal is complex.

    SignalSrc

Vector of length outputPortWith giving the location of the signal source.

  }

  NumBlocks

Number of nonvirtual blocks in the subsystem.

  BlockSysIdx

System index for blocks in this subsystem.

  BlockMap

Vector of length NumBlocks giving the blockIdx for each nonvirtual block in the subsystem.

}


 Block Type Counts External Inputs and Outputs