This functionality is only available for certain module packages. Info / Copyright
Working with instances
The usage of instances allows you to define the functions of your product, which may occur several times, within one Typical-GroupA Typical-Group is an organizational element that serves to group Macro-Typicals and other Typical-Groups.. At the definition of Typical-Groups you have the possibility to allow the generation of several instances of an element of the Typical-Group. The designer in 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. then has the possibility to flexibly extend the functional scope of your product.
Additional, internal variables are available in the formulas for controlling the behavior of the instances. Use these variables to specifically define rules for the behavior of single instances (see example).
Internal variables | Type | Meaning |
---|---|---|
_index_ | Integer | Contains the index of the current instance. The value of the variable for the first instance is 1, for the second instance 2, etc. |
_count_ | Integer | Contains the number of all instances. If three instances are generated in the Project Builder, the value of the variable is 3. |
_first_ | Boolean | Contains the value 'true' for the first instance. Contains the value 'false' for all other instances. |
_last_ | Boolean | Contains the value 'true' for the last instance. Contains the value 'false' for all other instances. |
_even_ | Boolean | Contains the value 'true' for all instances with an even index. Contains the value 'false' for all other instances. |
_odd_ | Boolean | Contains the value 'true' for all instances with an odd index. Contains the value 'false' for all other instances. |
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 Typical-Group.
- The element for which you want to allow multiple instances already exists.
Procedure
- Drag&Drop the element for which you want to allow several instances onto the desired position in the workspace.
- Click the element in the workspace.
- The view is extended with the structure and variable information that exists in the element.
- Activate the Allow instances check box.
- Two new buttons appear. The Infinite button is active. The designer in Project Builder can generate any number of instances of the element.
- Click the Configure button, if you want to limit the number of instances.
- A new input box appears.
- In the input box enter the maximum number of instances the designer may generate in the Project Builder.
- Use the internal variables to reference the configuration variables of the element.
- By using the internal variables you define specific rules for the behavior of single instances (see example).
Example
Requirements
In a configurator the flexible equipment of a PLC rack is realized. In the basic configuration the rack is only equipped with one interface module. In addition it is to be possible to place supply modules and digital inputs and outputs.
- The type of the supplementary modules can be configured freely.
- Seven slots are available on which supplementary modules can be placed.
- The modules are placed on the rack directly next to each other.
Which elements are needed for this?
- Four macros are required: Interface module, supply module, digital input card and digital output card.
- Two Macro-Typicals are required: The 'Basic' 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. contains the interface module that is always used. The 'Module' Macro-Typical contains the three macros for the supply module and digital input card and digital output card. All the macros are placed on the same schematic page.
- One Typical-Group 'Rack' is required: It contains the two Macro-Typicals 'Basic' and 'Modules'.
- A configurator 'Machine A' is required: It contains the Typical-Group 'Rack'.
How can the requirements be realized in Designer with these elements?
- To make the type of the supplementary modules freely configurable, the 'Modules' Macro-Typical has to be adapted. To do this the configuration variable 'Module type' of the StringA string is any string of characters that can consist of letters and numbers. type is created. It contains the predefined values 'Supply module', 'Digital input card' and 'Digital output card', from which the designer can select in Project Builder. The status of the three macros is referenced with the configuration variable 'Module type.' The following formula is used for the supply module: =Module type=='Supply module'. The formulas have to be adapted accordingly for the other two module types. This way the macros are only used during the generation of the schematic if the designer has selected the appropriate value in the Project Builder.
- To be able to place seven supplementary modules, seven instances of the Macro-Typical 'Module' are required. To do this the 'Rack' Typical-Group has to be adapted. The generation of a maximum of seven instances is allowed for the 'Modules' element in the Typical-Group rack. This way the designer can configure in Project Builder how many modules are to be generated. For each newly generated module, they can also specify the module type (see Requirement 1.).
- To achieve that the modules are placed next to each other instead of on top of each other, the position of the macros in the 'Modules' Macro-Typical needs to be adapted. To do this the configuration variable 'Slot position' of the Integer type needs to be created. The position of three macros is defined as Absolute and is referenced with the 'Slot position' configuration variable A fixed value is defined for the Y coordinate. The following formula is used for the X coordinate of all macros: =60 + (Slot position * 15). Every module is 15 mm wide. The width of a module is multiplied by the slot position. The result is added to the X coordinate 60.
- In addition the Typical-Group 'Rack' is adapted. The configuration variable 'Slot position' from the Macro-Typical 'Module' is referenced in the Typical-Group 'Rack' with the internal variable
'_index_' . This way the index of the generated instance is automatically used as the slot position. A lateral displacement that depends solely on the slot position of the module then results for the individual instances. Thus the fourth instance is placed on the X coordinate 60 + (4*15) = 120.