Siemens S7
Connecting to S7-1200/1500 (and 300/400), covering rack/slot, DB access, and PLCSIM.
Connection settings
| Setting | Value |
|---|---|
| IP address | The PLC's PROFINET interface IP |
| Rack | 0 for S7-1200/1500; per hardware config for 300/400 (typically 0) |
| Slot | 1 for S7-1200/1500; typically 2 for 300/400 |
One-time PLC configuration (TIA Portal)
S7-1200/1500 CPUs reject external S7 communication until two settings are made:
- Allow PUT/GET, CPU Properties → Protection & Security → Connection mechanisms → Permit access with PUT/GET communication from remote partner.
- Disable optimized block access on every DB you want to read, DB Properties → Attributes → uncheck Optimized block access, then recompile and download. Only non-optimized (absolutely addressed) DBs are externally addressable.
Optimized DBs are the #1 support issue
If the connection tests OK but every read fails or returns garbage, the DB is still optimized. After unchecking, re-download the block, the setting takes effect on download.
Addressing
Variables reference absolute addresses in data blocks, e.g.:
| Address | Reads | Data type to select |
|---|---|---|
DB10.DBD0 | 4-byte value at byte 0 of DB10 | REAL or DINT |
DB10.DBW4 | 2-byte value at byte 4 | INT |
DB10.DBX6.0 | Bit 0 of byte 6 | BOOL |
The data type chosen on the variable must match the PLC-side declaration.
Testing without hardware: PLCSIM
PLCSIM Advanced exposes a virtual S7-1500 with a network interface, and Machinery Twin connects to it directly like a physical CPU (use the instance's IP, rack 0, slot 1, and the same PUT/GET + non-optimized-DB settings).
The TIA-integrated PLCSIM Basic does not expose that interface directly, but it can be connected through a bridge such as NetToPLCSim. Configure and secure that third-party bridge according to its own documentation, then use the bridged S7 endpoint in Machinery Twin.
The full zero-hardware walkthrough is the Connect to PLCSIM tutorial.