S7-400 UDT STRING addressing

Hello all,

I am addressing a UDT in a Siemens S7-400 PLC. My Ignition UDT is working great with all other type of tags, but I am having Issues with getting a STRING tag to work. The Siemens UDT looks like this:

The Ignition UDT looks like this:

I am not sure what is that I am doing wrong. I tried the following variations:

[{PLCPath}]{DB},STRING{Offset+160}.254

[{PLCPath}]{DB},STRING{Offset+160}.252 (take 2 bytes off)

[{PLCPath}]{DB},STRING{Offset+160}.210 (I read somewhere that the max size is 210)

[{PLCPath}]{DB},STRING{Offset+160}.208 (max size - 2 bytes)

[{PLCPath}]{DB},STRING{Offset+160} (No size)

It's probably fairly obvious, but I just can't see what's wrong.

Also, ALL the other tags are working perfect. They are parameterized the same way using the same offsets.

I can confirm that the max size is 210 with the current Siemens driver. I'll take a closer look at this tomorrow, but are you getting any errors while trying to read?

Hello,

I tried an other block that has a string that is only 20 bytes long and the addressing worked [{PLCPath}]{DB},STRING{Offset+160}.20 in this format.

So, I can confirm that the 254 bytes long string in the PLC has to be resized to 210 or less. I am surprised that the driver doesn't just take the first 210 and truncate the rest.

Also, Siemens seems to have a WString data type that is 254 bytes by default. Does Ignition support that data type? I can't find anything in the documentation about it.

WSTRING - STEP 7 Professional V13.1 - ID: 109011420 - Industry Support Siemens

Small update-

That max length of 210 for the current driver includes the leading 2 bytes that Siemens requires for max length and actual length of the string. This leaves only 208 bytes available for the actual string.

Yes, this is unfortunate for use cases such as this. I'll look into it for the new driver, but this will be mostly alleviated by supporting full length strings.

Does Ignition support WSTRING?

Not currently. For the new driver, I believe we are planning to support this for symbolic access, but not for absolute addressing. This means it would only be supported on 1200/1500 PLCs. We can certainly consider this as a feature request for the new driver if you have a good use case for it, though.

WSTRING is 254 bytes by default.

I'm actually getting an out of memory exception just trying to view that webpage about WSTRING right now. However, if I recall correctly, it's technically 508 bytes by default. It is 254 2-byte characters long. This data type is not supported on the 300 & 400 PLCs, only the 1200 & 1500.

Thank you for the info, hopefully this thread will be helpful for someone else as well.