Siemens S7 Overview
TheSIEMENS_S7 route enables direct communication with Siemens S7 PLCs using the native S7 protocol (ISO-on-TCP). It supports all major S7 PLC families and provides access to data blocks, memory areas, inputs, outputs, timers, and counters.
Basic Syntax
Supported CPU Types
For S7-1200/1500 PLCs, you may need to enable “Permit access with PUT/GET” in the PLC’s protection settings (Hardware Configuration → Protection & Security).
Connection Configuration
S7_CONFIG Parameters
string
required
S7 PLC IP address.
string
required
CPU type:
S7200, S7300, S7400, S71200, or S71500.integer
PLC rack number. Default: 0.
integer
PLC slot number. Default: 1 for S7-1200/1500, 2 for S7-300/400.
string
Connection type:
PG (Programming device), OP (Operator Panel), or S7BASIC. Default: PG.integer
Number of retry attempts on failure. Default: 3.
integer
Seconds to wait between retries. Default: 5.
integer
Refresh time in milliseconds. Default: 1000.
integer
Read timeout in milliseconds. Default: 5000.
integer
Write timeout in milliseconds. Default: 5000.
Connection Examples
- S7-1500
- S7-1200
- S7-300
- S7-400
S7 Addressing
Address Format
S7 addresses follow the pattern:<Area><Number>.<Offset> or <DB>.<Type><Offset>
Address Types
string
Memory area type:
DATABLOCK, MEMORY, INPUT, OUTPUT, TIMER, COUNTER.For most configurations, the ADDRESS_TYPE is inferred from the address format. Use explicit ADDRESS_TYPE when needed for clarity.
Data Types
String sizing
ForSTRING tags, WITH LENGTH is the total allocated buffer in bytes on the wire—the S7 two-byte maximum-length/current-length header plus the maximum character payload. It is not the character count alone. Default: 256 bytes. STRING_SIZE is accepted as an alias for the same field.
In TIA Portal, a STRING[n] variable occupies n + 2 bytes (two header bytes plus n characters of capacity). Set WITH LENGTH to that combined total so the route reads the full allocation from the starting byte address—for example, STRING[254] occupies 256 bytes, so use WITH LENGTH 256.
TAG Configuration
Complete TAG Example
TAG Parameters
Address Configuration
Address Configuration
string
required
S7 address in standard notation (e.g.,
DB1.DBW100, M0.0, I0.0, Q0.0).string
Address type:
DATABLOCK, MEMORY, INPUT, OUTPUT, TIMER, COUNTER.string
required
S7 data type:
BOOL, BYTE, WORD, DWORD, INT, DINT, REAL, STRING.integer
default:"256"
STRING only. Total string buffer size in bytes, including the two-byte S7 header. Alias:
STRING_SIZE.Value Transformation
Value Transformation
Filtering
Filtering
Publishing
Publishing
Event-Based Operations
For on-demand S7 operations (not polling), use the EVENT syntax. Publish a message to SOURCE_TOPIC to trigger the operation; the route executes it and publishes the result to DESTINATION_TOPIC.Supported Operations
Query Parameters
Read Example
Read 10 words from Data Block 1 on demand:Write Example
Write a REAL value to Data Block 10 on demand:Complete Examples
- Basic Data Block Reading
- Memory and I/O
- Bidirectional Control
- Multiple Polling Rates
- Combined (Cyclic + On-Demand)
Read values from a data block:
S7-1200/1500 Setup
Enable PUT/GET Access
- Open TIA Portal project
- Navigate to Device Configuration → Properties
- Go to Protection & Security → Connection mechanisms
- Enable Permit access with PUT/GET communication from remote partner
Optimized Block Access
For S7-1500, ensure data blocks are set to allow standard access:- Open the Data Block in TIA Portal
- In Properties, uncheck Optimized block access
- Compile and download to PLC
Troubleshooting
Connection Refused
Connection Refused
- Verify IP address is correct
- Check PLC is in RUN mode
- For S7-1200/1500: Enable PUT/GET access
- Verify correct RACK and SLOT settings
- Check firewall allows TCP port 102
Wrong Slot Error
Wrong Slot Error
Use correct slot for your CPU:
- S7-1200/1500: Slot 1
- S7-300: Slot 2
- S7-400: Slot 2 or 3 (check hardware config)
Optimized Block Access Error
Optimized Block Access Error
For S7-1500: Disable optimized block access in TIA Portal for data blocks you want to access.
Incorrect Values
Incorrect Values
- Verify address matches TIA Portal
- Check DATA_TYPE corresponds to PLC variable type
- For multi-word types, verify byte offset is correct
- Check BYTE_ORDER if values seem swapped
Write Fails
Write Fails
- Ensure WRITABLE is set to “true”
- Verify PLC is in RUN mode
- Check access permissions in PLC
- Confirm value is within MIN_VALUE/MAX_VALUE
Next Steps
OPC UA Client
Cross-platform industrial communication.
ADS (Beckhoff)
Connect to TwinCAT systems.

