# String data type (Siemens)

**URL:** <https://forum.inductiveautomation.com/t/string-data-type-siemens/107351>\
**Category:** General Discussion\
**Created:** [June 12, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351 "2025-06-12T20:39:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cristhian.rivera](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cristhian.rivera](https://forum.inductiveautomation.com/u/cristhian.rivera)\
**Post date:** [June 12, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/1 "2025-06-12T20:39:47Z")

</div>

Hi, I'm having trouble getting a string tag from my S7-1200 PLC. I'm using the syntax "[PCL4\_Maquina]DB8,STRING10.0" in the OPC Item Path, but the tag is showing as BAD. What would be the correct syntax, or what am I doing wrong?

 ![Captura de pantalla 2025-06-12 153802](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/b/fb5f1fff3d88a795b6b14ddfa0696698befc50c6.jpeg)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52beebe026c328c24e31a2e623cb88c675e0c4cb.png)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [June 12, 2025, 8:49pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/2 "2025-06-12T20:49:32Z")

</div>

Try [PCL4\_Maquina]DB8,STRING10  
I also know that sometimes Siemens strings don’t contain the correct string length byte, so you have to do some tricks.

---

<div class="post-metadata">

**Author:** ![cristhian.rivera](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cristhian.rivera](https://forum.inductiveautomation.com/u/cristhian.rivera)\
**Post date:** [June 12, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/3 "2025-06-12T20:53:22Z")

</div>

I already tried that, and the tag still appears in BAD.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [June 12, 2025, 8:57pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/4 "2025-06-12T20:57:15Z")

</div>

[PCL4\_Maquina]DB8,STRING10.7  
[PCL4\_Maquina]DB8,STRING11

Try these and see what you get

---

<div class="post-metadata">

**Author:** ![cristhian.rivera](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@cristhian.rivera](https://forum.inductiveautomation.com/u/cristhian.rivera)\
**Post date:** [June 12, 2025, 9:03pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/5 "2025-06-12T21:03:14Z")

</div>

There it worked for me with the syntax [PCL4\_Maquina]DB8,STRING10.7, thank you very much.  
Can you explain why the syntax has to be written that way?

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [June 12, 2025, 9:05pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/6 "2025-06-12T21:05:40Z")

</div>

Strings are always offset by whole bytes, so it doesn’t use a bit position, in this driver, 7 is the string length

---

<div class="post-metadata">

**Author:** ![Cody\_Morgan](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@Cody\_Morgan](https://forum.inductiveautomation.com/u/Cody_Morgan)\
**Post date:** [June 13, 2025, 8:27pm UTC](https://forum.inductiveautomation.com/t/string-data-type-siemens/107351/7 "2025-06-13T20:27:59Z")

</div>

David is correct, the syntax for String is `STRING{OFFSET}.{LENGTH}`. If you don't specify the length, the driver defaults to using 210(I think) for the length. You don't have 210 bytes in this data block, so that results in an invalid request.
