Using the 'Project > Compare projects...' command, the project sources of two projects can be compared.
For comparing two projects, it is not necessary to previously compile the projects involved. This way, also projects can be compared which do not compile.
NOTE:
Both projects to be compared must have been edited or at least opened once with EcoStruxure Machine Expert - Safety version 2.0 or later.
This topic contains information on the following:
The project comparer browses the following project items for differences:
Project structure in the 'Logical POUs' folder: new, renamed, or deleted POUs.
Also code worksheets that have been added, renamed, or deleted in POUs are detected.
Description worksheets are not compared.
Modifications in the 'Libraries' folder (deleted/added libraries) are not considered.
Variable declarations: any differences in all variables worksheets.
Code: any code-relevant differences as well as comments in all code worksheets.
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 Safety Logic Controller. Therefore, such modifications are not considered as code-relevant and are not detected when comparing.
Safety-related device parameterization. Parameters that have been modified in the safety-related parameter editor are detected.
Detected differences are listed in the Project Comparer workspace which opens automatically.
How to compare project sources
As the EcoStruxure Machine Expert - Safety project is part of the related EcoStruxure Machine Expert project, you can select EcoStruxure Machine Expert projects for comparison. The project comparison function compares the safety-related parts contained therein. It is also possible to compare safety-related projects that have been exported from EcoStruxure Machine Expert - Safety.
Open the project to be compared with another project.
The file extension of EcoStruxure Machine Expert projects is *.project.
The file extension of safety-related exported projects is *.spa.
Select 'Project > Compare projects...' and choose the project to be compared with the present project.
You can select either a EcoStruxure Machine Expert project (see note above) or an exported safety-related project (*.spa).
The comparison is then started automatically.
If the present project has been modified but not yet saved, you are first asked to save modifications.
If you do not save these modifications, the project version saved last is compared. The modifications you made, however, are not discarded.
After starting the comparison, the Project Comparer workspace appears displaying the results. (If the Project Comparer workspace is already open showing a previous comparison, its content is updated.)
The Project Comparer workspace opens automatically after starting the comparison. It is composed of two areas (see example figure at the end of this topic).
The 'Differences' list (lower screen area) displays the detected differences in a grouped way, e.g., by worksheets, code networks, etc. Expanding and collapsing a particular group is done in the usual manner by clicking the '+' or '-' sign at the beginning of the respective entry. To expand/collapse all entries in the list, right-click into the list view and select the 'Expand all' or 'Collapse all' context menu item. Symbols beside the list entries indicate the modification type:
![]() |
Added element |
![]() |
Modified/updated element |
![]() |
Deleted element |
![]() |
Moved element |
Comparative code view (upper screen area): Differing worksheets of both projects can be viewed side by side in read-only mode. This is done by clicking on an entry in the 'Difference' list. Differing code-relevant objects (including comments) are highlighted by colored borders and a gray background.
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 Safety Logic Controller. Therefore, such modifications are not considered as code-relevant and are not detected when comparing.
Color |
Meaning |
Example |
Green |
Newly inserted objects in the project. Only visible in the left code view. |
![]() |
Blue |
Modified objects. Visible in both the left and the right code view. |
![]() |
Red |
Deleted objects. Only visible in the right code view. |
![]() |
Orange |
Network which has been moved to another worksheet position. Visible in both the left and the right code view. Observe the explanation regarding "code-relevant modifications" above. |
![]() |
Functions of the Project Comparer workspace:
Synchronized scrolling in the comparative code view.
If the 'Extras > Synchronize scrolling' menu item in the Project Comparer workspace is selected, the positions in both code worksheets are scrolled synchronously (horizontally and vertically). This allows to compare the code even in large worksheets.
If the worksheets show different code positions when selecting the menu item, they are synchronized to the same position.
Accessing and editing a particular code position: In the comparative code view, no editing is possible (read-only view). You can, however, directly jump to code worksheets of the project you opened first and edit them. The "compare project" (you selected as second project) cannot be accessed this way.
Either right-click the respective entry in the 'Differences' list and select the 'Edit source' context menu item.
Or double-click the desired code position in the left window of the comparative code view.
Printing the comparison results: The 'File' menu in the Project Comparer workspace provides menu items for printing and previewing the comparison results.
Example