In the course of the tutorial discipline components were created once through a mass import. Then formulas (for example to calculate a plug) were entered for the parameter values.
If a macro was changed, for example another parameter added and the discipline component synchronized with the changed macro, the parameter values were lost.
For this reason each discipline component is enclosed (encapsulated) in a mechatronic component. In the mechatronic component the same parameters are created and the formulas inserted as values. The parameters of the discipline components then always reference the parameters (interface parameters) of the same name of the encapsulating mechatronic components. After a synchronization you then only have to insert the references on the interface parameter again.
Creating a unit structure for mechatronic components:
The mechatronic components are to be created in a unit structure, analog to ECAD.
- Select the T_ECAD_P8 library.
- Select New > Unit in the shortcut menu.
- Enter the Mechatronic name.
- Save the unit.
- Select the Mechatronic unit.
- Repeat Steps 2 to 4 with the names Page, WiringDiagram, PLC_Inputs.
Create mechatronic components:
For each mechatronic component an encapsulating mechatronic component now has to be created.
Creating a capsule for the discipline component WiringDiagram
- Select the new Mechatronic > WiringDiagram unit.
- From the popup menu select New > Mechatronic > Function .
- Enter the M_WiringDiagram name.
- Switch to the Interfaces editor page.
- Click to open the Finder dialog.
- Click [Search].
- Select the IWiringDiagram.
- Confirm with [OK].
- Drag the WiringDiagram discipline component into the component editor.
- Select the installed discipline component WiringDiagram.
- Mark all parameters.
- Select Add interface temperature from the popup menu.
- Save the component.
A reference to the parameter of the superior component (capsule) by the same name is now entered as the value. These parameters were inserted into the capsule during the same step. The parameter values are entered at a later step.
Creating a capsule for the Page discipline components
The Page discipline component inherits the Page parameter from the abstractPage. A constellation could result due to the capsuling through which the system would not be able to differentiate between the component and the Page parameter anymore. A error would be reported and the capsule as a result could not be saved. In addition, the type of the parameter has to be switched from String to Integer.
Therefore the Page parameter first has to be renamed.
- Open the Page parameter.
- Change the name to PageNo.
- Change the type to Integer.
- Save the parameter.
Then the capsule is created.
- Select the new Mechatronic > Page unit.
- From the popup menu select New > Mechatronic > Function.
- Specify the M_SchematicPage name.
- Switch to the Interfaces editor page.
- Click to open the Finder dialog.
- Click [Search].
- Select ISchematicPage.
- Confirm with [OK].
- Drag the Page discipline component into the component editor.
- Select the installed discipline component Page.
- Mark all parameters.
- Select Add interface temperature from the popup menu.
- Save the component.
Create one capsule each for the discipline components Sensor_Inductive, Sensor_optical and Sensor_Pressure.
- Select the new Mechatronic > PLC_Inputs unit.
- From the popup menu select New > Mechatronic > Function.
- Specify the M_SchematicPage name.
- Switch to the Interfaces editor page.
- Click to open the Finder dialog.
- Click [Search].
- Select ISensorInductive and ISensor.
- Confirm with [OK].
- Drag the Sensor_Inductive discipline component into the component editor.
- Select the installed discipline component Sensor_Inductive.
- Mark all parameters.
- Select Add interface temperature from the popup menu.
- Repeat Steps 1 to 12 with the names M_Sensor_optical and M_Sensor_Pressure as well as the interfaces ISensorOptical and ISensorPressure.
- Save the component.