This functionality is only available for certain module packages.

You are here: Tutorial > EPLAN Electric P8 > Create EPLAN Electric P8 components > Create EPLAN Electric P8 discipline components > Import EPLAN Electric P8 macros

Import EPLAN Electric P8 macros

Create in the T_Mechatronic_ModularSystem library the ECAD unit, and in it, the WiringDiagram subunit:

  1. Select the T_Mechatronic_ModularSystem library.
  2. Select New > Unit in the shortcut menu.

  1. In the Name field, enter the text ECAD.
  2. Select the ECAD unit.
  3. Repeat steps 2 to 3. Enter the unit name WiringDiagram in the process.

The unit structure should then look like this:

In the WiringDiagram unit, insert a schematic component:

  1. Select the WiringDiagram unit.
  2. Select New > ECAD > WiringDiagram from the shortcut menu.
  3. In the Name field, enter the text WiringDiagram.
  4. In the Resource location panel, click Import.
  5. Highlight the Template_Project.zw1 file.
  6. Confirm with Open.

In this process, the Parameter unit was created in addition. This contains the parameters Location, PageNumber, Plant, Report, Script, ScriptArguments, and SubPageNumber. The names of the parameters can be set under Model > Model Variables. This way it is possible to define the structure identifiers in P8 in the EEC.

Launch the mass import of macros:

  1. Select the ECAD unit.
  2. Select Create Model from Resources from the popup menu.

The Create Model from Resources wizard opens.

  1. Enter the path for the sources in the Source field:
<EEC installation folder>\resources\Tutorial\P8
  1. Confirm via [Next >].

In the next wizard window, the macro files are listed, among other things:

  1. Deselect all objects that do not reference macros.
  2. For the /Page/page.ema macro, select the Page class.
  3. Accept the new class with [Set].
  4. Press [Finish] to confirm.

Due to the mass import, the units Page and PLC_Inputs have been created, and they contain the macros. The parameters have been adopted from the macros, and inserted in the Parameters unit:

Specify an abstract page as super class.

  1. Select the Page unit.
  2. Select New > ECAD > Page.
  3. In the Name field, enter the text abstract_Page.
  4. Select the Abstract check box.
  5. Open the Parameters editor page.
  6. Insert the parameters Plant, Location, PageDescription and PageNumber.

The parameters can be inserted easily in the editor via Drag & Drop. To do so, highlight the parameters (1.) and drag them to the editor (2.). The parameters are then sorted exclusively in alphabetical order in the editor. The sequence can be changed via the arrows Move up and Move down.

Assign to the Page page the abstract_page super class.

  1. Double-click and open the Page page.
  2. In the Super class field, select the abstract_Page class.

Check the number of parameters. The structure parameters of the abstract_Page super class must be included, as well as the parameters for the function texts and sockets of the macro file.

Name Standardized Type Declared in
Input1 false Socket Page
Input2 false Socket Page
Input3 false Socket Page
Input4 false Socket Page
Input5 false Socket Page
Input6 false Socket Page
Input7 false Socket Page
Input8 false Socket Page
Functiontext1 false String Page
Functiontext2 false String Page
Functiontext3 false String Page
Functiontext4 false String Page
Functiontext5 false String Page
Functiontext6 false String Page
Functiontext7 false String Page
Functiontext8 false String Page
Plant false String abstractPage
Location false String abstractPage
PageDescription false String abstractPage
PageNumber false String abstractPage

Each sensor has the parameters DT and IP, as seen in the example in the following figure for Sensor_Pressure.