Diagnostics Buffer With No Issues

Sometimes, you find yourself in a position where (despite no compilation issues) your PLC will just not start correctly.

Instead of seeing the above image, with nice green ticks and no issues, you see something like this:

(Click to enlarge) – Diagnostics Buffer with issues

When the above occurs, the PLC fails to start following a download and the below message appears in the Info section of the bottom bar:

Failed to start PLC_1!

This is much more common than you think, and the issue is nearly always down to a Read Access Error. This is especially true if you are making use of Pointers, or the Any / Variant data types. It can also occur when using large UDTs

Finding The Fault

Usually, this is caused by one of the two following issues:

  1. Incorrect Pointer to an interface pin that accepts any data type
  2. Forgetting to connect an interface pin

Using the Diagnostics Buffer, you can see why the PLC didn’t start up:

Area Error in FB 1

You can get to the Diagnostics Buffer in the Online & Diagnostics view from the Project Tree.

The above image shows us that we’ve had repeated issues with FB 1.

If we highlight the issue, a message is displayed in the Details on event section below:

Read Access Error – You have used an illegal address range

The message gives many details, but the one we’re most interested in is in the Help on event. This states that we’ve used an Illegal Address Range, which is indicative of “You’ve messed a pointer up”

Now, pointers are used by TIA Portal automatically if any of the following are done:

  • An INOUT interface is used
  • A structure, or a subset of a structure is referenced
  • A UDT is referenced
  • A Pointer data type is used or constructed (P#DB6.DBX2.0 Byte 3 for example)

By clicking on the Open In Editor, you are taken to the offending block to try and find the issue.

Note
Note
Note

The Read Access Area 00 in the Description means that the error occurred on the INTERFACE of the function block in question, so actually visiting the block won’t help you.

I always select something in the Project Tree and hit F7 to bring up the “Open Block” window. You can then type in the offending block – FB1 in this case – and not only will it open the block, it snaps the Project Tree to the block too

You can then right click the block in the Project Tree and do a cross reference on where it is used / called. This will narrow down the issue much more quickly when you have hundreds of blocks in your project

This particular issue has been caused by me forgetting to attach a pointer to the relevant data:

No Pointer attached to block

Once this has been fixed, the PLC starts up correctly:

Pointer assigned and now PLC starts up correctly

Considerations

This can occur for many different reasons, and the above example is only that, an example. However, the method for working back through the diagnostics buffer is a good lesson to learn.

The diagnostic buffer is a great resource, one that you should frequent often to look for issues and to help with fault finding.


Check Out Another Post

Leave a Reply