Real-Time Workshop User's Guide    

Interfacing Parameters and Signals

Simulink external mode (see Chapter 5, 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 application. Some targets (such as the Real-Time Workshop Embedded Coder) do not support external mode, due to optimizations. In other cases, you may want existing code to access parameters and signals of a model directly, rather than using the external mode mechanism.

The Real-Time Workshop supports several approaches to the task of interfacing block parameters and signals to your hand-written code.

The Workspace Parameter Attributes dialog enables you to declare how to 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 created by the Real-Time Workshop. This section is an overview of these APIs. This section also includes pointers to additional detailed API documents shipped with the Real-Time Workshop.


 Source Code for Inlined ADC Driver Signal Monitoring via Block Outputs