This functionality is only available for certain module packages.

You are here: Tutorial > EPLAN Electric P8 > Adding the schematic discipline to the mechatronic model > Assign formulas to parameters for DT and function texts

Assign formulas to parameters for DT and function texts

First, a new parameter is created for the function texts.

  1. In T_Mechatronic_ModularSystem, open the ECAD > Parameter unit.
  2. From the shortcut menu, select New > Parameter.

  1. In the Name field, enter the text Functiontext.
  2. In the Type field, select the String data type.

Assign to the abstract sensor the Functiontext parameter.

  1. Open the abstract_Sensor super class.
  2. Add the parameters Functiontext and DT.

The DT parameter in the abstract sensor is given as a value a formula that assembles a device tag.

  1. Open the abstract_Sensor sensor.
  2. 2. Open the Parameters editor page.

  1. Enter the following formula for the DT parameter:
='S' + ($Sensors.indexOf(origin.ifNull(this))+1)

This formula assembles the texts S1 to S10 from the letter ā€œSā€ and the position of the sensor.

  1. Enter the following formula for the Functiontext formula:
=mc.absoluteName.substring(mroot.absoluteName.size+1, mc.absoluteName.size - 1).replaceAll('\\.',' ')

The Functiontext parameter determines only part of the required function text, but does shorten the formulas that still have to be entered in the next step for the function texts of the page.

Now, enter the formulas for the function texts of the Page class.

  1. In the ECAD > Page unit, open the Page class.
  2. Open the Parameters editor page.
  3. Enter the following formulas for the parameters Functiontext1 to Functiontext8:
Name Value
Functiontext1 =if dos.size>0 then dos.at(0).$Functiontext else '' endif
Functiontext2 =if dos.size>1 then dos.at(1).$Functiontext else '' endif
Functiontext3 =if dos.size>2 then dos.at(2).$Functiontext else '' endif
Functiontext4 =if dos.size>3 then dos.at(3).$Functiontext else '' endif
Functiontext5 =if dos.size>4 then dos.at(4).$Functiontext else '' endif
Functiontext6 =if dos.size>5 then dos.at(5).$Functiontext else '' endif
Functiontext7 =if dos.size>6 then dos.at(6).$Functiontext else '' endif
Functiontext8 =if dos.size>7 then dos.at(7).$Functiontext else '' endif

These formulas determine the value (text) of the Functiontext parameter of the respective discipline-specific component.