First, a new parameter is created for the function texts.
- In T_Mechatronic_ModularSystem, open the ECAD > Parameter unit.
- From the shortcut menu, select New > Parameter.
- In the Name field, enter the text Functiontext.
- In the Type field, select the String data type.
Assign to the abstract sensor the Functiontext parameter.
- Open the abstract_Sensor super class.
- 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.
- Open the abstract_Sensor sensor.
- 2. Open the Parameters editor page.
- 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.
- 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.
- In the ECAD > Page unit, open the Page class.
- Open the Parameters editor page.
- 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.