Siemens S7-200/1200/1500
Siemens S7 ISO-TCP via the Site Runtime s7comm (S7-200smart/1200/1500 and S7-200).
| Property | Value |
|---|---|
| Console protocol id | siemens-s7-modern |
| Site Runtime plugin | s7comm |
| Transport | Ethernet (TCP/UDP) |
| Read | yes |
| Write | yes — through approved writes |
| Subscribe | — |
| Device families | S7-200, S7-1200, S7-1500 |
| Default group interval | 100 ms |
| Maturity | Production: complete driver (connection handling, address forms, batching, read and write) |
Create the device
- Open Connectivity → Devices and click Add device.
- Pick Siemens S7-200/1200/1500 in the protocol list.
- Choose the Site Runtime that can reach the device, fill the connection parameters below and click Create & connect.
- 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.
| Parameter | Type | Default | Range / options | Required | Description |
|---|---|---|---|---|---|
Target PLC IP Addresshost | string | — | max 30 chars | yes | |
Target PLC Portport | int | 102 | 1 – 65535 | yes | |
PDU Sizepdu_size | int | 960 | 100 – 960 | yes | |
PLC Modulemodule | map | S7-200smart/1200/1500 | S7-200smart/1200/1500, S7-200 | yes | |
Local TSAPlocal_tsap | int | 4096 | 0 – 65535 | yes | Shown when PLC Module = S7-200. |
Remote TSAPremote_tsap | int | 4096 | 0 – 65535 | yes | Shown when PLC Module = S7-200. |
Connection Typeconnection_type | map | PG | PG, OP, PC | yes | Shown when PLC Module = S7-200smart/1200/1500. |
CPU Rackrack | int | 0 | 0 – 15 | yes | Shown when PLC Module = S7-200smart/1200/1500. |
CPU Slotslot | int | 1 | 0 – 15 | yes | Shown when PLC Module = S7-200smart/1200/1500. |
Intervalinterval | int | 300 | 10 – 60000 | yes | interval |
t1t1 | int | 10000 | 100 – 20000 | yes | t1 |
t2t2 | int | 10 | 1 – 200 | yes | t2 |
t3t3 | int | 1 | 1 – 200 | yes | t3 |
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 types | Address 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:
| Form | Meaning | Types |
|---|---|---|
DB1.DBX0.0 | Bit 0 of byte 0 of data block 1 | BOOL, BIT |
DB1.DBB0 | Byte 0 of DB1 | INT8, UINT8 |
DB1.DBW0 | Word at byte 0 | INT16, UINT16, WORD |
DB1.DBD4 | Double word at byte 4 | INT32, UINT32, FLOAT, DWORD |
DB1.DBW0.10 | 10 bytes from byte 0 (length even, at most 128) | STRING |
IW0, I0 | Input word, input byte (I0.1 is a bit) | INT16, UINT16 |
QW0, Q0 | Output word, output byte (O is accepted like Q) | INT16, UINT16 |
MW10, M10 | Marker word, marker byte (M10.3 is a bit; F like M) | INT16, UINT16 |
T0 | Timer 0 | INT32, UINT32 |
C0 | Counter 0 | INT16, 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,DBBandDBXis 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:
| Suffix | On 16-bit types | On 32-bit types |
|---|---|---|
none or #B | as read | as read (ABCD) |
#L | the two bytes are swapped | the two words are swapped |
#BB | ABCD | |
#BL | BADC | |
#LL | DCBA | |
#LB | CDAB |
Use a suffix only for a device that stores values in another order (for example data that a gateway has already swapped).
Typical settings
| Setting | S7-1200 / 1500 | S7-200 Smart | S7-200 (CP243) |
|---|---|---|---|
| PLC Module | S7-200smart/1200/1500 | S7-200smart/1200/1500 | S7-200 |
| Target PLC Port | 102 | 102 | 102 |
| CPU Rack, CPU Slot | 0 and 1 | 0 and 1 | not used |
| Local TSAP, Remote TSAP | not used | not used | hexadecimal, default 1000 each |
| PDU Size | 960 (100 to 960) | 960 | 960 |
| Connection Type | PG (1), OP (2) or PC (3). Default PG. | ||
| Interval | 300 ms (10 to 60000) | ||
| t1, t2, t3 | 10000, 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
| Symptom | Cause | Fix |
|---|---|---|
Connection works, all tags bad | Optimized block access is on, or PUT/GET is not permitted. | Change the PLC settings (see above). |
| Cannot connect | Wrong 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 good | The DB does not exist, or the offset is beyond the DB size. | Check the DB number and its length. |
| Value is garbage | Wrong type, or you used a word number instead of a byte offset. | Use the byte offset from TIA Portal. |
| Bit address refused | A bit number above 7. | Use 0 to 7. |
| STRING refused | Odd length. | Use an even length. |
| Address refused for a type | DBD with INT16, DBX with UINT16. | Match the form to the type, see the table. |