-

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:

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

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
  • 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.
  • Always apply the measures and regulations defined by relevant safety standards when modifying safety-related program parts or safety-related device parameters.

General procedure for a safety-related detection of project modifications

Compared project parts

The project comparer browses the following project items for differences:

Project partDetected 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 CodeAny differences.
Data Lists, Port Lists and variables tablesAny differences.

Detected differences are displayed in the Project Comparer workspace (which opens automatically), more precisely listed in the PROJECT COMPARE window at the bottom of the screen.

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.

  1. Open the project to be compared (project A) with another project (B).
  2. Select 'Project > Compare Projects' and choose the project to be compared (project B) with the present project (A).

    The comparison is then started automatically.

  3. The Project Comparer workspace appears displaying the results. Detected differences are listed in the PROJECT COMPARE window at the bottom of the workspace.

    Here, you can select detected differences to display details. See section "Project Comparer workspace" below.

  4. To end the comparison, select the menu item 'Project > End Project Compare' in the compare workspace. The workspace closes and you return to the PLCnext Engineer interface.

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:

  1. Open the controller Cockpit by double-clicking the controller icon in the PLANT.

    Make sure that the correct controller port (to which the LAN cable is connected) is set a target.

  2. Select the 'Connect/Disconnect' command in the Cockpit toolbar or from the context menu of the controller in the PLANT or in the ONLINE STATE window:

    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.

    If required, log on to the controller.

  3. Select the menu item 'Project > Compare Online Project'.

    The comparison is then started automatically.

  4. The Project Comparer workspace appears displaying the results. Detected differences are listed in the PROJECT COMPARE window at the bottom of the workspace.

    Here, you can select detected differences to display details. See section "Project Comparer workspace" below.

  5. To end the comparison, select the menu item 'Project > End Project Compare' in the compare workspace. The workspace closes and you return to the PLCnext Engineer interface.

Project Comparer workspace

The Project Comparer workspace opens automatically after starting the comparison. It is composed as follows:

(1) 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 column 'Object Location/Action' shows where a difference has been detected and what kind of action has been done.

The toolbar contains two buttons for browsing the differences list.

(2) Comparative view in the upper screen area: Differing (code) worksheets, grid content (variables tables, Data/Port Lists) or content in other editors of both projects can be viewed side by side in read-only mode. For that purpose, double-click an entry in the PROJECT COMPARE window.

Differing code-relevant objects/grid lines (including comments) are then shown marked with colors in the upper screen area. Here, the comparison project (the one you have selected via dialog or the online project) is shown right. The project currently loaded in PLCnext Engineer is displayed on the left side.

When comparing variables tables/Data or Port Lists, icons at the beginning of a table row provide information about the nature of the difference . Depending on the color of the corresponding grid row, the icons have different meanings, i.e., an icon must be considered in combination with the row color:

Icons (left | right side)Row colors (left | right side)Meaning
/ | Element has been modified (updated)
/ | Element has been added (inserted)
/ | Element has been deleted
/ | Element has been moved or alignment has been edited

(3) Left-clicking into a differing grid entry in the comparative view shows a detail view in the middle of the screen. In this grid detail view, the element from both project versions is displayed directly on top of each other. The various properties (grid columns) can be easily compared.

(4) In the COMPONENTS area, affected nodes are marked by an icon.