Real-Time Workshop    

Using the State Properties Dialog Box to Interface
States to External Code

The State Properties dialog box lets you interface a block's state to external code by assigning a storage class other than Auto (i.e., ExportedGlobal, ImportedExtern, or ImportedExternPointer) to the state.

Set the storage class as follows:

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

    This picture shows the default settings of the State Properties dialog box.

  1. Select the desired storage class (ExportedGlobal, ImportedExtern, or ImportedExternPointer) from the RTW storage class menu.
  2. Optional: For storage classes other than Auto, 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.
  3. Click Apply and close the dialog box.

  Block State Storage Classes Symbolic Names for Block States