# Siemens string address syntax

**URL:** <https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353>\
**Category:** Ignition\
**Created:** [January 9, 2023, 1:02am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353 "2023-01-09T01:02:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael.Smith](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Michael.Smith](https://forum.inductiveautomation.com/u/Michael.Smith)\
**Post date:** [January 9, 2023, 1:02am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/1 "2023-01-09T01:02:25Z")

</div>

I am trying to get a string to display in ignition from a siemens S7-300. Pic below shows what is on the existing siemens HMI Panel:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/9/79a305f948f02b0b17927865051164dac9698854.png)

In ignition I am using  
`ns=1;s=[S7300Device]DB16,STRING80.18` which should be correct according to the documentation, but there is no data coming back to ignition, it is just blank.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/385e6929f348f807b5a8a0701a4f0ec19e6e4ae5.png)

Just wanted to confirm I wasn't missing something obvious.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 9, 2023, 2:17am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/2 "2023-01-09T02:17:42Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/e/0ea0d219a8fc4a07871cdd064e299510a9a511c3.png)  
This is from the manual, and doesn't seem to correspond to the address that you're using.

I can't test this and don't have a lot of Siemens experience, but wouldn't it be something more like:  
DB16,STRING80. ~~50~~ 18?

---

<div class="post-metadata">

**Author:** ![Michael.Smith](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Michael.Smith](https://forum.inductiveautomation.com/u/Michael.Smith)\
**Post date:** [January 9, 2023, 3:10am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/3 "2023-01-09T03:10:04Z")

</div>

The syntax from my understanding of the documentation is XSTRINGY.Z where X is the area, in this case DB16, Y is the start address, and Z is the length. So DB16,STRING80.18 should be the correct address. I am reading other tags correctly with a similar format. The data type in Step 7 is string, so not sure what is happening.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7e5ca31b7116f1592a240c1a63d4be39c35a5977.png)

Ignore the different tag name, that is just the HMI tag name that references the PLC tag.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 9, 2023, 3:12am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/5 "2023-01-09T03:12:12Z")

</div>

Yes, correct, I put .50 from the screenshot instead of changing it to your length of 18.

---

<div class="post-metadata">

**Author:** ![Michael.Smith](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@Michael.Smith](https://forum.inductiveautomation.com/u/Michael.Smith)\
**Post date:** [January 9, 2023, 3:14am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/6 "2023-01-09T03:14:21Z")

</div>

Unfortunately I can't get online with the PLC to verify if data actually exists there, but it does have an initial value specified. I am going to source the recipe names from somewhere else and just lookup the value using the recipe number instead.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [January 9, 2023, 3:39am UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/7 "2023-01-09T03:39:41Z")

</div>

If you can store the recipe as a int somewhere you can do a transform in ignition. That's assuming its perspective, I'm sure similar exists for vision.

Not sure why the string doesn't work but if you search siemens string null, your not the first one to have the same issue, something to do with the way siemens formats the string. I've personally never had a issue with strings, and you say other strings work so must be something to do with what ever value is in that string.

---

<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:** [January 9, 2023, 1:49pm UTC](https://forum.inductiveautomation.com/t/siemens-string-address-syntax/68353/8 "2023-01-09T13:49:10Z")

</div>

The Siemens string format that Ignition expects to find at offset 80 starts with two non-string bytes-max length and occupied length. The 18 bytes of actual string follow that, and Ignition will only use the "occupied" length to construct its result.

Verify that you have the correct max and actual lengths in those two leading bytes.
