This functionality is only available for certain module packages. Info / Copyright
Configuration variables: Basics
A configuration variable is a superior variable that is referenced with a macro variable. This is done by means of a simple formula. This allows you to define manifold dependencies.
You can use formulas to calculate the following values:
- Status of a macro in a Macro-TypicalA Macro-Typical is an organization structure that contains information about the structure and the usage of the macros that are needed in the project. Each Macro-Typical maps a part of the machine / plant that is to be configured. or of a Macro-Typical in a Typical-GroupA Typical-Group is an organizational element that serves to group Macro-Typicals and other Typical-Groups. 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 BuilderThe project-specific configuration and the automatic generation of the project documentation takes place in the Project Builder on the basis of the configurators and sets of rules defined in the Designer.. 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 define references. During the generation of the project documentation the value of the reference is replaced by the value of the configuration variable.
Example
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 DesignerConfigurators and sets of rules are defined on the basis of EPLAN macros in Designer. These form the basis for the configuration and the automatic generation of the project documentation. 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 type | Meaning | Example |
---|---|---|
Integer | Integer values | 1, 2, 3 |
Double | Floating-point number | 3.456 |
StringA string is any string of characters that can consist of letters and numbers. | String | EPLAN |
Boolean | Two possible states | true or false |
The following operators can be used in the formula:
Operator | 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.