How-to
Simulate GET/PUT between two S7-1200 CPUs in PLCSIM
Short answer
PLCSIM simulates GET/PUT between two S7-1200 CPUs in one TIA Portal project, but only two instances run at a time. The accessed CPU needs Permit access with PUT/GET communication from remote partner enabled, plus a hardware download, or STATUS returns 16#0002 or 16#0019 on every REQ edge.
On this page
- Can PLCSIM actually run GET/PUT between two S7-1200 CPUs?
- Why does STATUS return 16#0002 or 16#0019 on every REQ edge?
- What does Permit access with PUT/GET communication from remote partner actually gate?
- Does the target data block need any special addressing?
- How do you set the whole simulation up, step by step?
- How do you prove the exchange is working, not just not failing?
- How many PLCSIM instances can you run at once?
- What are the failure modes to expect after it first works?
- The decision
- Questions asked
Yes, PLCSIM simulates GET/PUT between two S7-1200 CPUs in the same TIA Portal project; the pairing has been verified on PLCSIM V16 with TIA Portal V16 Update 4 and is reported working for two S7-1200s specifically. When STATUS returns 16#0002 or 16#0019 on every REQ edge and the partner data block never changes, the fault is configuration on the accessed CPU, not a limit of the simulator. The CPU being read or written must have Permit access with PUT/GET communication from remote partner enabled in its device configuration, and because that setting lives in the hardware configuration, it takes a hardware download to the corresponding PLCSIM instance before any job completes.
Can PLCSIM actually run GET/PUT between two S7-1200 CPUs? #
Yes, it can: two S7-1200s exchanging GET/PUT in one TIA Portal project run correctly on PLCSIM, verified on PLCSIM V16 with TIA Portal V16 Update 4. The GET and PUT instructions and the open user communication instructions T_SEND and T_RECV are all supported by the simulator. The one hard limit is instance count, covered below.
The pairing that fails is almost never the instruction. It is the access permission on the CPU whose memory you are touching, or a download that never carried the new permission into the simulated CPU.
Why does STATUS return 16#0002 or 16#0019 on every REQ edge? #
Neither code is 16#0000, so no job completed, and both point at the connection or the access permission rather than the logic. GET/PUT is one-sided communication: the client CPU calls the instruction and owns the instance DB and the S7 connection, while the partner CPU contains no communication code, because its operating system services the read or write directly. That is exactly why the partner cannot authorize the job in its own program, so Siemens gates the service in device configuration. With the permission cleared, the partner CPU's communication service refuses inbound S7 read and write jobs outright, DONE and NDR never set, and a clock-memory bit retriggering REQ every second fills the instance DB STATUS with 16#0002 or 16#0019. New S7-1200 projects ship with the box cleared, so check its state rather than assuming a default.
Name the two roles before you troubleshoot: the client calls GET or PUT, and the server (partner) owns the memory area being read or written.
| Observation at the client | Where to look | What it means |
|---|---|---|
| Non-zero STATUS on every REQ edge, DONE/NDR never set | Connection resources online on the client | S7 connection never established: permission still cleared on the server, or wrong partner address |
| DONE pulses but the partner DB does not change | Watch table on the server at absolute offsets | ADDR_x resolves to a different area, or the target DB still uses optimized block access |
| Job runs once after download, then errors permanently | Server diagnostics buffer | Server went to STOP, or the second PLCSIM instance was closed |
| Link lights present, client never connects | Instance list and IP assignment | Second instance not started, or both CPUs carry the same IP address |
What does Permit access with PUT/GET communication from remote partner actually gate? #
It is the CPU's permission for inbound one-sided S7 read and write jobs, and without it the partner refuses every GET/PUT job no matter how correct the client program is. The S7-1200 manual states the instruction pair works over PROFINET and PROFIBUS connections only when that permission is granted in the CPU properties. Because the checkbox sits in device configuration under the Protection settings (labelled Protection & Security in later TIA versions), changing it changes the hardware configuration, and a software-only download leaves the running CPU with the old permission. A related symptom on the client side, where link lights exist but the project still cannot reach the CPU, is covered in article:s7-1200-shows-link-lights-but-tia-portal-cannot-connect.
Does the target data block need any special addressing? #
Yes: the ADDR_x parameter is an absolute pointer such as P#DB10.DBX0.0 BYTE 20, so the target DB on the server must use standard, non-optimized block access. A block declared with optimized block access has no guaranteed byte layout, and the absolute pointer cannot address it. Clear the optimized access attribute in the block properties, recompile, and note the fixed byte offsets that result. The length declared in ADDR_x must match the local SD_x area on a PUT or RD_x area on a GET, byte for byte.
How do you set the whole simulation up, step by step? #
Work the sequence in order; each step depends on the one before it.
- Select the server CPU in the project tree, open its properties under Protection, and tick Permit access with PUT/GET communication from remote partner. If both CPUs write to each other, set the permission on both.
- Open the target data block on the server, clear the optimized block access attribute, recompile, and record the new byte offsets.
- On the client, enter the partner area in ADDR_x as an absolute pointer and size SD_x or RD_x to match it exactly.
- In Devices & networks, put both CPUs on the same PROFINET subnet with distinct IP addresses. A CPU copied from the first inherits its address and will never connect.
- Open the connection parameters of the GET/PUT instruction, select the second CPU in the project as partner, connection type S7 connection, active connection establishment on the client side; TIA numbers the connection automatically when both CPUs live in one project.
- Compile both CPUs, hardware and software.
- Start the first PLCSIM instance and download the client CPU including hardware configuration; start the second instance and download the server the same way. Put both in RUN.
- Drive REQ from a clock memory bit or an edge-triggered bit, one job per instance DB.
How do you prove the exchange is working, not just not failing? #
Five checks separate a working path from a quiet one.
- Monitor the client instance DB: expect STATUS 16#0000 with DONE (PUT) or NDR (GET) true for one scan after each REQ edge and ERROR false.
- Go online on the client and open connection diagnostics: expect one S7 connection occupied and shown as established. A connection that never establishes means the server permission is still cleared or the hardware download never reached it.
- On the server, watch the target DB at absolute offsets, for example %DB10.DBB0 through %DB10.DBB19: the written pattern appears within one REQ period.
- Check the server diagnostics buffer: expect no new aborted-connection or rejected-access entries after the permission is enabled and downloaded.
- Move live data: increment a byte in the client source area and confirm the server watch table follows. A static equality proves nothing; a moving value proves the path.
For the PUT side, a STATUS error after the connection does establish has its own decoding; the page on S7-1500 PUT error code 4 against an S7-300 partner walks through that failure class in more depth.
How many PLCSIM instances can you run at once? #
Two, and that ceiling sets the shape of the test plan. With GET/PUT traffic among four CPUs, only one pair can be simulated simultaneously: exercise the matrix pairwise, downloading and running each pair in turn, rather than expecting a four-way simulation. Firmware coverage also decides whether an instance starts at all, so compare the firmware version selected in device configuration against the versions your installed PLCSIM supports before blaming the logic. Siemens documents the two-instance S7 communication simulation procedure in Industry Online Support entry 88781327; the same page's method transfers from S7-1500 pairs to S7-1200 pairs. When a project on an older toolchain still refuses to connect after the permission is set and downloaded, re-test on the confirmed V16 pairing to separate configuration error from tool limitation.
What are the failure modes to expect after it first works? #
Three recur.
- Software-only download after enabling the permission. The checkbox is part of the hardware configuration, so a software download leaves the running image unchanged and STATUS keeps returning the same code. Download hardware and software together.
- Second instance closed or restarted with a different address. The connection aborts and the client errors permanently until both instances are up with their configured addresses. Connection problems between a controller and an S7-1200 over PROFINET have their own decode in article:fix-profinet-connect-errors-between-a-controller-and-an-s7-1200.
- Partner DB recompiled back to optimized access. The absolute pointer stops resolving and DONE pulses with no effect on the server. Re-check the block attribute any time the server program is recompiled or copied.
Where the security policy forbids enabling PUT/GET permission at all, T_SEND and T_RECV open user communication run on the same simulator and keep the access control in your own program instead of a device checkbox; the one-sided model and the two-instance limit stay identical either way.
The decision #
If STATUS shows 16#0002 or 16#0019 in PLCSIM: enable Permit access with PUT/GET communication from remote partner on the accessed CPU, standard-access the target DB, and download hardware and software to that instance; the exchange then completes. If your architecture needs more than two simulated CPUs: test pairwise, two instances at a time. If PUT/GET permission cannot be granted on site: simulate the exchange with T_SEND/T_RECV instead.
Questions asked
Why does GET/PUT return STATUS 16#0019 in PLCSIM?
16#0019 reports that the accessed CPU refused the inbound read or write job. On an S7-1200 the usual cause is that the Permit access with PUT/GET communication from remote partner checkbox was set in the project but never downloaded as hardware configuration to that PLCSIM instance, so the running image still carries the factory-cleared permission.
Does the target data block need optimized block access turned off?
Yes. GET/PUT addresses the partner with an absolute pointer such as P#DB10.DBX0.0 BYTE 20, and a block declared with optimized block access has no guaranteed byte layout, so the absolute pointer cannot address it reliably. Clear the optimized access attribute in the block properties on the partner CPU and recompile before pointing at it.
Can PLCSIM simulate GET/PUT between four CPUs at once?
No. The simulator limitation is two instances at a time, so a four-CPU exchange can only be exercised as one pair at a time: download and run the first pair, confirm the exchange, then bring the next pair up and repeat. Plan the test matrix pairwise before you start.
Do both S7-1200 CPUs need the PUT/GET permission enabled?
Only the CPU whose memory is read or written needs it, because GET/PUT is one-sided: the partner CPU has no communication code at all and its operating system services the job. If the test also has a GET or PUT running in the other direction, then the permission has to be enabled on both CPUs and downloaded to both instances.
What STATUS value proves the GET or PUT job worked?
STATUS 16#0000 with DONE true for one scan after each REQ edge on a PUT, or NDR true on a GET, and ERROR false. For a live proof, increment a value in the client source area and watch the partner-side watch table follow on the next request cycle, since a static match alone proves nothing.