# Siemens Driver giving me the wrong string

**URL:** <https://forum.inductiveautomation.com/t/siemens-driver-giving-me-the-wrong-string/90449>\
**Category:** Ignition\
**Tags:** siemens, perspective, scripting\
**Created:** [May 15, 2024, 4:19pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-giving-me-the-wrong-string/90449 "2024-05-15T16:19:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julian\_Islic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/julian_islic/32/57055_2.png) [@Julian\_Islic](https://forum.inductiveautomation.com/u/Julian_Islic)\
**Post date:** [May 15, 2024, 4:19pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-giving-me-the-wrong-string/90449/1 "2024-05-15T16:19:51Z")

</div>

I need help! The system.opc.read is giving me unreliable results.  
I am trying to pull an array of characters from the PLC.

Here is the siemens datablock: (the highlighted row is wrong, its the one above it)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/5/b501fb04f66e961e226640e084300539d91c4e1e.jpeg)

I am trying to get an array of characters from the PLC in this command:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/346a61a1ac0d2122f44049920238cf8e0827daaa.png)

Here is that sub function:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fc7bb35873e2b87db35efde658a45e2d4b865661.png)

When I pass the box 4 times, I get the following messages. The green is the correct shipping label and the red messed up shipping label.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8ce52e8e726b883567cd2f48fc4a22c2b3135f60.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4d1aebb96157e9343a5fbc9b1ef0d753c66a5e6c.png)

I have tried so many methods to pull this string( you can see some of the commented out methods) I am sure that my datablock and offsets are set correctly and I confirmed that the PLC is getting the correct string. The only thing is that the system.opc.readValue is not consistently returning the same value.

I even tried adding sleep functions in various places hoping it was some asynchronous read issue, but it doesn't seem to make a difference.

At this point, I want to blame the Siemens Driver, but I figured that I would at the very least post in the forum to see if someone else can catch something I am missing.

Are there any known issues with the siemens driver that may produce unreliable reads?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 15, 2024, 4:27pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-giving-me-the-wrong-string/90449/2 "2024-05-15T16:27:05Z")

</div>

Add a statement that prints `tag_paths` right before you call `system.opc.readValues` and see if you're actually reading the expected address each time.

---

<div class="post-metadata">

**Author:** ![Julian\_Islic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/julian_islic/32/57055_2.png) [@Julian\_Islic](https://forum.inductiveautomation.com/u/Julian_Islic)\
**Post date:** [May 15, 2024, 6:37pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-giving-me-the-wrong-string/90449/3 "2024-05-15T18:37:34Z")

</div>

NEVER MIND. Turns out, something else was overwriting the tag I was looking for but only in specific offsets. This smaller write overwrote right in the middle of my tag.

Thanks for the quick support!
