Model Setup
Block Selection
You can create models for targeting the same way you create other Simulink® models—by combining standard blocks and C-MEX S-functions.
You can use blocks from the following sources:
The Embedded Coder Support Packages.
The Embedded Targets library (
embeddedtargetslib
) in the Embedded Coder® product.Blocks from the System Toolboxes products
Custom blocks
Avoid using blocks that do not generate code, including the following blocks.
Block Name/Category | Library | Description |
---|---|---|
Scope | Simulink, DSP System Toolbox™ software | Provides oscilloscope view of your output. Do not use the Save data to workspace option on the Data history pane in the Scope Parameters dialog. |
To Workspace | Simulink | Return data to your MATLAB® workspace. |
From Workspace | Simulink | Send data to your model from your MATLAB workspace. |
Spectrum Scope | DSP System Toolbox | Compute and display the short-time FFT of a signal. It has internal buffering that can slow your process without adding value. |
To File | Simulink | Send data to a file on your host machine. |
From File | Simulink | Get data from a file on your host machine. |
Triggered to Workspace | DSP System Toolbox | Send data to your MATLAB workspace. |
Signal To Workspace | DSP System Toolbox | Send a signal to your MATLAB workspace. |
Signal From Workspace | DSP System Toolbox | Get a signal from your MATLAB workspace. |
Triggered Signal From Workspace | DSP System Toolbox | Get a signal from your MATLAB workspace. |
To Wave device | DSP System Toolbox | Send data to a |
From Wave device | DSP System Toolbox | Get data from a |
Configure Target Hardware Resources
To configure your Simulink model for your target hardware and toolchain:
In the Configuration Parameters dialog box, select Hardware Implementation, and then specify your Hardware board.
Specifying a Hardware board automatically sets many Code Generation parameters to values appropriate for the hardware.
On the Target Hardware Resources tab, review the other parameters.
(Optional) In the Configuration Parameters dialog box, select Code Generation, and then review and modify other code generation features for your model.
Click Apply, and save the changes to your model.