Cookies are important for this site to function properly, to guarantee your safety, and to provide you with the best experience. By clicking OK, you accept all cookies. For more information, please access our Privacy Policy.
Table of Contents
Tutorials / 
PLC Troubleshooting Using Cross-Referencing and Overlapping Access in Siemens TIA Portal
Advanced

PLC Troubleshooting Using Cross-Referencing and Overlapping Access in Siemens TIA Portal

Siemens
TIA Portal
PLC Troubleshooting
S7-PLCSIM
Function Blocks

Introduction

Troubleshooting a PLC program is a skill that every PLC programmer will need to develop. However, in a large project involving many programming blocks and signals, it can be challenging to quickly identify the various call structure and monitor the different places a signal has been used in each block hence making troubleshooting difficult.

In such situations, the solution is to use the TIA Portal cross-referencing feature to identify and navigate various blocks quickly. In this tutorial, we will explore cross-referencing feature and overlapping access as a means for troubleshooting programs in Siemens TIA Portal.

Prerequisite

To follow along with this tutorial, you will need:

Setting up a new project in TIA Portal

Let us start by creating a new project

Now let us create a function that performs some mathematical calculations. First, create an FC, then under the internal tag declaration area of the FC, create the following tags.

Program the different ladder networks as shown in the images below

Compile the FC, then create a function block. Call this complex function we have built into the FB.

Next, create a data block with the following tags.

Pass the tags through the In_out of the function with the different variables as shown below

Call the function block in OB1

Compile and download into PLC-SIM

Understanding Call Structure

The call structure in your user application describes the block's call hierarchy. It gives a quick overview of the blocks in use, calls to other blocks, relationships between blocks, data required for each block, and block status.

To access the call structure of the function block we created, right-click on the function block and select call structure.

The call structure of the FB, which opens in another window, is shown below.

From the image above, the Testing Function block (FB1) is calling a complex function (FC1) in both NW1 (Network 1) and NW2 (Network 2). FB1 is also called in OB1. Understanding the call structure is a good step towards cross-referencing as it will reveal the various locations of a particular block as used in the program.

Cross referencing in Tia Portal

Cross-referencing is determining where a system variable is being used to determine the root cause of an anomaly. Inside the PLC programs, a lot of cross-referencing is done to figure out why some functions aren't running when the input signal is provided. 

Using our predefined function, we created above, create another network as shown in the image below.

Download and monitor the program. There are two different ways of navigating the cross-referencing window.

Right-click on a tag and select cross referencing. We are cross-referencing the ‘’Db_values.output_1’’ tag.

A new window opens up for cross-referencing, as seen in the image below.

This window shows that the ‘’Db_values.output_1’’ tag is found in Testing FB under Objects. All blocks where the particular tag we are interested in will be listed under the object column.

The reference location shows the area and the network number where the tag is located. From the image above, the ‘’Db_values.output_1’’ tag can be found in Testing FB, NW1 (network one), and NW3 (network three). Clicking on those reference locations will navigate you to the particular network area.

The Access shows what the particular tag state i.e. if it is written to or read from. NW1 is written to and NW3 is read-only.

The address tag shows the block number of the FB, FC, or OB. The type column shows the data type of the particular tag in question. 

The Add new source object can be used to add a new tag to be cross-referenced.

The second method to accessing cross-referencing is by selecting the cross-reference information. This opens the cross-reference windows in the same block. It is a similar window just like the first one.

Benefits of the Cross Reference 

The cross-reference list offers you the following advantages

  • You keep track of the devices and objects used in a program, such as blocks, operands, and tags, when building and altering it.
  • You can check if the object is used in conjunction with other objects or if it is utilized on its own.
  • You can use specified criteria to filter the presented cross-reference information. You can use predefined filters for source and reference objects for this purpose.
  • You can also set user-defined filters to make it easier to identify relevant references.
  • You can navigate directly to the reference location of the selected object by using the link highlighted in blue from the cross-references.
  • You are advised of the following during a software test or during troubleshooting:
  • An operand is processed in which block and by which command.
  • How and where is the tag used?
  • What is the name of the block that is called by the other block?
  • Information on subordinate and higher-level structures is cross-referenced.
  • The cross-references provide a detailed overview of all operands, memory locations, blocks, tags, screens, and other items utilized as part of the project documentation.

Overlapping access (advanced cross referencing)

Overlapping access is an advanced method for troubleshooting PLC through cross-referencing. The absolute addresses are used to determine overlapping access for tags and structured tags. If the address for a tag or structured tag is partially or totally in the address space of the associated source object, we call it "overlapping access."

Modify the program in the function block as shown below 

Include the following network in your OB1 block.

Compile and download into your simulator

We will be cross-referencing the Tag_2 signal. The check overlapping access button is highlighted below. 

The symbol by the side of the tag indicates that there is indeed an overlapping signal. The absence of that symbol indicates that there is no overlap access.

The next symbol show overlapping access will open a window that will reveal the overlap tag and reference location.

From the image above, Tag_2 overlaps with tag_3 and the reference location is in OB1, network 2. This happened because Memory bit M1 is part of the memory word MW1 so it overlaps. Overlapping mostly happens in large projects where the PLC programmer might forget the address that he has configured.

NOTE: The display of the overlapping access cannot be saved and is no longer shown after the cross-reference list is opened again

Conclusion

There are different methods and skills to employ when troubleshooting a PLC, and cross-referencing is one of them. It will come in handy, especially for large projects that have a good number of IOs and tags. We recommend that you practice the different cross-referencing methods to become proficient in them.