Transformation of Functions
Get initialized Simulink® models implementing Capella Functions
Workflow
The generic workflow is detailed in the Getting
started. Here in below are the specific
options to choose in this workflow:
- Select in the Capella Project Explorer the Functions to export.
- Open the "Capella Export to Simulink®" tool.
- Select the transformation type "Functions, their ports and the states they are available
in".
- Set the transformation options "Leaf Functions export strategy".
- Set the transformation options "Port naming strategy".
- Import the Function in the project using the generated .mlcore file.
How are the Capella Function elements transformed?
-
Top Parent Function as a Simulink® model stored in the "model\<ArcadiaPerspective>" folder.
The name of the Simulink® model is "<ArcadiaPerspective>_<FunctionName>.slx".
-
Intermediate Parent Function as a Subsystem in the Top Parent Function Simulink® model.
The Subsystem name is the same than the Capella function name.
-
Leaf Function can be transformed as a model (default) or a Subsystem according to the
option "Leaf Functions export strategy".
-
Function Output Port as an outport at the model or susbsytem level corresponding to its
function. The port name is the Capella Function Port name or the Functional Exchange name the port
is connected to (default) according to the option "Port naming strategy".
-
Function Input Port as an inport at the model or susbsytem level corresponding to its
function. The port name is the Capella Function Port name or the Functional Exchange name the port
is connected to (default) according to the option "Port naming strategy".
-
In/Out Port Data Type in Simulink® respects the data type definition extracted from the
Functional Exchange connected to the port.
-
A Data Dictionary is created for each function exported as a Simulink® model and linked
to it.
The name of the data dictionary is "<ArcadiaPerspective>_<FunctionName>.sldd".
It is used to store potential Parameters dedicated to the transformed Function; and to reference other Data
Dictionaries storing the definition of the used data types.
- "Available in Modes and States" Capella Function property as an Enable block in the
corresponding Function model or Subsystem.
Example
Let's consider the following "Prepare motion consigns" parent function described in the
diagram below:
The resulting Simulink® model for this parent Function is the following:
Function ports
The Function model is composed of "Inport" and "Outport" blocks respectively called "In
Flow Port" and "Out Flow Port".
User Option at export time
General naming rules to apply
- [DEFAULT] Simulink® Function port named according to the Functional Exchange name
connected to this port.
- the Capella port name
Naming the function port with the connected Functional
Exchange makes the function port names contextualised with the current project.
In case you consider reusable functions across projects or if you have REC-RPL use for some functions, it is
likely the Functional Exchange names connected to the ports of the reusable functions to be different from a
Function instance to another.
In this situation there is a naming discrepancy and this port naming rule shoud not be opt-in.
You should rename the reusable Function to be fully self-defined.
Then you should select the option to name the Simulink® Function port based on the Capella Function port
name.
Assumptions & Limitations
See Known Limitations for details.