# Siemens write to string

**URL:** <https://forum.inductiveautomation.com/t/siemens-write-to-string/70466>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [March 1, 2023, 10:16am UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466 "2023-03-01T10:16:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [March 1, 2023, 10:16am UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/1 "2023-03-01T10:16:18Z")

</div>

Hi all,

I have a little issue with writing strings to a Siemens S7-300.

Writing and reading int in the same DB works great. Changing the string in the plc updates the string in Ignition, but when we try to write back to the PLC nothing happens in the PLC. Ignition keeps the new value. Nothing in the logs.

writes '90-1-1' directly to the plc, ignition reads this value. Writing '91-1-1' to the tag, no change in plc, ignition keeps displaying this value until we change the string in the plc. Can this be plc related?

 ![siemens](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/314c6f3e980c5c6053b1eab91f08eb34ca16d734.png)

---

<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:** [March 1, 2023, 11:10am UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/2 "2023-03-01T11:10:09Z")

</div>

On your picture on the right side where it says **Last published value** there is a date and time as value...  
(then is the quality: Good and then the timestamp)...

It should look like mine:

 ![Screenshot_72](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/625a8f8de4ee997ccc6666c6f6f7766e255904e3.png)  
It looks like something is writing date/time instead of '91-1-1'...

Are you sure that in the DB you have defined as STRING[24]:

 ![Screenshot_73](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/f/df3c49a365633c2e709c402da1cef6d331cc0d04.png)

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [March 1, 2023, 11:23am UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/3 "2023-03-01T11:23:15Z")

</div>

Hi, thanks for the reply. I'm writing the formatted value (string) from a date picker to a tag defined as a string in both ignition and the S7.

---

<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:** [March 1, 2023, 11:42am UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/4 "2023-03-01T11:42:44Z")

</div>

How are you writing to the tag? Binding, scripting,...?  
Show us the code...

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [March 1, 2023, 12:55pm UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/5 "2023-03-01T12:55:50Z")

</div>

We tried to write directly to the tag, and by binding it to formatted date.

Is it true that we need to convert the string to bytes and add something to be able to write to the S7?

---

<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:** [March 1, 2023, 1:37pm UTC](https://forum.inductiveautomation.com/t/siemens-write-to-string/70466/6 "2023-03-01T13:37:46Z")

</div>

No, why?  
In my quick example, I also write a string directly to the tag...

 ![Screenshot_74](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5b1e62d017dff4aa2236df1c721f69b2c2bd2894.png)

 ![Screenshot_75](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dd4416a777e8a96513b54f79006b3910cc769ac3.png)
