Automation Studio 4.7 -4.12 - Variable Addresses after Compilation

My name is Luciano and I’m writing from Italy.
I inherited a B&R application with an x20cp1585 CPU developed in Automation 4.7 / 4.12.
I need to know the physical address of the variables within the PLC. Unfortunately, the project makes extensive use of direct memory access (ADR String ARRAY), which isn’t always handled correctly, and bools are overwritten. Is it possible to obtain this information to simplify debugging? Thanks.

Hi,

finding the addresses can be done via ADR() like it’s already in use in the project.

The other way - finding a variable by its address, was introduced in AS6 / AR6, see B&R Online Help

Also please help me understand the title with “Automation Studio 7.7” or, if that was a mistake, please correct it :slight_smile:

Best regards

Hi Luciano,

sounds like you have a overflow problem. Either with arrays or strings (length of strings).

You can deploy the library “IecCheck” which checks such errors. Just make sure you remove the library after debugging!

In general I would recommend using “brsmemcpy()” Function to copy memory (strings, arrays or array of strings…) over brsstrcpy because it forces you to use a “length” input.

Also:

Do you have this problems during runtime, or “only” after you change something in the code and build+transfer some tasks?

best regards

Stefan

1 Like

Hi,

thank you very much for the reply.

So have you found a solution for your issue? Can you mark the reply that helped you?

Unfornutatly, was a simple error code, i have find it , but i think it’s no usefulle for anyone. It was asimple string concat, too bigger…now i will learn how to use a Iec check for the future. Thank you again