Project Comparison
Using the 'Compare...' commands in the 'Project' menu, the project sources of the currently loaded solution can be compared with other project versions. Two comparison modes are provided:- Offline comparison: The currently loaded project can be compared with any other PLCnext Engineer project stored on your computer or a network drive.
- Online comparison: The currently loaded project can be compared with the project sources stored on the controller. For that purpose, a communication connection to the controller must be established and the project sources must have been written together with the project (using the command 'Write and start with project sources').
Referenced libraries are included in the project comparison if the related checkbox in the 'Options' dialog, category 'Compare | Settings' is marked.
For comparing two projects, it is not necessary to compile the project involved. This way, also projects can be compared which do not compile.
This topic contains the following sections:
- Finding safety-related project modifications reliably in terms of safety
- Compared project parts
- Offline comparison: Comparing the loaded project with a solution stored on your computer
- Online comparison: Comparing the loaded project with the project sources stored to the controller
- Project Comparer workspace
Finding safety-related project modifications reliably in terms of safety
This section applies if a Safety PLC is included in your application. It relates to the safety-related part of the application (code, device parameters etc.).
The results delivered by the project comparison in PLCnext Engineer must not contribute (neither directly nor indirectly) to the executable code (including data) of the safety-related application system.
For a reliable detection of modified safety-related project parts, the results of the project comparison must only be used in combination with a manual comparison of the checksums (CRCs) calculated by PLCnext Engineer. CRCs are output in the 'Safety Information' editors of the 'Project' PLANT node (only available if a Safety PLC is included) and of each safety-related user POU (COMPONENTS). These CRCs are the only valid basis for reliably detecting safety-related project modifications. To support you in finding modification details in safety-related project parts with different CRCs, PLCnext Engineer provides the project comparison tool described here.
WARNING
|
Unintended machine operation
|
- Manually compare
- the CRCs listed in the 'Safety Information' editors of the 'Project' node (PLANT) and of each safety-related user POU (COMPONENTS)
- with the CRCs in the archived project documentation of the project to be compared.
Identical CRCs indicate that the respective project part has not been modified. - Based on the results of these CRC comparisons, you can use the project comparison as described in this topic for locating the project modification details.
Compared project parts
The project comparer browses the following project items for differences:
Project part | Detected differences |
---|---|
Project structure | Added, renamed, or deleted POUs. Added, renamed, or deleted code worksheets. Modified order of code worksheets within POUs. Added/deleted libraries Controller replacement |
FBD/LD Code (also in NOLD/SNOLD worksheets)SFC Code | Any code-relevant differences and comments.What does "code-relevant" mean? Each modification that affects the resulting application code is considered as code-relevant. Besides inserting, deleting, or modifying code objects, this also includes all modifications that influence the execution order, for example, moving an entire code network. In contrast, moving single variables, LD objects, or functions/FBs to another worksheet position modifies the visible layout but does not affect the execution order on the controller. Therefore, such modifications are not considered as code-relevant and are not detected when comparing. |
ST Code | Any differences. |
Data Lists, Port Lists and variables tables | Any differences. |
Detected differences are listed in the PROJECT COMPARE window at the bottom of the comparison workspace (which opens automatically).
Offline comparison: Comparing the loaded project with a solution stored on your computer
Note
Read and observe the instructions given in section "Finding safety-related project modifications reliably in terms of safety" before comparing projects. |
- Open the project to be compared (project A) with another project (B).
- Select 'Project > Compare Projects' and choose the project to be compared (project B) with the present project (A).The comparison is then started automatically.
- The Project Comparer workspace appears displaying the results. Detected differences are listed in the PROJECT COMPARE window at the bottom of the workspace. (If the Project Comparer workspace is already open showing a previous comparison, its content is updated.)
Online comparison: Comparing the loaded project with the project sources stored to the controller
Note
Read and observe the instructions given in section "Finding safety-related project modifications reliably in terms of safety" before comparing projects. |
With this procedure, the project loaded in PLCnext Engineer is compared with the project that was last written to the controller (designated as "online project" here).
Precondition is that the project sources have been included in the download when writing the project to the controller.
Proceed as follows:
- Select the 'Connect/Disconnect' command:
This command is also available
- in the context menu of the controller in the PLANT,
- in the context menu of the controller in the ONLINE STATE window.
- Select the menu item 'Project > Compare Online Project'.
- The comparison is then started automatically.
- The Project Comparer workspace appears displaying the results. Detected differences are listed in the PROJECT COMPARE window at the bottom of the workspace. (If the Project Comparer workspace is already open showing a previous comparison, its content is updated.)
Project Comparer workspace
Note
Read and observe the instructions given in section "Finding safety-related project modifications reliably in terms of safety" before using the project comparison results. |
WARNING
|
Unintended machine operation Make certain that the results of the project comparison are only used in combination with a manual comparison of the CRCs calculated by PLCnext Engineer. |
The Project Comparer workspace opens automatically after starting the comparison. It is composed of two areas:
The PROJECT COMPARE window at the bottom lists detected differences. The differences are grouped and each group node can be expanded to view the contained details.
The toolbar contains two buttons for browsing the differences list.
Comparative code view in the upper screen area: Differing code worksheets of both projects can be viewed side by side in read-only mode. This is done by double-clicking on an entry in the differences list (PROJECT COMPARE window). Differing code-relevant objects/lines (including comments) are highlighted by colored borders and a gray background.
The comparison project (the one you have selected via dialog or the online project) is shown left. The project currently loaded in PLCnext Engineer is displayed on the right side.