How-to
S7-1200 as an OPC UA gateway for S7-300 data
Short answer
An S7-1200 with firmware V4.4 or later and the OPC UA Basic runtime license works as the OPC UA gateway for a group of S7-300 controllers: GET and PUT jobs over configured S7 connections pull the legacy data into a buffered copy, the built-in OPC UA server publishes it, and no S7-300 program change is required. Size the design against the CPU's S7 connection resources, the 400-byte-per-connection transfer limit and the firmware's OPC UA session and subscription capacity.
On this page
An S7-1200 with firmware V4.4 or later and the OPC UA Basic runtime license is the practical gateway for a plant of S7-300 controllers that has to feed an OPC UA client. The S7-1200 reads the legacy stations over configured S7 connections with GET and PUT, keeps a buffered copy of the data in its own memory, and publishes that copy through its built-in OPC UA server. The S7-300 programs stay untouched when the values already sit in memory the GET can address, and unit conversion happens on the gateway. Size the design before you promise it: count the CPU's S7 connection resources, keep each transfer inside the per-connection byte limit, and check the OPC UA session and subscription capacity of your firmware. The steps below walk the setup and a sizing example.
What the gateway is, and what it is not #
Two independent interfaces meet in the S7-1200. OPC UA is the client/server interface that the historian, SCADA node or MES speaks; S7 communication with PUT/GET is the controller-to-controller link between the gateway and each S7-300. The gateway terminates both, and the S7-300 never becomes an OPC UA server itself.
Every value the client reads is a buffered copy: the last data the gateway's GET job brought in, not a live read of the S7-300. A client can stay connected and read plausible values while the link to a station is down, so publish each station's acquisition status next to its process values and let the client alarm on staleness.
Decide the direction of every value up front. Read-only telemetry needs a GET only. Anything the client must write needs a controlled PUT return path with checks in the gateway, which the last section of this page covers.
Firmware and the OPC UA Basic license #
The OPC UA server runtime exists on the S7-1200 from firmware V4.4. On older V4.x firmware the server entry is not offered in the device configuration at all, so a CPU on V4.3 or older must take a firmware upgrade before this pattern is possible.
The server needs a purchased runtime license. For this CPU class the license type is OPC UA Basic, documented for this arrangement under order number 6ES7823-0BE00-2BA0. TIA Portal tells you what your exact CPU and firmware want: open the CPU properties and read the entry under Runtime licenses, and license exactly what that page names. The release notes for firmware V4.5 ship the certificate as an OPC UA server license for Data Access, Class A, which is the service this server provides.
Those order numbers are the listing as documented in October 2021. Confirm the current license in TIA Portal against your CPU revision before you order; a newer firmware can change what is required.
Reading the S7-300 with PUT/GET #
GET reads data from the partner and PUT writes data to it, and both run over configured S7 connections, so set the connections up in the project's connection configuration first. The connection setup is the same as for the S7-300 to S7-1500 PUT/GET links during panel migration, which shows the partner-side configuration.
Each CPU owns a pool of S7 connection resources. The count depends on the exact CPU and grows when you add communications modules (CM or CP), so read the number for your CPU in the connection configuration limits before you commit to one connection per station.
Check access protection on both sides before the first GET: the S7-1200 gates PUT/GET behind a protection setting, and the S7-300's protection level decides what a remote partner may read. An unpermitted setup completes the network path but returns an error status on the job.
No S7-300 program change is required when the values already sit in data blocks or memory areas the GET can address. That shifts the verification work to the mapping: memory area, start offset, length and data type must match on both sides, because a transfer that completes with plausible but wrong bytes is an address or type mismatch, not a network fault. Prove the path with one known value that changes in normal operation; a constant value can hide a wrong address or a stale buffer.
Set it up, in order #
- Confirm the CPU and its firmware in the device configuration: the OPC UA server entry appears from firmware V4.4, and on older versions it is not offered.
- Read the required license in the CPU properties under Runtime licenses, and install the OPC UA Basic runtime license on the CPU.
- Permit PUT/GET communication in the protection settings of the S7-1200 and of every S7-300 partner.
- Create one configured S7 connection per S7-300 station and stay within the CPU's connection resources; add a communications module when the stations outgrow them.
- Write the GET jobs that copy each station's block into a gateway data block, and store each job's done and error status plus a completion timestamp beside the data.
- Convert and scale on the gateway, keeping the raw copies in their own area apart from the engineering values you publish.
- Enable the OPC UA server, set up certificate-based security and per-client permissions, and restrict writes to the items you approved on purpose.
- Point the client at the server, subscribe, and measure end-to-end data age with every station and every client running.
Worked example: reading a 336-byte block from one S7-300 station #
Inputs:
- The documented limit: S7 communication documentation puts a configured S7 connection between an S7-1200 and an S7-300 at up to 400 bytes of data.
- The example station inventory, illustrative, so take the real one from your S7-300's data blocks: 80 analog values as REAL at 4 bytes each, plus 16 words of packed status and setpoints at 2 bytes each.
Rule in words: one GET job reads one contiguous block, and a single job serves the whole station per cycle when the block's byte total stays within the per-connection limit.
Arithmetic:
- Analog values: 80 × 4 bytes = 320 bytes
- Status words: 16 × 2 bytes = 32 bytes
- Block total: 320 + 32 = 336 bytes, which is within the limit, so one GET job covers the station.
Growth case: the station gains 24 more analog channels. Now 104 × 4 bytes = 416 bytes, and 416 + 32 = 448 bytes total. That exceeds the limit, so the block splits into two transfer areas on two GET jobs, each within the limit, and the second job's connection counts against the CPU's connection resources — or you trim the block to the values the client actually uses.
Decision: one GET job per station while the block stays within the per-connection transfer limit; at 448 bytes this station runs two jobs.
Data age and the OPC UA side #
End-to-end data age is the GET cycle time, plus transfer completion, plus gateway processing, plus subscription delivery. The client cannot pull data through the OPC UA server faster than the GET cycle produces it: shortening the subscription interval downstream never speeds up the upstream read. Set the GET schedule from the process requirement and the client refresh from the display requirement, and keep the two apart.
On the client side, why OPC UA subscription updates beat polling PLC input changes shows why subscriptions keep delivery efficient where polling wastes it.
Count the OPC UA workload against the firmware: sessions, subscriptions and monitored values are limited, and the operating instructions for your CPU and firmware version carry those numbers. Total clients times subscriptions times monitored items, keep headroom for reconnections, and move the pattern to an S7-1500 with the license matched to its CPU class when the total outgrows the CPU — the questions at the end of this page list those order numbers. Sizing one Ignition gateway for 100,000 OPC UA tags works the same session accounting from the server side.
A subscription that stops firing while the gateway still updates is a client-side delivery failure rather than a dead tag, and OPC UA subscription stops: publish starvation, not tag failure explains that pattern.
Writes, security and the client computer #
Publish read-only by default. A value the client may write travels back through a PUT from the gateway to the S7-300, and the gateway should confirm station reachability and value range before it sends the write. Treat that write path as an operator action on a running process: keep it behind a confirmed command check in the gateway logic before any writable item goes live.
Server security is certificate-based: load the server certificate, trust only the clients you expect, and give each client the minimum access it needs, with writes restricted to approved items.
The consuming side is usually a PC that stays at the plant — a SCADA node, a data logger or an OPC UA station. When you specify that machine, an industrial panel PC built for cabinet-door or console mounting fits the role, keeping the client next to the gateway it reads.
Questions asked
Can an S7-1500 take over the gateway role when the workload grows?
An S7-1500 takes the same role and scales further. Its OPC UA license matches the CPU class: small covers ET 200SP CPUs through CPU 1513 including F variants, order number 6ES7823-0BE00-1BA0; medium covers CPU 1515 and 1516 including F variants, 6ES7823-0BE00-1CA0; large covers CPU 1517 and 1518 including F variants, 6ES7823-0BE00-1DA0. That listing is the one documented in October 2021, so confirm the current license for your exact CPU before ordering. An S7-1500 can also act as an OPC UA client, not only as a server.
What does the client see while the link to an S7-300 is down?
The client keeps reading the gateway's buffered copy, so values freeze at the last successful GET while the OPC UA session itself stays healthy. Session connectivity therefore proves nothing about freshness. Publish three side values per station: link status, job error status and the age of the last completed transfer. The client then alarms on stale data instead of showing a frozen value as current, and the acquisition status lives in the server's address space like any other tag.
Can the gateway reach an S7-300 that only has PROFIBUS?
The S7-1200's onboard port is Ethernet, so the pattern reaches each S7-300 over the plant network. A PROFIBUS-only S7-300 station joins through a communications processor that gives the station an Ethernet interface, and the configured S7 connection then points at that partner as usual. Confirm routing between the gateway's network and the station's network first, and that any routers in the path pass the S7 traffic, because the connection needs end-to-end reachability.
When should the client be allowed to write back to the S7-300?
After the read path is proven. Give every writable item one owner in the gateway logic, and send the PUT write only when the gateway confirms station reachability, no active error status on the link and a value inside its allowed range. Reject writes that arrive while the source link is stale, because the operator would act on frozen readings. Test the write path against a harmless value in the S7-300 before pointing it at a live setpoint.