• Syntax currently only for DB acces
    • Markers
    • I/O
    • Timers, ...
  • We should have a complete list of all supported types and all plcs where they are available (see S7DataType from Chris).
  • We should cleary state all checks and inference the parser does

Address Syntax

The new Syntax has the following motivation

Syntax

%{data-area-code}.DB{bit-length-code}{byte-offset}(.{bit-offset})?

The parts are:

Type identifier Postfix

Generally the TIA Syntax is used:

BOOL, INT, UINT, REAL

Furthermore the follwoing modifiers to the base types are used:

S = Short

D = Double

L = Long

Examples are:

SINT
USINT
DINT
LREAL
LINT
ULINTtax

Strings

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

A short description of the syntax and intern format is found here , or here https://support.industry.siemens.com/cs/mdm/109755202?c=94063831435&lc=en-WW

The following Syntax is valid and will be supported:

STRING[n] // String with max number of characters: n
STRING // equivalent to STRING[254]


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

%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.

This Synatx is motivated by the Syntax which TIA uses e.g. for markers ("%M4.1") where there is only one kind of datatype.

Examples for valid addresses

%DB3.DX4.1
%DB3.DX4.1:BOOL
%DB3.DB4:INT
%DB3.DB4:UINT
%DB3.DW4:REAL

Additional Documents

Programming Guideline

https://w3.siemens.com/mcms/sce/de/fortbildungen/ausbildungsunterlagen/tia-portal/tabcardseiten/Documents/HW-Konfig-S7-1200/81318674_Programming_guideline_DOKU_v13_de.pdf

Addressing

https://support.industry.siemens.com/cs/mdm/109755202?c=69436189067&lc=en-WW

Data type

Absolute address

Example

Description

BOOL

%DBn.DBXx.y

%DB1.DBX1.0

Data bit 1.0 in DB1

BYTE, CHAR, SINT, USINT

%DBn.DBBy

%DB1.DBB1

Data bit 1 in DB1

WORD, INT, UINT

%DBn. DBWy

%DB1.DBW1

Data word 1 in DB1

DWORD, DINT, UDINT, REAL, TIME

%DBn.DBDy

%DB1.DBD1

Data double word 1 in DB1


More Absolut addressing

https://euroec.by/assets/files/weintek/plc_connection_guide/Siemens_S7_1200_S7_1500_absolute_addressing_Ethernet.pdf

Cheat Sheet