Target Language Compiler    

External Inputs and Outputs

The model.rtw file contains all information describing the external inputs (which correspond to root-level inport blocks) and external outputs (which correspond to root-level outport blocks). In control theory, the external inputs vector is conventionally referred to as U and the external output vector is referred to as Y. The generated code uses rtU and rtY.

Table A-9: Model.rtw External Inputs and Outputs 
Variable/Record Name
Description
  ExternalInputDefaults {

    DataTypeIdx

0: The default signal data type is real_T.

    ComplexSignal

no: The default signal is not complex.

    DirectFeedThrough

yes: The default assumes the root inport requires its input.

    StorageClass

Auto: The default value specifies that the Real-Time Workshop decides how external signals are declared.

    StorageTypeQualifier

"": The default type qualifier is empty.

  }

  NumExternalInputs

Integer number of records that follow, one per root-level inport block

  ExternalInput {

One record for each external input signal (i.e., root inport).

    Identifer

Unique name across all external inputs.

    TID

Integer task id (sample time index) giving the SampleTime record for this inport block.

    SigIdx

[externalInputVectorIndex, signalWidth].

    Dimensions

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

    DataTypeIdx

Integer index of DataType record corresponding to this block. Only written if index is not 0.

    ComplexSignal

yes: Only written if this inport signal is complex.

    SigLabel

Signal label entered by user.

    DirectFeedThrough

Only written if this inport doesn't require its signal when MdlOutputs is called.

    StorageClass

Only written if not Auto. This setting determines how this signal is declared.

    StorageTypeQualifier

Only written if not empty.

  }

}

ExternalInputsMap

Matrix of dimension (NumModelInputs,2), which gives a mapping from external input vector index (Ui) into the ExternalInputs structure: [externalInputsIndex, signalOffset]. Only written if NumModelInputs > 0.

ExternalOutputs {

External outputs (root outports) from the block diagram.

  NumExternalOutputs

Number of ExternalOutput records that follow. This is equal to the number of root level outports.

  ExternalOutput {

One record per root-level outport block.

    Block

[sysIdx, blockIdx] of the outport block.

    SigIdx

[externalOutputVectorIndex, signalWidth].

    Dimensions

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

    SigLabel

Label on the input port signal, if any.

  }

}


 Model Hierarchy Data Store Information