# S7-1200 Driver error optimizing read items

**URL:** <https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507>\
**Category:** Ignition\
**Created:** [February 17, 2021, 10:34am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507 "2021-02-17T10:34:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 17, 2021, 10:34am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/1 "2021-02-17T10:34:50Z")

</div>

Hi All

I am using edge 8.0.16 with S7-1200 driver.

I have several int,bool and string tags, all of them are able to read/write successfully.  
However, when i start to add another string address with the format:  
[PLCNAME]DB100,STRING16.254  
All the current tags have their quality changed from good to bad. And this newly added tag is having bad quality as well. I tried to force a string value to the PLC from the tag provider, and surprisingly it is able to write to the plc, even though the quality is bad.

I tried to create/duplicate an entire new set of DB address, which includes STRING16.254, i.e:  
[PLCNAME]DB101,STRING16.254  
And this time round, all the tags’ quality are showing good, including the newly added string tag.

I am confused why using DB100 is creating the error, and DB101 is not?  
i have tried [PLCNAME]DB100,STRING272.254 as well, and it is working… It seems that [PLCNAME]DB100,STRING16 itself is having problem?

Below is the error log:

 ![s1200 error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3eb1cf72d3f73e5328a0f10e661136984e1da758.png)

---

<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:** [February 17, 2021, 1:40pm UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/2 "2021-02-17T13:40:53Z")

</div>

IIRC, Siemens string types use the first two bytes in memory to report the max size of the string and the actual length of the string (respectively), and the following bytes are the real character data. Make sure those first two bytes are correct.

---

<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:** [February 17, 2021, 1:56pm UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/3 "2021-02-17T13:56:35Z")

</div>

Can you get a list of _all_ the tags from DB100 you have created in Ignition?

---

<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:** [February 17, 2021, 2:55pm UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/4 "2021-02-17T14:55:15Z")

</div>

Show us the DB structure from PLC also…

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 18, 2021, 4:39am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/5 "2021-02-18T04:39:01Z")

</div>

Hi All  
Below are the DB structure screenshots

 ![DB100_1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4ac547c1cf0720b1b266f2978b65299b7fbf8884.png)  
 ![DB100_2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/5/451fd0317644db95cc8146896d69629a23038a09.png)  
 ![DB100_3](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c0303baabefd288f115afaffdc1870d83af28fe6.png)  
 ![DB100_4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bd1792a6bde79013f3f7f910b4d0c4adc4722dde.png)

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 19, 2021, 2:05am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/6 "2021-02-19T02:05:38Z")

</div>

Hi Phil  
But the thing i do not understand is that, why using of DB100 is having error, and after replicating the entire tag structure to DB101, the tags are fine…

---

<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:** [February 19, 2021, 2:43am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/7 "2021-02-19T02:43:07Z")

</div>

Do you have code that is stomping on `DB100,B16` or `,B17` ? Have you checked the values in those two bytes?

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [February 19, 2021, 11:26am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/8 "2021-02-19T11:26:00Z")

</div>

> [@yin.cheng](#):
>
> But the thing i do not understand is that, why using of DB100 is having error, and after replicating the entire tag structure to DB101, the tags are fine…

Kevin asked you already: what other tags are acceessing DB100? If you address a second tag, at e.g. DW1000, the driver might try to read the complete block. That block is longer than 226 bytes, the error you posted in your first message.  
A little side node: If this is a S7-1x00 it is not recommend to switch off optimization for such a long data block.

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 22, 2021, 6:04am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/9 "2021-02-22T06:04:47Z")

</div>

Hi Phil, there is nothing on `DB100,B16` or `,B17`…  
I have uploaded screenshots of my DB structure previously, please kindly have a look, you can see that it is from 14 to 16 and then 272…

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 22, 2021, 6:13am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/10 "2021-02-22T06:13:43Z")

</div>

Hi Chi, i have uploaded screenshots of my DB structure previously, please kindly have a look.  
This DB structure was developed by my colleague and i have checked with him… There is no tag ‘‘overlapping’’ or part of the tag is being used elsewhere

In fact, i have another configuration whereby i am using S7-1500, and i have similar issue when i try to connect to DB37,x0.0 etc. (from offset 0-2)

Just not sure what am i missing out…

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [February 22, 2021, 7:24am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/11 "2021-02-22T07:24:48Z")

</div>

Check if there are any other tags for that device configured in Ignition. If you are unsure, open the ‘Tag search’ Dialog in the tag editor and search for your device name.

---

<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:** [February 22, 2021, 1:28pm UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/12 "2021-02-22T13:28:43Z")

</div>

You didn’t answer my question. _Read the live values_ of `DB100,B16` and `DB100,B17` (as bytes, that is) to see if they conform to the rules for the String datatype.

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 23, 2021, 8:52am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/13 "2021-02-23T08:52:55Z")

</div>

Hi Chi

I have attached the list of tags using DB100 from the ‘Tag search’, please kindly have a look.  
Btw i realised after changing from [PLCNAME]DB100,STRING16.254 to [PLCNAME]DB100,STRING16.204 (starts to have error from 205 onwards), the tag communications are fine.

 ![list of tags](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3ec129f424c83c1569057e10436b0101d2b04628.png)

---

<div class="post-metadata">

**Author:** ![yin.cheng](https://avatars.discourse-cdn.com/v4/letter/y/85f322/32.png) [@yin.cheng](https://forum.inductiveautomation.com/u/yin.cheng)\
**Post date:** [February 23, 2021, 8:58am UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/14 "2021-02-23T08:58:46Z")

</div>

Hi Phil  
I have attached the screenshot of DB100,B16 & DB100,B17  
I realised after changing from [PLC]DB100,STRING16.254 to [PLCNAME]DB100,STRING16.204 (starts to have error from 205 onwards), the tag communications are fine.

I am not that familiar with programming, but B16 is showing the length of the string, and B17 would be the total number of characters?

 ![B1617](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23368f0f9cea94dc8afba8c7b5e57300213c5ab3.png)

---

<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:** [February 23, 2021, 1:18pm UTC](https://forum.inductiveautomation.com/t/s7-1200-driver-error-optimizing-read-items/43507/15 "2021-02-23T13:18:44Z")

</div>

> [@yin.cheng](#):
>
> B16 is showing the length of the string, and B17 would be the total number of characters?

Yes. The length possible in the first byte, and the length currently present in the second byte. Ignition will have trouble if the "nnn" in `DBaaa,STRINGbbb.nnn` doesn't match the byte at `DBaaa,Bbbb`.
