Siemens S7-300/400
Siemens S7 ISO-TCP via the Site Runtime s7comm-for-300 (S7-300/400).
| Property | Value |
|---|---|
| Console protocol id | siemens-s7-legacy |
| Site Runtime plugin | s7comm-for-300 |
| Transport | Ethernet (TCP/UDP) |
| Read | yes |
| Write | yes — through approved writes |
| Subscribe | — |
| Device families | S7-300, S7-400 |
| Default group interval | 1000 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-300/400 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 | |
Connection Typeconnection_type | map | PG | PG, OP, PC | yes | |
CPU Rackrack | int | 0 | 0 – 15 | yes | |
CPU Slotslot | int | 2 | 0 – 15 | yes | |
Intervalinterval | int | 300 | 30 – 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, 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 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]+ |
Addressing and notes
Address syntax and examples
The address syntax is the same as for S7-200/1200/1500: an area and a byte offset.
| Form | Meaning | Types |
|---|---|---|
DB1.DBX0.0 | Bit 0 of byte 0 of DB1 | 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 (even, at most 128) | STRING |
IW0, QW0, MW0 | Input, output and marker words | INT16, UINT16 |
M10.3, I0.0, Q0.1 | Marker, input and output bits | BOOL, BIT |
T0, C0 | Timer (32 bit), counter (16 bit) | INT32/UINT32, INT16/UINT16 |
Examples: DB1.DBW0, DB1.DBD4 (FLOAT), MW20, DB10.DBX2.5, M10.3, IW0.
Endianness
Big endian on the wire. A suffix changes one tag: #L swaps the bytes of a 16-bit tag or the words of a 32-bit tag, #BL gives BADC, #LL gives DCBA, #LB gives CDAB, #B and #BB leave the order unchanged.
Typical settings
| Setting | Typical |
|---|---|
| Target PLC IP Address | IP of the CPU or of its Ethernet CP |
| Target PLC Port | 102 |
| CPU Rack, CPU Slot | 0 and 2 for an S7-300. For an S7-400 use the slot of the CPU in the rack. |
| Connection Type | PG (default), OP or PC |
| PDU Size | 960 (100 to 960). A CPU may negotiate a smaller PDU. |
| Interval | 300 ms (30 to 60000) |
| t1, t2, t3 | 10000, 10, 1 |
The default poll group interval is 1000 ms. S7-300 CPUs have few connection resources, so use one device for each CPU and few groups.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
| Cannot connect | Wrong rack or slot. | S7-300 is rack 0, slot 2. For an S7-400 check the hardware configuration. |
| Connects and drops | No free connection resource on the CPU or CP. | Close other clients (HMI, programming device). |
All tags bad | The DB does not exist or is too short. | Check the DB number and size in STEP 7. |
| Value is garbage | Wrong type or a word number used as offset. | Use the byte offset. |
| Bit address refused | Bit above 7. | Use 0 to 7. |
| Timeouts on large groups | PDU too small, too many tags. | Split the group. |