Skip to main content

Siemens S7

Communicates using the standard protocols of the SIEMENS SIMATIC S7 series (ISO-on-TCP / S7 protocol).

Supported series: S7-300 / S7-400 / S7-1200 / S7-1500 (+ S7-200 / S7-200 SMART / SINUMERIK 828D)


Registration form entries

FieldWhat to enterExample
IP addressIP of the PLC192.168.0.70
PortS7 communication port102 (standard / changing not recommended)
Controller Type (controller-type)PLC seriesS7_400 (default) / S7_300 / S7_200 / S7_200_SMART / S7_1200 / S7_1500 / SINUMERIK_828D
Rack (local-rack)Rack numberUsually 0
Slot (local-slot)CPU slot numberVaries by series (see table below) — 3 if not specified
Multi read (multi-read)Whether to read each chunk in a single round triptrue when checked (disabled by default — reads each tag individually)
Multi read max items (multi-read-max-items)Upper limit of items per chunk18 (default, based on a 240-byte PDU budget)

Rack / slot by series

Seriesrackslot
S7-30002
S7-40003 (may differ depending on the CPU slot)
S7-120000 (or 1)
S7-150000 (or 1)

Prerequisite settings in TIA Portal

For security reasons, Siemens PLCs require the following settings before values can be read externally.

  1. In TIA Portal, go to PLC properties → Protection & Security → enable “Permit access with PUT/GET communication from remote partner”
  2. In the data block (DB) properties → turn Optimized block access OFF (switch to absolute addressing mode)

If either of these is not set, “Address out of range” or “Connection rejected” will occur.


PLC address notation for tags

Standard Siemens memory notation is used as-is. Addresses begin with %.

NotationMeaning
%DB1.DBX0.0Bit 0 of byte 0 in DB1 (boolean value)
%DB1.DBB0Byte 0 of DB1 (8-bit)
%DB1.DBW0Word 0 of DB1 (16-bit)
%DB1.DBD0Double word 0 of DB1 (32-bit / float)
%I0.0Input bit 0.0
%Q0.0Output bit 0.0
%M0.0Memory bit 0.0
%MW100Memory word 100
%MD100Memory double 100 (32-bit)

It also works without %, but we recommend adding % for consistency with the manual and other tools.


Data type matching

PLC valueData typeType qualifierPLC address example
BoolBoolean(leave empty)%DB1.DBX0.0, %I0.0, %M0.0
8-bitIntegerB%DB1.DBB0
16-bit integerInteger(leave empty)%DB1.DBW0, %MW100
32-bit integerIntegerDW%DB1.DBD0, %MD100
32-bit float (most common float type)FloatREAL%DB1.DBD0
64-bit floatDoubleLREAL%DB1.DBD8
String (S7 STRING)StringSTR[N]%DB1.DBB100
Check the Bool notation

Bool must always use the %DB1.DBX{byte}.{bit} format. Don't omit the trailing .0.7.


Common problems and solutions

Symptom / messagePossible causeSolution
“Connection refused”Port 102 blocked, PUT/GET disabledEnable PUT/GET communication in TIA Portal
“Connection rejected by remote”rack/slot mismatchCorrect the rack/slot using the table above
“Address out of range”DB is in Optimized mode (not absolute addressing mode)In TIA Portal, go to DB properties → turn off Optimized block access
All values are 0Wrong DB number / offsetVerify in the TIA Portal watch table that the same address actually works
Only Bool values fail to read.bit missingSpecify down to .bit exactly, as in %DB1.DBX0.0

Frequently used examples

Tags commonly grouped on a single line PLC

Tag namePLC addressData typeType qualifier
Pump running (DB)%DB1.DBX0.0Boolean(leave empty)
Input signal%I0.0Boolean(leave empty)
Pressure (kPa, float)%DB1.DBD8FloatREAL
Cumulative counter%MD100IntegerDW
Batch name%DB1.DBB100StringSTR[16]

More detailed examples / automated registration

See the S7 examples in Advanced — REST API.