|
| 1 | +# Modelio for INTO-CPS SysML modelling |
| 2 | + |
| 3 | +The Modelio tool and its SysML/INTO-CPS |
| 4 | +profile extension provide the diagramming starting point. This section describes the Modelio extension that provides INTO-CPS-specific modelling |
| 5 | +functionality to the SysML modelling approach. |
| 6 | + |
| 7 | +The INTO-CPS extension module is based on the Modelio SysML extension |
| 8 | +module, and extends it in order to fulfill INTO-CPS modelling requirements |
| 9 | +and needs. Figure 28 shows an example of a simple INTO-CPS Architecture |
| 10 | +Structure Diagram under Modelio. This diagram shows a _System_, named |
| 11 | +“System” (An abstract description of an INTO-CPS multi-model) |
| 12 | +, composed of two EComponents of kind _Subsystem_, named “SubSystem” (Abstract descriptions of INTO-CPS constituent models). These Subsystems have an internal Variable called “variable” of type String and expose two FlowPorts named “portIn” and “portOut”. The |
| 13 | +type of data going through these ports is respectively defined by types In and Out of kind StrtType. |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +Figure 28: Example INTO-CPS multi-model. |
| 18 | + |
| 19 | +Figure 29 illustrates the main graphical interface after Modelio and the |
| 20 | +INTO-CPS extension have been installed. Of all the panes, the following |
| 21 | +three are most useful in the INTO-CPS context. |
| 22 | + |
| 23 | +1. The Modelio model browser, which lists all the elements of your model in tree form. |
| 24 | +2. The diagram editor, which allows you to create INTO-CPS design architectures and connection diagrams. |
| 25 | +3. The INTO-CPS property page, in which values for properties of INTOCPS subsystems are specified. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +## Creating a New Project |
| 31 | + |
| 32 | +first step will be to create, as depicted in Figure 30, a Modelio project: |
| 33 | +1. Launch Modelio. |
| 34 | +2. Click on File → Create a project.... |
| 35 | +3. Enter the name of the project. |
| 36 | +4. Enter the description of the project. |
| 37 | +6. Click on Create to create and open the project. |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +Once you have successfully created a Modelio project, you have to install the Modelio extensions required for INTO-CPS modelling, i.e. both Modelio SysML and INTO-CPS extensions, as described in the [installation guide](Installation.md) |
| 43 | + |
| 44 | +If both modules have been correctly installed, you should be able to create, |
| 45 | +under any package, an **INTO-CPS Architecture Structure Diagram** in order |
| 46 | +to model the first subsystem of your multi-model. For that, in the Modelio |
| 47 | +model browser, right click on a _Package_ element then in the _INTO-CPS_ |
| 48 | +entry, choose _Architecture Structure Diagram_ as shown in Figure 31. Once |
| 49 | +you are sure that the modules have been correctly installed. You are able to |
| 50 | +start your INTO-CPS SysML modelling. |
| 51 | + |
| 52 | + |
| 53 | +Figure 31: Creating an Architecture Structure diagram. |
| 54 | + |
| 55 | +## Architecture Structure Diagram |
| 56 | + |
| 57 | +INTO-CPS SysML modelling activitIES can be succinctly described as the creation and population of INTO-CPS SysML diagrams. |
| 58 | + |
| 59 | +The Architecture Structure Diagram (ASD) specialises SysML block definition diagrams (BDDs) to support the specification of a multi-model architecture described in terms of a systems components, which will be represented by FMUs. Figure 31 shows you how to create an Architecture Structure Diagram. |
| 60 | + |
| 61 | +Figure 32 represents an example of an Architecture Structure Diagram. Besides creating an Architecture Structure Diagram from scratch and specifying by hand the blocks of your system, the INTO-CPS extension allows the user to create a block from an existing _modelDescription.xml_ file. A _modelDescription.xml_ file is an artifact defined in the FMI standard which specifies, in XML format, the public interface of an FMU. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +Figure 32: Example Architecture Structure diagram. |
| 66 | + |
| 67 | +To import a _modelDescription.xml_ file: |
| 68 | +1. Right click in the Modelio model browser on a Package element, then in the INTO-CPS entry choose Import Model description, as shown in Figure 33. |
| 69 | +2. Select the desired modelDescription.xml file (or the .fmu file that should contain a modelDescription.xml file ) in your installation and click on Import (Figure 34). |
| 70 | + |
| 71 | + |
| 72 | +Figure 33: Importing an existing model description. |
| 73 | + |
| 74 | + |
| 75 | +Figure 34: Model description selection. |
| 76 | + |
| 77 | +This import command creates an Architecture Structure Diagram describing |
| 78 | +the interface of an INTO-CPS block corresponding to the _modelDescription.xml_ file imported, cf. Figure 35. |
| 79 | + |
| 80 | + |
| 81 | +Figure 35: Result of model description import. |
| 82 | + |
| 83 | + |
| 84 | +## Connection diagram |
| 85 | +The SysML Connection diagram defines the components of the system and their connections. The internals of these block instances are created in the various modeling tools and exported as FMUs. The modeling tools Overture, 20-sim and OpenModelica support importing the interface definition (ports) of the blocks in the Connection diagram by importing a (FMI) _modelDescription.xml_ file containing the block name and its interface definition. |
| 86 | + |
| 87 | +Once you have created several SysML blocks , either from scratch or by importing _modelDescription.xml_ files, you must eventually connect instances of them in an INTO-CPS Connection Diagram. To create an INTO-CPS Connection diagram, as for an INTO-CPS Architecture Structure Diagram, right click on a _Package_ element, then in the INTO-CPS entry choose _Connection Diagram_, as shown in Figure 36. |
| 88 | + |
| 89 | + |
| 90 | +Figure 36: Creating a Connection diagram. |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +Figure 37 shows the result of creating such a diagram. |
| 96 | + |
| 97 | + |
| 98 | +Figure 37: Unpopulated Connection diagram. |
| 99 | + |
| 100 | +Once you have created all desired block instances and their ports by using the dedicated command in |
| 101 | +the Connection Diagram palette, you will be able to model their connections |
| 102 | +by using the connector creation command (Figure 38). |
| 103 | + |
| 104 | + |
| 105 | +Figure 38: Populated Connection diagram. |
| 106 | + |
| 107 | + |
| 108 | +At this point your blocks have been defined and the connections have been set. The next step is |
| 109 | +to simulate your multi-model using the INTO-CPS Application. For that you |
| 110 | +must first generate a configuration file from your Connection diagram. Select |
| 111 | +the top element in the desired Connection diagram, right click on it and in |
| 112 | +the INTO-CPS entry choose Generate configuration, as shown in Figure 39. |
| 113 | + |
| 114 | +In the final step, choose a relevant block instance defining the interconnections of simulators and click on Generate. This will create a configuraiton json file for Maestro engine. |
| 115 | + |
| 116 | + |
| 117 | +Figure 39: Generating a configuration file. |
| 118 | + |
| 119 | +## Exporting FMI modelDescription.xml |
| 120 | + |
| 121 | +Once you finished modelling the system components with Architecture Structure Diagram (ASD) you may export the SysML block as _modelDescription.xml_ for FMU packaging. |
| 122 | + |
| 123 | +Follow these steps to export a modelDescription.xml file from Modelio: |
| 124 | +1. In Modelio, right-click on the model block in the tree. |
| 125 | +2. Select INTO-CPS → Generate Model Description (see Figure 40). |
| 126 | +3. Choose a file name containing the text _modelDescription.xml_ and click Export. |
| 127 | + |
| 128 | + |
| 129 | +Figure 40: Exporting a modelDescription.xml file. |
| 130 | + |
| 131 | +# TODO: DSE Modelling |
| 132 | + |
0 commit comments