A configuration variable is a superordinate variable that you can use for the calculation of specific values. This is done by means of a simple formula. You can define manifold dependencies in the formula.
Formulas can be used to calculate the following values:
- Status of a macro in a Macro-Typical or of a Macro-Typical in a Typical-Group hen the Configure option is used. Depending on the result of the calculation, the macro or the Macro-Typical is used during the generation of the project documentation in the Project Builder. You can find a corresponding example here.
- Calculation of the X and Y coordinate for absolute positioning of a macro
- Values for structure identifiers
- Values for macro variables
Configuration variables are displayed as an additional input field to the engineer in the Project Builder. Use configuration variables if you want to give the engineer the possibility to change specific values. During the generation of the project documentation the value of the reference is replaced by the value of the configuration variable.
The engineer in the Project Builder is to have the possibility to change the value of a macro variable. You have to reference this macro variable though a configuration variable to provide access to this macro variable to the engineer.
Preconditions:
- You have called the dialog Designer and are in the editing mode of a Macro-Typical.
- You have added a macro to the Macro-Typical.
- The macro contains a placeholder object with the variable page description that is assigned to the property page description.
Procedure:
- Create a configuration variable PD1 of the string type and with the page description displayed name.
- The configuration variable is displayed to the engineer in the Project Builder. Since you have specified no pre-defined values, the engineer can enter a free description.
- Enter the formula =PD1.in the extended view of the macro for the Page description macro variable.
- This means that you have referenced the configuration variable PD1 with the Page description macro variable. In the macro the "Page description" variable is assigned to the "Page description" property. This means that the value which the engineer enters for the configuration variable PD1 is used as the property "Page description of the macro" after the project documentation has been generated.
The following variable types are available:
| Variable types | Meaning | Example |
|---|---|---|
| Integer | Integer values | 1, 2, 3 |
| Double | Floating-point number | 3.456 |
| String | String | EPLAN |
| Boolean | Two possible states | true or false |
The following operators can be used in the formula:
| Operators | Meaning | Valid for | Example |
|---|---|---|---|
| +,-,*,/ | Arithmetic calculation | Integer, double | =V1*V2 |
| '...' | Literal | String | ='EPLAN' |
| + | Linking of strings | String | ='EPLAN'+'efficient engineering' |
| ==, !=, <, <=, >,>= | Comparison operators | Integer, double | =V1<=V2 |
| not, and, or, xor | Logic operators | Boolean | =(V1<=V2) and (V1>=V3) |
| &&, || | Alternative notation for logic operators and and or | Boolean | =(V1<=V2) && (V1>=V3) |
| if Condition then Value1 else Value2 endif
or Condition ? Value1 : Value2 |
Conditional values | All | =if V1==0 then V2 else V3 endif
or =V1==0?V2:V3 |
Tip:
You are supported by the software when entering a formula. As soon as you have entered the "equals" sign, all the available configuration variables and their displayed names are displayed in a drop-down list. You can activate the functionality at any time by using the shortcut key Ctrl + Spacebar. The list is filtered automatically during entry.
If predefined values exist for a configuration variable, these values are displayed as soon as you have entered the operators == or !=.
Example:
=V1== pre-defined value
or
=V1!= pre-defined value
Notes:
- Every formula must begin with an "equals" sign, for example =F206.
- You can use configuration variables in Macro-Typicals and Typical-Groups. The procedure is the same.
- The use of brackets in a formula follows the general mathematical rules. Expressions in brackets are calculated first and the result then processed further.
Read more
Managing configuration variables
Using the value set of a macro
EPLAN Help > Working with Macros > Macros > Basics > Placeholder Objects: Structure and Operation
EPLAN Help > Working with Macros > Macros > Proceed as Follows > Creating Placeholder Objects
