Protocols 7 min read
How to enable PUT/GET access on the S7-1200 and S7-1500
The two TIA Portal settings a SCADA system needs to read S7-1200 and S7-1500 CPUs over the S7 protocol, plus optimized block access, absolute addresses and security.
Published:
PUT/GET is the setting that lets outside clients read and write the memory of an S7-1200 or S7-1500 CPU over the S7 communication protocol (S7comm). On these two CPU families it is off by default (on the S7-1200 since firmware V4.0). If a SCADA system, an HMI or a data collection tool connects to the CPU this way, you need two changes: allow PUT/GET access in the CPU properties, and turn off optimized block access on the data blocks the client reads.
How S7 communication works
S7comm is the protocol the S7-300 and S7-400 use with programming devices, HMIs and other CPUs. The S7-1200 and S7-1500 use the newer S7CommPlus with TIA Portal and their HMIs, and answer classic S7comm requests from remote clients only when PUT/GET is allowed. S7comm runs over TCP/IP using ISO-on-TCP (RFC 1006), and the CPU listens on TCP port 102. The client opens the TCP connection, sets up an ISO connection on top of it and then starts the S7 session. In that step, both sides also agree on the largest amount of data one message can carry (the PDU size).
Once connected, the client reads and writes the CPU’s memory areas by address. On the S7-300 and S7-400 this access is always open. On the S7-1200 and S7-1500 you have to allow the CPU to answer PUT and GET requests from a remote partner.
Absolute addressing: how the client finds data
S7comm finds data by memory area and byte offset, not by name:
| Area | Example address | Meaning |
|---|---|---|
| Data block | DB1.DBX0.0 | Bit 0 of byte 0 in DB1 |
| Data block | DB1.DBW2 | Word starting at byte 2 in DB1 |
| Data block | DB1.DBD4 | Double word starting at byte 4 in DB1 |
| Memory (M) | MW10 | Word starting at byte 10 of the memory area |
| Input (I) | I0.0 | Bit 0 of input byte 0 |
| Output (Q) | Q0.0 | Bit 0 of output byte 0 |
If TIA Portal is set to German mnemonics, inputs are written with E instead of I and outputs with A instead of Q. Multi-byte values are stored big-endian, and the REAL type is a 32-bit IEEE 754 floating point number. If the client uses the wrong byte order, the values show up as meaningless numbers.
Why optimized block access has to be off
On the S7-1200 and S7-1500, new data blocks use optimized access by default. In an optimized block, the CPU decides where each variable lives in memory, and there is no fixed byte offset inside the block. TIA Portal and HMIs reach these blocks by symbolic name. A client that reads by absolute address cannot find an address such as DB1.DBW2.
In a block with optimized access turned off (a standard block), every variable has a fixed offset. After you compile the block, TIA Portal shows these offsets in the Offset column of the block editor, and that is where you take the address for the client. The setting applies only to data blocks and block parameters. The M, I and Q areas are outside the optimized block concept and can be read by absolute address once PUT/GET is on.
Enabling PUT/GET in TIA Portal
1. Allow PUT/GET. Under the PLC in the project tree, open Device configuration and select the CPU. In the Inspector window, under Properties > General > Protection & Security > Connection mechanisms, check “Permit access with PUT/GET communication from remote partner”. The menu location can vary a little with the TIA Portal version and CPU firmware; in older versions the section is called just Protection.
2. Turn off optimized access on the data blocks. Right-click each data block the client will read in the project tree and open Properties. On the Attributes tab, clear “Optimized block access”. An instance DB takes this setting from its function block, so change it on the FB. Some library blocks cannot be switched; copy their values into a standard block.
3. Compile and download. Compile hardware and software, then download to the CPU (Download to device). After compiling, the Offset column of the blocks is filled in.
Changing optimized block access reinitializes the block: during the download, its actual values return to their start values. Do this before commissioning, or back up the values first. Because the hardware configuration changes as well, TIA Portal may ask you to put the CPU in STOP during the download, so on a running plant, plan for that stop in advance.
Common problems
- The CPU refuses the request: PUT/GET is not enabled, or the setting was never downloaded to the CPU. Snap7-based tools report “function refused by CPU” in this case.
- The connection works but one data block cannot be read: optimized access is still on for that block. Each block has its own setting.
- Values are shifted or meaningless: a variable was added to or removed from the block and the offsets moved. Check the Offset column again and update the addresses in the client.
- Values are far too large or too small: the client uses the wrong byte order or data type.
- The TCP connection never comes up: a firewall in between may be blocking port 102.
Security
PUT/GET communication has no authentication. Any device that can reach port 102 on the CPU can read and write the memory areas it allows. So:
- Keep the CPU on a network segment set aside for control systems, and allow access to port 102 only from the SCADA server. NIST SP 800-82 also recommends separating control systems from the business network in layers.
- Collect the data the SCADA system reads in a single interface data block. Turn off optimized access only on that block and keep the rest of the program optimized.
- Keep values that may be written from outside in a separate block, and check limits and interlocks in the PLC program.
The S7-1500 and the S7-1200 from firmware V4.4 also have a built-in OPC UA server. OPC UA offers certificates, signing and encryption; check Siemens’ license terms before you use it. See what is OPC UA for details.
Frequently asked questions
Is enabling PUT/GET safe?
Not by itself. With PUT/GET on, the CPU accepts reads and writes from any device that can reach port 102, without asking for credentials. It is common in the field when network separation and a firewall rule limit access to the SCADA server.
Does turning off optimized block access affect the PLC program?
The program runs the same way. The change reinitializes the block, so its actual values return to their start values; that is why you make it before commissioning.
Do the S7-300 and S7-400 need these settings?
No. On these CPUs, PUT/GET access is always open and there is no optimized block access.
In YTCC
YTCC’s Siemens S7 driver connects to CPUs as a client over S7comm and ISO-on-TCP. On the S7-1200 and S7-1500 it needs the two settings in this article: PUT/GET access on, and optimized block access off on the blocks it reads. You define points by absolute address in the configuration editor, and you can also prepare the address list in Excel or CSV and import it.
Adding and deleting points and changing addresses take effect without restarting the driver and without dropping the PLC connection. Like every driver, the S7 driver runs in its own operating system process. When communication with a PLC is lost, one alarm is raised for that device and its signals drop to “no connection” quality.
The other protocols YTCC talks to are on the Platform page. For manufacturing plants, see the Industrial Manufacturing page.