Technical data
Creating Blocks and Libraries
9.3 Creating Blocks
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 231
9.3.5 Comparing Blocks
Introduction
To compare blocks that are in different locations, you can start the block comparison process in
either of the following ways:
• Go to the SIMATIC Manager and select the Options > Compare Blocks menu command. In
the "Compare Blocks - Results" dialog box that is displayed, click the "Go to" button. The
results of the comparison will appear in the program editor (LAD/FBD/STL) in the "Comparison"
tab
• Go to the program editor. Select the Options > Compare On-/Offline Partners menu
command.
The following sections explain how the block-comparison process functions. In the following
discussion, a distinction is maintained between logic blocks (OBs, FBs, FCs) and data blocks
(DBs).
The effect of the "Including SDBs" option during an ONLINE/offline comparison of blocks in the
SIMATIC Manager is described in the section: Comparing System Data Blocks (SDBs)
How Block Comparison Works: Logic Blocks
In the first step of the process, STEP 7 compares the time stamps for the interfaces of the logic
blocks to be compared. If these time stamps are identical, STEP 7 assumes that the interfaces are
identical.
If the time stamps are different, STEP 7 then compares the data types in the interfaces
step-by-step by section. When a difference is found, STEP 7 determines the first difference in a
section; that is, in each case the first difference in the respective declaration ranges.
Multi-instances and UDTs are also included in the comparison. If the data types in the sections are
the same, STEP 7 then compares the initial values of the variables. All differences are displayed.
In the second step, STEP 7 checks the code by network by network (in case the "Execute code
comparison" option was not selected, the code will still be compared if the "Go to" button in the
Program Editor is clicked.).
First, the inserted or deleted networks are detected. The results of the comparison will show
networks that are only present in one block. These will have the comment "only in".
Then, the remaining networks are compared until the first difference in statements is found.
Statements are compared in the following manner:
• For the setting "Absolute address has priority", based on the absolute address
• For the setting "Symbol has priority", based on the symbol
Note: If the blocks have symbolic priority and therefore also need to be compared in terms of
symbols, the "Perform detailed comparison" option should be enabled.
Statements are considered to identical if their operators and addresses are the same.
If the blocks to be compared were programmed in different programming languages, STEP 7
performs the comparison based on the STL language.
Special feature of offline-offline comparisons: