You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Address Syntax

The new Syntax has the following motivation

  • Be more familiar with the TIA Syntax well known by S7 programmers
  • Add Type Information to support all available TIA types
  • "Type inference" to be not too verbose

Syntax

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

The parts are:

  • data-area-code:
  • bit-length-code:
  • byte-offset
  • bit-offset

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
ULINT

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.

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

  • No labels