| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop Embedded Coder |
| Contents | Index |
| Learn more about Real-Time Workshop Embedded Coder |
Simulink models store model-wide parameters and target-specific data in configuration sets. Every configuration set contains a component that defines the structure of a particular target and the current values of target options. Some of this information is loaded from a system target file when you select a target using the System Target File Browser. You can configure models to generate alternative target code by copying and modifying old or adding new configuration sets and browsing to select a new target. Subsequently, you can interactively select an active configuration from among these sets (only one configuration set can be active at a given time).
Scripts that automate target selection need to emulate this process.
To program target selection
Obtain a handle to the active configuration set with a call to the getActiveConfigSet function.
Define string variables that correspond to the required Real-Time Workshop system target file, template makefile, and make command settings. For example, for the ERT target, you would define variables for the strings 'ert.tlc', 'ert_default_tmf', and 'make_rtw'.
Select the system target file with a call to the switchTarget function. In the function call, specify the handle for the active configuration set and the system target file.
Set the TemplateMakefile and MakeCommand configuration parameters to the corresponding variables created in step 2.
For example:
cs = getActiveConfigSet(model); stf = 'ert.tlc'; tmf = 'ert_default_tmf'; mc = 'make_rtw'; switchTarget(cs,stf,[]); set_param(cs,'TemplateMakefile',tmf); set_param(cs,'MakeCommand',mc);
![]() | Selecting a System Target File | Specifying Code Appearance and Documentation | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |