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
S7 PLC IP address.
CPU type:
S7200, S7300, S7400, S71200, or S71500.PLC rack number. Default: 0.
PLC slot number. Default: 1 for S7-1200/1500, 2 for S7-300/400.
Connection type:
PG (Programming device), OP (Operator Panel), or S7BASIC. Default: PG.Number of retry attempts on failure. Default: 3.
Seconds to wait between retries. Default: 5.
Refresh time in milliseconds. Default: 1000.
Read timeout in milliseconds. Default: 5000.
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
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
TAG Configuration
Complete TAG Example
TAG Parameters
Address Configuration
Address Configuration
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
Cross-platform industrial communication.
ADS (Beckhoff)
Connect to TwinCAT systems.

