S7-1200 Driver error optimizing read items

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:

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.

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

Show us the DB structure from PLC also…

Hi All
Below are the DB structure screenshots




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…

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

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.

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…

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…

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.

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.

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.

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?

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.