Working with projects 3
3.6 Reusing project data
3.6.2 Flat copy
Flat copy
"Flat copy" will copy those objects with a parent-child relationship completely. If you want to copy a screen, then all the contained objects will be copied. With "Flat copy" the reference will simply be copied as an "open reference". A place holder object is copied, which only saves the name of the reference.
Example for a flat copy:
:LQ&&IOH[LEOH'LVSOD\
The WinCC flexible screen contains an I/O field with a tag connection. A flat copy will copy the WinCC flexible screen including the I/O field because the WinCC flexible screen and the I/O field have a parent-child relationship. Because we are dealing with a reference, only the object name of the tag is copied.
Insert objects
Objects copied into the clipboard may be inserted into another device in the same project or into a different project. If an object with the same name exists in the target project, the copied object will be saved under the same name with a consecutive number. If several objects with the same name and consecutive number exist, the next available number will then be used. Parent objects as well as child objects will be inserted. Only the object name of the reference will be inserted. If a reference of the same name with valid properties exists in the target object, the existing reference will then be connected to the copied object.
3.6 Reusing project data
Replacing objects
Existing objects in the target project may be replaced by the copied objects in the clipboard.
The complete contents of the copied objects will be compared with the contents of the existing objects in the target project, when flat copying. Existing objects with the same name will be replaced. Containing child objects will also be replaced. References are not copied during flat copy. Only the object name of the reference will be inserted. If a reference of the same name with valid properties exists in the target object, the existing reference will then be connected to the copied object.
3.6.3 Copy
Menu command "Copy"
Using the menu command "Copy" you are creating an extensive copy of an object.
With an extensive copy, the references as well as the objects with a parent-child relationship will be copied.
Example of a flat copy:
:LQ&&IOH[LEOH'LVSOD\
The WinCC flexible screen contains an I/O field with a tag attach. When copying using the menu command "Copy", the screen, the I/O field and the tag including its properties will be copied.
3.6 Reusing project data
Insert objects
Objects copied into the clipboard may be inserted into another device in the same project or into a different project. If an object with the same name exists in the target project, the copied object will be saved under the same name with a consecutive number. If several objects with the same name and consecutive number exist, the next available number will then be used. Parent objects, child objects and references will be inserted. If the copy contains references, the system will compare these references with existing references in the target object. If the existing references have suitable features, they will be connected to the inserted objects. If a reference is not suitable, the copied reference will then be inserted.
Replacing objects
Existing objects in the target project may be replaced by the copied objects in the clipboard.
When doing an extensive copy, the complete contents of the copied objects will be
compared with the contents of the existing objects in the target project. Existing objects with the same name will be replaced. Containing child objects will also be replaced. If the copy contains references, the system will compare these references with existing references in the target object. A dialog opens by determining which existing references need to be replaced. In the dialog select the type of references which need to be replaced
3.6.4 Replace
Application
You can use the "Replace" command in WinCC flexible to integrate new or updated objects into your WinCC flexible project, for example, objects of a ProAgent project.
With the "Replace" command, objects are accepted or updated from other projects.
The objects can be activated without resolving the project structure.
Objects can be individual objects, e.g. screens, or the complete configuration of an HMI device.
Process
Using the menu command "Copy" you are creating an extensive copy of an object. During copying, both the references as well as the objects with a parent-child relationship are copied. In order to insert the copy, use the "Replace" menu command.
The object names are checked to see if an object of the same name already exists in the target project. Existing objects with the same name will be replaced. The child objects contained will also be replaced. The recipe in the target project has 50 entries and the recipe in the source project has 500 entries. If you replace the recipe in the target project, the entries that are not in the target object are set up. In the case of entries that already exist in the target project, the settings are replaced by the settings of the source project.
If the copy contains references, the system will compare these references with existing references in the target object. Via a dialog box you can establish which references you want to replace.
3.6 Reusing project data
Source project
The tag VAR2 is of a BYTE data type and references the FKTX function.
Target project
The tag VAR1 has a limit tag VAR2 of WORD data type. The limit tag references the three functions FKT1, FKT2 and FKT3.
Result
The limit tag VAR2 is replaced by the VAR2 tag from the source project. The references in the target project are not changed by the replacement. The missing FKTX reference is added to the target project. The reference tag VAR5 from the inserted object is also inserted in the target project.
Note
If you insert objects by replacing them, note the following:
• The number of object instances you can insert depends on the HMI device
• If the target project has less of a function scope than the source project, not all objects will necessarily be accepted
• If you replace the entire configuration of an HMI device, the process can no longer be reversed You can however reverse the replacement of individual objects
• If errors occur when replacing in the target project, these are reported when the project is generated
• The "Copy" and "Replace" menu commands cannot be used to replace faceplates and their instances. Refer to the "Copying faceplates" for more information
3.6 Reusing project data