Skip to main content

Siemens S7

S7 Communication is a network protocol built by Siemens and is used in their PLCs to read and write from and to variables.

danger

The S7 communication protocol by Siemens does not meet today's security standards and should not be used.

The Siemens Target is compatible with the following PLCs:

300400WinAC12001500
DB Read/WriteXXXXX
EB Read/WriteXXXXX
AB Read/WriteXXXXX
MB Read/WriteXXXXX
TM Read/WriteXXX
CT Read/WriteXXX

Siemens TIA Portal PLC Configuration

Some TIA Portal settings are required to activate the S7 communication:

DB Properties

DB Properties

Full Access

Full Access

PUT/GET Communication

DB Properties

Target Configuration

The Siemens Target has the following parameters:

  • Host: Host name or IP Address of the Siemens PLC.
  • Port: Port of the Siemens PLC. Default is 102.
  • Rack: Rack of the Siemens PLC.
  • Slot: Slot of the Siemens PLC.
  • ConnectionType: S7 connection type. Can be Pg, Op or Basic.
  • TargetType: The type is always Siemens for this Target.

For the common parameters, see the Introduction.

Corresponding Edge configuration and Device Twin definition to activate the Siemens Target service:
https://localhost:5050/Targets
Siemens Target Settings

Data Streaming

S7 Communication is a address based protocol, therefore no discovery or name based signal access is possible. The syntax for the signal name is: Name,Area.Offset,DataType[,ArrayLength].

  • Name: The output signal name used in all subsequent processing steps.
  • Areas:
    • Inputs: i, e, ib
    • Marker: m, f
    • Outputs: q, a, qb
    • Timer: t, tm
    • Counter: c, z, ct
    • Data Blocks: DB[number]
  • Offset: The offset in byte from the beginning of the specified area.
  • DataType:
    • x: Boolean. When reading a register, the bit position can be added in square brackets. E.g. x[5].
    • b: Byte
    • w: UInt16
    • dw: UInt32
    • lw: UInt64
    • si: SByte
    • i: Int16
    • di: Int32
    • li: Int64
    • r: Float
    • dr: Double
    • c: Char ASCII (1 Byte)
    • wc: Char Unicode (2 Bytes)
    • s: String ASCII (1 Byte). The length of the string must be added in square brackets. E.g. s[12].
    • ws: String Unicode (2 Bytes). The length of the string must be added in square brackets. E.g. ws[12].
  • ArrayLength: Length of the array to read. If not present, it defaults to 1.

The Signals to read or write are configured in the Router.

For information how signals are named and labeled in Data Lakes, please read the Data Lake documentation.