Skip to main content

Siemens S7-200/1200/1500

Device Production Ethernet

Siemens S7 ISO-TCP via the Site Runtime s7comm (S7-200smart/1200/1500 and S7-200).

PropertyValue
Console protocol idsiemens-s7-modern
Site Runtime plugins7comm
TransportEthernet (TCP/UDP)
Readyes
Writeyes — through approved writes
Subscribe—
Device familiesS7-200, S7-1200, S7-1500
Default group interval100 ms
MaturityProduction: complete driver (connection handling, address forms, batching, read and write)

Create the device​

  1. Open Connectivity → Devices and click Add device.
  2. Pick Siemens S7-200/1200/1500 in the protocol list.
  3. Choose the Site Runtime that can reach the device, fill the connection parameters below and click Create & connect.
  4. Add a group (poll interval) and tags with the address formats below. See Devices and Groups and tags for the full walk-through.

Connection parameters​

Every field the Console shows for this protocol. Required fields must be set before the device can be saved.

ParameterTypeDefaultRange / optionsRequiredDescription
Target PLC IP Address
host
string—max 30 charsyes
Target PLC Port
port
int1021 – 65535yes
PDU Size
pdu_size
int960100 – 960yes
PLC Module
module
mapS7-200smart/1200/1500S7-200smart/1200/1500, S7-200yes
Local TSAP
local_tsap
int40960 – 65535yesShown when PLC Module = S7-200.
Remote TSAP
remote_tsap
int40960 – 65535yesShown when PLC Module = S7-200.
Connection Type
connection_type
mapPGPG, OP, PCyesShown when PLC Module = S7-200smart/1200/1500.
CPU Rack
rack
int00 – 15yesShown when PLC Module = S7-200smart/1200/1500.
CPU Slot
slot
int10 – 15yesShown when PLC Module = S7-200smart/1200/1500.
Interval
interval
int30010 – 60000yesinterval
t1
t1
int10000100 – 20000yest1
t2
t2
int101 – 200yest2
t3
t3
int11 – 200yest3

Tag addresses and data types​

Supported data types: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, BIT, STRING, BYTES, TIME, DATE_AND_TIME, ARRAY_CHAR, ARRAY_INT8, ARRAY_UINT8, ARRAY_INT16, ARRAY_UINT16, ARRAY_INT32, ARRAY_UINT32, ARRAY_INT64, ARRAY_UINT64, ARRAY_FLOAT, ARRAY_DOUBLE. The Console validates each tag address against the pattern for its data type before it is saved:

Data typesAddress pattern (regular expression)
INT8 UINT8(^DB[0-9]+.DB(W|B)[0-9]+|^(I|O|F|Q|M)(|W)[0-9]+)$
INT16 UINT16 INT64 UINT64 DOUBLE(^(I|O|F|Q|M|T|C)(|W)[0-9]+|^DB[0-9]+.DBW[0-9]+)(#B|#L|)$
INT32 UINT32 FLOAT(^(I|O|F|Q|M|T|C)(|W)[0-9]+|^DB[0-9]+.DB(W|D)[0-9]+)(#BB|#BL|#LL|#LB|)$
BIT(^(I|O|F|Q|M|T|C)(|X|W)[0-9]+|^DB[0-9]+.DB(W|X)[0-9]+)\.([0-9]|1[0-5])$
STRING BYTES ARRAY_CHAR ARRAY_INT8 ARRAY_UINT8 ARRAY_INT16 ARRAY_UINT16 ARRAY_INT32 ARRAY_UINT32 ARRAY_INT64 ARRAY_UINT64 ARRAY_FLOAT ARRAY_DOUBLE(^(I|O|F|Q|M|T|C)(|W)[0-9]+|^DB[0-9]+.DBW[0-9]+)\.[0-9]+
TIME(^(I|O|F|Q|M|T|C)(|W)[0-9]+|^DB[0-9]+.DB(W|D)[0-9]+)$
DATE_AND_TIME(^(I|O|F|Q|M|T|C)(|W)[0-9]+|^DB[0-9]+.DBW[0-9]+)$

Addressing and notes​

Address syntax and examples​

The address names an area and a byte offset:

FormMeaningTypes
DB1.DBX0.0Bit 0 of byte 0 of data block 1BOOL, BIT
DB1.DBB0Byte 0 of DB1INT8, UINT8
DB1.DBW0Word at byte 0INT16, UINT16, WORD
DB1.DBD4Double word at byte 4INT32, UINT32, FLOAT, DWORD
DB1.DBW0.1010 bytes from byte 0 (length even, at most 128)STRING
IW0, I0Input word, input byte (I0.1 is a bit)INT16, UINT16
QW0, Q0Output word, output byte (O is accepted like Q)INT16, UINT16
MW10, M10Marker word, marker byte (M10.3 is a bit; F like M)INT16, UINT16
T0Timer 0INT32, UINT32
C0Counter 0INT16, UINT16

Examples: DB1.DBW0 (UINT16), DB1.DBD4 (FLOAT), DB10.DBX2.5 (BOOL), MW20 (INT16), DB5.DBB0 (UINT8), I0.1 (BOOL), QW2 (UINT16).

  • The number after DBW, DBD, DBB and DBX is the byte offset counted from the start of the data block, as TIA Portal shows in the Offset column. It is not a word number.
  • The bit number is 0 to 7.
  • A string address carries the length in bytes, DB1.DBW0.20. The length must be even.

Endianness​

S7 data is big endian on the wire, which is what the default does. Suffixes on a tag change the interpretation of that tag only:

SuffixOn 16-bit typesOn 32-bit types
none or #Bas readas read (ABCD)
#Lthe two bytes are swappedthe two words are swapped
#BBABCD
#BLBADC
#LLDCBA
#LBCDAB

Use a suffix only for a device that stores values in another order (for example data that a gateway has already swapped).

Typical settings​

SettingS7-1200 / 1500S7-200 SmartS7-200 (CP243)
PLC ModuleS7-200smart/1200/1500S7-200smart/1200/1500S7-200
Target PLC Port102102102
CPU Rack, CPU Slot0 and 10 and 1not used
Local TSAP, Remote TSAPnot usednot usedhexadecimal, default 1000 each
PDU Size960 (100 to 960)960960
Connection TypePG (1), OP (2) or PC (3). Default PG.
Interval300 ms (10 to 60000)
t1, t2, t310000, 10, 1

Poll group interval: 1000 ms is a good start. The group is read with merged requests, up to the PDU size.

On an S7-1200 or S7-1500 enable the access in TIA Portal: Permit access with PUT/GET communication from remote partner, and switch off Optimized block access for every data block that you read. Compile and download again.

Common errors​

SymptomCauseFix
Connection works, all tags badOptimized block access is on, or PUT/GET is not permitted.Change the PLC settings (see above).
Cannot connectWrong rack or slot, port 102 blocked, all connection resources of the CPU in use.Check rack 0 and slot 1. Close other clients.
Tag bad, others goodThe DB does not exist, or the offset is beyond the DB size.Check the DB number and its length.
Value is garbageWrong type, or you used a word number instead of a byte offset.Use the byte offset from TIA Portal.
Bit address refusedA bit number above 7.Use 0 to 7.
STRING refusedOdd length.Use an even length.
Address refused for a typeDBD with INT16, DBX with UINT16.Match the form to the type, see the table.