Machinery TwinDocs

Siemens S7

Connecting to S7-1200/1500 (and 300/400), covering rack/slot, DB access, and PLCSIM.

Connection settings

SettingValue
IP addressThe PLC's PROFINET interface IP
Rack0 for S7-1200/1500; per hardware config for 300/400 (typically 0)
Slot1 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:

  1. Allow PUT/GET, CPU Properties → Protection & Security → Connection mechanisms → Permit access with PUT/GET communication from remote partner.
  2. 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.:

AddressReadsData type to select
DB10.DBD04-byte value at byte 0 of DB10REAL or DINT
DB10.DBW42-byte value at byte 4INT
DB10.DBX6.0Bit 0 of byte 6BOOL

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.

On this page