# Finding difference in Datastructures

**URL:** <https://community.br-automation.com/t/finding-difference-in-datastructures/7498>\
**Category:** Programming\
**Tags:** structured-text\
**Created:** [July 4, 2025, 6:06am UTC](https://community.br-automation.com/t/finding-difference-in-datastructures/7498 "2025-07-04T06:06:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Niklas\_Richter](https://avatars.discourse-cdn.com/v4/letter/n/FF8800/32.png) [@Niklas\_Richter](https://community.br-automation.com/u/Niklas_Richter)\
**Post date:** [July 4, 2025, 6:06am UTC](https://community.br-automation.com/t/finding-difference-in-datastructures/7498/1 "2025-07-04T06:06:28Z")

</div>

Hello,

i wan’t to check a data-structure for any difference.

Let’s say i have two variable of the same datatype

**Variable 1:**  
dummyStructure1.test1 := 2;  
dummyStructure1.test2 := 3;  
dummyStructure1.test3 := 4;

**Variable 2:**  
dummyStructure2.test1 := 2;  
dummyStructure2.test2 := 3;  
dummyStructure2.test3 := 5;

Now i want to check if there is a difference in the structure. For that i could use _memcmp()_. But i would like to find either the starting addess of the variable that is different or (ideally) the name of the variable that is different.

So in this case i would like to find the address of the variable _dummyStructure1.test3_.  
I recently saw a function with which you can read the name of a variable at a specific address. Unfortunately I have forgotten the name of the function, but it would be ideal here if you could also use it to return the name “_dummyStructure1.test3_”.

Does anyone have any idea whether it is possible to find the differences in a data structure in this way or does anyone have any other ideas?

---

<div class="post-metadata">

**Author:** ![corne.geerts](https://avatars.discourse-cdn.com/v4/letter/c/FF8800/32.png) [@corne.geerts](https://community.br-automation.com/u/corne.geerts)\
**Post date:** [July 4, 2025, 6:22am UTC](https://community.br-automation.com/t/finding-difference-in-datastructures/7498/2 "2025-07-04T06:22:23Z")

</div>

A structure has also a default alignment so there could be dummy bytes inserted depending on the datatype.

You can use the functions PV\_ninfo(), PV\_item() and PV\_xgetadr(). In AS6\AR6 you could also use PV\_lkaddr() to get the string name of PV variable.
