Real-Time Workshop | ![]() ![]() |
Interfacing Parameters and Signals
Simulink external mode (see External Mode) offers a quick and easy way to monitor signals and modify parameter values while generated model code executes. However, external mode may not be appropriate for your target or optimal for your application. S-function targets do not support external mode, nor do DOS targets. In other cases, you may prefer to use existing code to access parameters and signals of a model directly, rather than using the external mode mechanism.
Real-Time Workshop supports several approaches to the task of interfacing block parameters and signals to your hand-written code.
The Model Parameter Configuration dialog enables you to declare how the generated code allocates memory for variables used in your model. This allows your supervisory software to read or write block parameter variables as your model executes. Similarly, the Signal Properties dialog gives your code access to selected signals within your model. Operation of these dialogs is described in Parameters: Storage, Interfacing, and Tuning and Signals: Storage, Optimization, and Interfacing.
In addition, the MathWorks provides C and Target Language Compiler APIs that give your code additional access to block outputs, and parameters that are stored in global data structures and global variables created by Real-Time Workshop. This section is an overview of these APIs. This section also includes pointers to additional detailed API documents shipped with Real-Time Workshop.
![]() | Source Code for Inlined ADC Driver | Signal Monitoring via Block Outputs | ![]() |