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:
ExportedGlobal
, ImportedExtern
, or ImportedExternPointer
) from the RTW storage class menu.
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.
Note
You can also interface test points and other signals that are stored as members of rtB to your code. To do this, your code must know the address of the rtB structure where the data is stored, and other information. This information is not automatically exported. Real-Time Workshop provides C and Target Language Compiler APIs that give your code access to rtB and other data structures. See Interfacing Parameters and Signals for further information.
|
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 | ![]() |