Target Language Compiler | ![]() ![]() |
Advanced External Mode Exercise
Starting with the model simple
, add a Constant block (value of constant
set to zero). Add a Stop Simulation block (Sinks) downstream from the Constant block. Save this model as simple_s.mdl
.
200,000
. From the Code Generation Options dialog box, select External mode and Verbose builds. Save the model as simple_s.mdl
. Generate and build the executable. Be sure to select limit rows to last 1,000. (Workspace I/O page)simple_s
in the DOS window.gain
value from 1
to 5
in the Simulink block diagram.0
to 1
.This starts the standalone simulation. Then, it starts Simulink's external mode and allows you to change model parameters in the generated code automatically. Although it is not obvious on your computer, the underlying mechanism allows parameter changes to generated code even if running on target hardware. The only requirement in such an application is that your external hardware must provide TCP/IP support. For example, TCP/IP stack or library that you can link against during the build process.
Observe messages in the DOS window regarding updating of parameters.
When you complete this example, go to the Simulink menu or External Mode Control Panel and select Disconnect, and then select Normal to resume normal simulation mode.
![]() | Simulink External Mode and GRT | Loop Rolling Through a TLC File | ![]() |