Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
SINT
USINT
DINT
LREAL
LINT
ULINTULINTtax

Strings

Please see https://support.industry.siemens.com/tf/WW/en/posts/string-data-type/51621?page=0&pageSize=10

...

Info

Note that a 2 byte prefix is used, so n+2 bytes have to be read from the plc.

The first byte represents the max length of the String, i.e., n above. The second one represents the actual length, i.e., the number of bytes to convert to string (starting from offset 2, then).

All bytes represent ASCII Chars.

String Syntax

I did not find any suitable information on how Strings are adressed, except that simple characters can be adressed similar to a byte array.

As it makes no sense at all to use a "width" identifier for the String, I suggest to use the syntax

Code Block
%DB{block-id}.{byte-offset}:STRING[length]
%DB{block-id}.{byte-offset}:STRING

where the second version refers to the first version with length 254.

Examples for valid addresses

...