Real-Time Workshop    

Interfacing Signals to External Code

The Simulink Signal Properties dialog lets you interface selected signals to externally written code. In this way, your hand-written code has access to such signals for monitoring or other purposes. To interface a signal to external code, use the Signal Properties dialog box to assign one of the following storage classes to the signal:

Set the storage class as follows:

  1. In your Simulink block diagram, select the line that carries the signal.Then select Signal Properties from the Edit menu of your model. This opens the Signal Properties dialog box.
  1. Alternatively, you can right-click the line that carries the signal, and select Signal properties from the pull-down menu.

  1. Deselect the SimulinkGlobal (Test Point) option if necessary. This enables the RTW storage class field.
  2. Select the desired storage class (ExportedGlobal, ImportedExtern, or ImportedExternPointer) from the RTW storage class menu.
  3. Optional: For storage classes other than Auto and SimulinkGlobal, you can enter a storage type qualifier such as const or volatile in the RTW storage type qualifier field. Note that Real-Time Workshop does not check this string for errors; whatever you enter is included in the variable declaration.
  4. Click Apply.

Limitation on Stateflow Outputs..   Note that a nonscalar output signal exiting a Stateflow chart can not be assigned storage class ImportedExternPointer.


  Declaring Test Points Symbolic Naming Conventions for Signals in Generated Code