# Siemens DB String to Ignition Tag. Strange behaviour

**URL:** <https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 12, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257 "2023-07-12T14:19:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [July 12, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/1 "2023-07-12T14:19:13Z")

</div>

Hey all,  
I'm trying to add a few tags over from a Siemens S7-1212 PLC.

I've tried to add a few tags from a DB. But have not successfully gotten it to work as I'm having some strange behaviour. This string tag is part of a UDT in the PLC.

In the PLC, it is under DB100, where the offset is 16.0 and the next items offset in the DB is 272.0, hence I assume my length of string is 256, I've also replicated the issue using 210 which the documentation suggests is the max size/

When I put the Item path as

```auto
ns=1;s=[Master 1]DB100,STRING16.0.256

```

The tag comes back as error configuration,  
but when I put

```auto
ns=1;s=[Master 1]DB100,STRING16.256

```

All of the other tags, that were fine, in the UDT suddenly go bad quality.

Am I missing something? And why does this effect the reading of my other tags?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 12, 2023, 2:55pm UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/2 "2023-07-12T14:55:18Z")

</div>

Siemens strings have two extra bytes in the PLC, at the first two byte offsets, containing the max and current allowed length. You have to account for that in your offsets, and those values must be correct (in the PLC).

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [July 12, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/3 "2023-07-12T16:44:22Z")

</div>

Ah right, in that case if the offset in my DB says 16, in my ignition I should set this offset as STRING18? And work out it's length based on that

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 12, 2023, 4:48pm UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/4 "2023-07-12T16:48:34Z")

</div>

No, still @16, but the length for Ignition is two less than the delta to the next object in the DB. (The first actual character is @18.) Consider reading those two bytes separately (as unsigned bytes) to see if they are correct.

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [July 13, 2023, 7:06am UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/5 "2023-07-13T07:06:53Z")

</div>

I've tried to get this working, I can read the first two bytes using integer OPC Tags where the path is

```auto
ns=1;s=[Master 1]DB100,B16

```

and

```auto
ns=1;s=[AGV 1 Master]DB100,B17

```

these return the values 254, and the live length of my string respectively.

When I set my string to:

```auto
ns=1;s=[Master 1]DB100,STRING16.254

```

All of my other tags go bad quality  
or if I set to

```auto
ns=1;s=[Master 1]DB100,STRING16.0.254

```

I get an error configuration, but the other tags are okay.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [July 13, 2023, 7:16am UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/6 "2023-07-13T07:16:56Z")

</div>

> [@Hayden\_Watson](#):
>
> When I set my string to:
> 
> ```auto
> ns=1;s=[Master 1]DB100,STRING16.254
> 
> ```

This **IS** the correct addressing format, but the length (254) is too big...  
Try with a length of 210 or less...

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [July 13, 2023, 7:24am UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/7 "2023-07-13T07:24:45Z")

</div>

Ah right, so in my PLC ladder I'll need to specify my string as the datatype String[210]

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [July 13, 2023, 7:32am UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/8 "2023-07-13T07:32:31Z")

</div>

I changed my String in the PLC to String[200].

Then set the binding, to ns=1;s=[Master 1]DB100,STRING16.198

Needed to change the default string length in my PLC and then remove the two meta data bytes from the length of the string.

Thanks for the help!!!

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [July 13, 2023, 7:34am UTC](https://forum.inductiveautomation.com/t/siemens-db-string-to-ignition-tag-strange-behaviour/76257/9 "2023-07-13T07:34:20Z")

</div>

I would first just try to read from the Ignition string with 210 or less, then when you find how much you can max read, you can change it in PLC...
