User`s guide

4 External Mode
4-2
Introduction
External mode is a simulation mode provided by the Real-Time Workshop that
supports on-the-fly parameter tuning in a real-time environment. “External”
refers to the fact that this mode involves two separate computing
environments, a host and a target. The host is the computer where MATLAB
and Simulink are executing, and the target is the computer where the
executable that you create with the Real-Time Workshop runs. Using external
mode, you can modify the block parameters and view and log block outputs in
Scope blocks.
External mode works by establishing a communications channel between
Simulink and the Real-Time Workshop generated code. This communication
channel can be a networking protocol such as the Transmission Control
Protocol (TCP) or shared memory.
In external mode, Simulink waits for parameter changes. Once Simulink
receives the parameter changes, it provides the target with the new
parameters.
The external mode implementation included with the Real-Time Workshop
relies on the TCP to provide a communications layer between the target (where
theexecutablethatyoucreateruns)andthehost(whereyourmodelresides).
The external mode implementation included with the Real-Time Workshop for
use with the Real-Time Windows Target uses shared memory as the
communication channel. Note that the Real-Time Windows Target is a
separate product from the Real-Time Workshop.
This chapter discusses these topics:
How to set up external mode on your computer (self-targeting your machine)
How to use the TCP socket-based external mode implementation that is
included in Simulink
Parameter tuning
Signal viewing and logging by using Simulink Scope blocks
How to create your own external mode communication channel for your
custom target
Before reading this chapter, you should have read Chapter 3, “Code Generation
and the Build Process.”