Command ‘Compare’

Symbol: 6b4ab0feb656a504c0a8640e0049e575_1e69125b97ab0f97c0a8640e00690dec

Function: This command opens the Project compare dialog. In this dialog, you define which reference project CODESYS to compare with the current project, as well as what to take into consideration when comparing.

Call: Menu bar: Project ‣ Compare.

Requirement: A project is open and in online mode or offline mode.

Dialog ‘Project Compare’

The open project compared with:
Project on disk Path of the reference project on the file system.
Project in a source control database

This option is available only if the “CODESYS SourceControl” package is installed. Host: Name of the host where the source code management is located.

Port: Number of the port for connecting to the source code management.

Location: Path of the reference project.

Compare options:
Ignore Whitespace 6b4ab0feb656a504c0a8640e0049e575_9a3f06830c0506c5c0a8640e012f0ace : CODESYS ignores whitespace differences between the current project and the reference project.
Ignore Comments 6b4ab0feb656a504c0a8640e0049e575_9a3f06830c0506c5c0a8640e012f0ace : CODESYS excludes comments in the programming code from the comparison.
Ignore Properties 6b4ab0feb656a504c0a8640e0049e575_9a3f06830c0506c5c0a8640e012f0ace : CODESYS excludes object properties from the comparison.
OK Starts the project compare and displays the result in the view Project compare - Differences.

View ‘Project Compare’ - ‘Differences’

This view opens when the comparison has been completed between the current project and a reference project. The Project ‣ Compare command was executed, the reference project given, and the compare options configured.

The view shows the device tree and POUs tree of the compared projects (project compare view). The detected, different objects are color-coded. Depending on the object, an object-specific detailed compare view can be opened there. Objects with differences between their child objects are also identified by their own symbols.

../_images/1ce6a0c8f985ae8cc0a8640e0100df8e
(1) Object tree of the current project
(2) Object tree of the reference project
(3) Accept Block, Accept Single
(4) Compare options from 'Project Compare' dialog
    Compare statistics: added, deleted, and changed objects
Toolbar
6b4ab0feb656a504c0a8640e0049e575_84cf92a99786c94ac0a8640e00ff6b8e Changes the detailed compare view for the object selected in the tree. Alternative: Double-click the object.
6b4ab0feb656a504c0a8640e0049e575_5f12c3fa978644b7c0a8640e019d32d0 Switch back to the project compare view.
6b4ab0feb656a504c0a8640e0049e575_c039c10897868ca7c0a8640e004ac5da Selects the next bottom object in the device tree where differences were detected.
6b4ab0feb656a504c0a8640e0049e575_4b2638aa9788ae60c0a8640e005aee23 Selects the next top object in the device tree where differences were detected.
6b4ab0feb656a504c0a8640e0049e575_4b5e57689286c84ec0a8640e0153aa46 Accept Block2

The entire block (object plus all child objects) is accepted in the version for the current project as in the reference project.:sup:1 (selected for acceptance)

Repeated clicking of 6b4ab0feb656a504c0a8640e0049e575_4b5e57689286c84ec0a8640e0153aa46 Accept Block undoes the effects of its last change.

6b4ab0feb656a504c0a8640e0049e575_5403665b928694d7c0a8640e011e3988 Accept Single

The object is accepted in the version as in the reference project, for the current project.:sup:1 (selected for acceptance)

If the detailed compare view of the affected object is opened after accepting the changes, then you are prompted to accept the changes for that view as well.

6b4ab0feb656a504c0a8640e0049e575_2dfe9b609785ee29c0a8640e006ddc1c

Opens the Accept dialog.

Requirement: The properties, access rights, or contents of the objects selected in the object tree are different.

6b4ab0feb656a504c0a8640e0049e575_6812dfad9787311ec0a8640e005661f1

Switches between the default display where different units (lines, networks, elements) are displayed in red and another display: The units are displayed as recently added in the open project. In the reference project, they are displayed as deleted.

Available within the detailed compare view only.

Note: Depending on the display, detected differences in the statistics are counted as changed, inserted, or deleted.

Display of differences with colors, and symbols
Black font Objects are identical.
Display of differences with colors, and symbols
Object name with 6b4ab0feb656a504c0a8640e0049e575_cc191261616d5070c0a8640e01785d8b Child objects of the object are different
Display of differences with colors, and symbols
Gray highlight Objects are different.
Gray highlight + bold blue font Object is only in the reference project.
Gray highlight + bold green font Object is only in the open project (not in reference project).
Gray highlight + red font + 6b4ab0feb656a504c0a8640e0049e575_908f9ed89787add7c0a8640e01b3d001 Object has different properties.
Gray highlight + red font + 6b4ab0feb656a504c0a8640e0049e575_78419781ff1b583ac0a864636537549d Access rights of object and reference object are different.
Gray highlight + bold red font + 6b4ab0feb656a504c0a8640e0049e575_f2235b3297876f0cc0a8640e0092055c

Implementation of objects is different.

Double-click the line to display the object-specific compare view.

Display of differences with colors, and symbols
Yellow highlight Object for acceptance is activated.
Yellow highlight + 6b4ab0feb656a504c0a8640e0049e575_af7eef4092d59b20c0a8640e00276d6d Adding the reference object to the open project is activated.
Yellow highlight + 6b4ab0feb656a504c0a8640e0049e575_cfb9c79b92d67bb7c0a8640e0129e833 Deleting the object (in the open project) is activated.
Yellow highlight + 6b4ab0feb656a504c0a8640e0049e575_33f2985813610f10c0a864631b98445a Properties of the reference object is activated.
Yellow highlight + red font + 6b4ab0feb656a504c0a8640e0049e575_24ba2a00ff14ec75c0a8646337ad6a63 Access rights of the reference object is activated.
Gray highlight + bold red font + 6b4ab0feb656a504c0a8640e0049e575_56003c55ff75fa55c0a864636e8d0547 Implementation of the reference object is activated.

1 Accepting is possible only from the reference project to the open project.

2 A block in the project compare view consists of the selected object and its subordinate units. A block in the detailed compare view consists of the unit where the cursor is located and all corresponding units that have the same difference markers. A unit is a line, network, or element. Subsequent lines of a line are examples of corresponding units.

Compare options Defined comparison options in the Project compare dialog.
Compare statistics Number of additions, deletions, and changes in the current project, as compared to the reference project. Change means differences of an object available in both projects.
6b4ab0feb656a504c0a8640e0049e575_34c9213cff33d617c0a864632d7183f1

Closes the view and a prompt appears with the question: Do you want to save the changes that you made in the comparison view?

If you select Yes, then the yellow-highlighted objects are changed in the project and then correspond to the contents of the reference project.

Dialog ‘Accept’

Which meta data should be accepted?
Access rights 6b4ab0feb656a504c0a8640e0049e575_9a3f06830c0506c5c0a8640e012f0ace : Access rights activated for accept
Which meta data should be accepted?
Accept groups

Grouping with access rights accepted by the reference project. A group is accepted if it is present in both projects with different access rights.

Example: Group_A

Unaccepted groups (missing in a project) The group is not accepted if it is not present in one of the two projects.
Properties

6b4ab0feb656a504c0a8640e0049e575_9a3f06830c0506c5c0a8640e012f0ace : Properties activated for accept

Requirement: The properties of the reference object and object are different.

OK Settings are accepted.