Generic Transformation Workflow
The generic transformation workflow is:
- Select Elements to Transform
- Select Type of Transformation
- Configure Transformation Options
- Export Elements in a File
- Import Elements in MATLAB
Select the elements you want to transform
As the first step of the transformation workflow, select the Capella model elements you want to perform. The elements can be selected from the Capella Project Explorer. To select several elements keep the CTRL button pressed while selecting the elements.
When all the elements you want to transform are selected then right click on one of the selected element and choose the "Export to Simulink®" option.
At any time in the "Capella Export to Simulink®" GUI you can skip all the remaining steps to generate the export file.
Select Type of Transformation
Once the Export menu is opened, select the transformation you want to perform and click "Next":
- State machines sorted by engineering perspectives to transform Modes and States Machines
- Data Packages sorted by engineering perspectives to transform Data and Interfaces
- Functional chains and their constituting elements to transform Functional Chains
- Functions, their ports and the states they are available in to transform Functions
Configure Transformation Options
Depending on the type of transformation selected there are a few options. See the dedicated page for more information about these options.
- Transformation of Data and Interfaces
- Transformation of Functional Chains
- Transformation of Functions
- Transformation of Modes & States Machines
Export Elements in a File
When the transformation configuration is set then click "Finish" to generate the export file.
The exported file is named the same than your Capella Project with the extension .mlcore and stored at the root level of the Capella Project.
It is good practice to rename this file to make it more explicit.
A known limitation is that it is not possible to define the name or location of the export file before generation.
Import Elements in MATLAB
The elements can be imported in the MATLAB environment programmaticaly or via MATLAB Project shortcut.
Import Elements in MATLAB Programmatically
See CapSLBridge.import for more information.
See Cap2SL Project Template Overview to know how to work with this project.
Import Elements from MATLAB Project
From an existing MATLAB Project created from the Cap2SL Project template, paste the .mlcore file in the "capellaData" folder and click on the "Import Capella elements" project shortcut. If there are more than one .mlcore file in this folder, then you are prompted to select which one you want to use for the import.