Integration · Cloud

OPC UA integration with MES, OEE and ERP: architecture and steps

ProductAWS IoT SiteWise
CategoryCloud
OPC UA roleClient

OPC UA integration guide for integrators: reference architecture, tag mapping, MQTT bridging and an acceptance checklist to feed MES, OEE and ERP.

Before you start

  • A gateway host on the plant network that can reach the OPC UA servers and AWS.
  • An OPC UA data source configuration per server, including the security policy and any credentials.
  • A certificate trust plan on each server, as with any OPC UA client.
  • An asset model design. This is the real work, and doing it after ingestion starts is more expensive than doing it first.

Setting it up

  1. Install the gateway on-premisesIt runs as a local component and holds the OPC UA client. Give its certificate store a persistent location.
  2. Add each server as a data sourceEndpoint URL, security policy and mode, and credentials. Start with security None to prove reachability, then move to SignAndEncrypt and deal with the trust exchange separately.
  3. Trust the gateway certificate on each serverMove it from the server's rejected store to trusted. Same workflow as every other OPC UA client, same time cost across a fleet.
  4. Choose your property filtersIngest the nodes you need rather than everything the server exposes. Ingestion is metered and an unfiltered browse-and-collect gets expensive quickly.
  5. Model the assetsDefine asset models and properties in the cloud and map incoming streams onto them. This is where a machine becomes a machine rather than a list of tags, and where you define transforms and metrics.
  6. Define metrics rather than computing downstreamAvailability and counts can be expressed as SiteWise transforms and metrics over ingested properties, which is cheaper and more consistent than recomputing them in every dashboard.

What the address space looks like

Flat property streams inbound, re-modelled into an asset hierarchy in the cloud. If your machine implements Machinery or MachineTool, that structure is not automatically reflected - you rebuild the equivalent shape in the asset model. Worth mapping the two deliberately so the cloud model and the machine model do not drift apart.

The traps

  • Ingestion and storage are metered. An unfiltered collection strategy produces a bill rather than an insight - decide what you need before you connect.
  • The asset model is a second modelling exercise on top of whatever the machine already exposes. Budget for it, and keep a written mapping between the two.
  • The gateway is another OPC UA client, so every certificate, endpoint and namespace-index problem in this reference applies to it unchanged.
  • Timestamp handling matters: if a PLC-embedded server only populates ServerTimestamp meaningfully, that is what lands in the cloud, and it is not when the event happened.
  • Data arriving out of order or late needs a decision about how metrics recompute. Make it explicitly rather than discovering it in a month-end number.

Getting OEE data out of it

Workable, provided the machine exposes state, counts and reasons and you model them properly. Availability from a state machine mapped to an asset property, performance from counters against a modelled ideal cycle time, quality from reject counts. The honest limits are the same everywhere: planned production time, shift calendars and order context come from ERP or MES, and the resolution of your availability figure is bounded by the publishing interval you chose.

Verify before you rely on this: Component names, configuration surfaces and pricing models change. Confirm the current gateway architecture and metering for your region before designing around it. Licence names, option packs, firmware levels and platform support in this area change between releases and are not stated as fact here. Confirm the current requirements with the vendor for your exact product version before you commit to a delivery date.

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

OPC UA integration is the work of connecting machine controllers to MES, OEE or ERP software through the OPC UA standard (IEC 62541), so that machine states, counters and process values reach business systems with their meaning, quality code and timestamp attached. A sound OPC UA integration combines a server on each PLC or gateway, a client or broker layer that subscribes to selected nodes, and a mapping that turns those nodes into the events each application expects.

This guide is written for system integrators and plant automation engineers who must deliver that data flow on a running line. It covers the reference architecture by ISA-95 level, when to add MQTT, a step-by-step method, a worked example on a packaging line, the failure modes seen on real shop floors and the acceptance checklist to sign before handing over to production.

OPC UA ACADEMYOPC UA integration with MES, OEEand ERP: architecture and stepsOPC UA integration guide for integrators: reference architecture, tagmapping, MQTT bridging and an acceptance checklist to feed MES, OEEUA

Key takeaways

  • The OPC UA integration should stop at the MES or OEE layer, and the ERP should receive only aggregated order quantities.
  • Subscriptions with tuned sampling, queue size and deadband replace polling and keep short stops visible.
  • PubSub over MQTT suits many consumers and cloud targets, while client-server stays the choice for writes and method calls.
  • Counter rollover, counter resets and timestamp choice cause most silent data gaps and belong in the acceptance tests.
  • A signed checklist with one reconciled shift is the handover criterion.

What does an OPC UA integration architecture look like from PLC to ERP?

OPC UA is a platform-independent, service-oriented standard from the OPC Foundation, published as IEC 62541, that carries industrial data together with its information model, status code and timestamps over a secured channel. An OPC UA server is the software, embedded in a PLC or running on a gateway, that exposes machine variables as nodes in an address space. An OPC UA client is the application that browses those nodes, reads them, writes them or subscribes to their changes.

The cleanest way to place each component is the ISA-95 level model. Each level has a different appetite for data, and an integration that ignores this ends up with an ERP flooded by signals it cannot use.

ISA-95 levelTypical systemOPC UA roleData exchanged
Level 1Sensors, drives, I/ONone, wired to the controllerRaw signals
Level 2PLC, HMI, SCADAServer, embedded or through a gatewayRun state, fault codes, counters, process values
Level 3MES, OEE and quality softwareClient with subscriptions, or PubSub subscriberDowntime events, produced and rejected quantities, cycle times
Level 4ERPUsually none, fed by the MES interfaceOrder confirmations, consumed materials, finished quantities

Three topologies cover almost every project. In direct client-server, the MES or OEE application opens a session to each PLC server. With an aggregating server, a gateway connects to every controller and exposes one unified address space, which shields the PLCs from many simultaneous clients. With PubSub, defined in Part 14 of the specification, publishers send data sets to a broker or a multicast group and any number of subscribers consume them without opening sessions.

The rule that saves most projects: the ERP never subscribes to PLC tags. The ERP needs a confirmed quantity per order and per shift, not a state change every 250 ms. The MES or OEE layer is where signals become business events.

When should OPC UA integration use MQTT instead of client-server?

OPC UA over MQTT is the PubSub model of Part 14 with an MQTT broker as transport: the publisher encodes DataSetMessages in JSON or UADP, posts them to broker topics, and subscribers read them without a session to the PLC. Sending raw tag values to a broker with a home-made topic tree is a different thing, because the information model, data types and status codes are lost unless the payload carries them.

CriterionClient-serverPubSub over MQTT
Number of consumersA few applications per serverMany consumers of one publication
Network pathInside the plant networkCrosses a DMZ or reaches a cloud platform, outbound only
Writes and method callsSupported through the Write and Call servicesNot designed for commands
Browsing the address spaceYes, at runtimeNo, metadata must be published separately
Delivery after reconnectionRepublish requests and server-side queuesDepends on broker retention and quality of service level
Typical useMES, OEE and SCADA on the same siteData lake, analytics, multi-site dashboards

A practical decision rule, given as an example to adapt per site: when more than three applications need the same signals, or when the consumer sits outside the plant network, publish through a broker; when the application must write setpoints, acknowledge alarms or call methods, keep a client-server session. Many plants run both, with the OEE system on client-server and a PubSub feed to the corporate data platform. The trade-offs are detailed in the comparison of MQTT vs OPC UA.

If the broker uses Eclipse Sparkplug B instead of the OPC UA PubSub encoding, keep the OPC UA browse path or NodeId as a metric property, so that any value on the broker can be traced back to its node on the machine.

How do you integrate OPC UA with MES or OEE software, step by step?

  1. List the signals per machine. For OEE and downtime, the minimum set is run state, active fault code, good count, reject count, ideal cycle time or rated speed, and the current order or product reference. Process values come later.
  2. Check what each server can do. Read the server profile, the security policies on offer and the limits exposed under ServerCapabilities and OperationLimits, such as the maximum monitored items per call. Browse the address space with a client from the OPC UA tools list before writing any code. On controllers where the server is disabled by default, follow the procedure for enabling the OPC UA server in TIA Portal or its equivalent.
  3. Fix the information model. Use a companion specification when one exists for the machine class, such as OPC UA for Machinery, or a PackML state model on packaging equipment. Otherwise define one object type per machine family so that every filler exposes the same variables at the same browse path.
  4. Secure the channel. Use Sign or SignAndEncrypt with certificates in the trust lists of both sides, user tokens for applications, and no SecurityPolicy None outside a lab.
  5. Configure subscriptions. Set sampling interval, publishing interval, queue size and deadband per signal type. States need a queue larger than one so that short stops between two publications are not overwritten. Counters need a data-change trigger on value, with no deadband.
  6. Map nodes to application events. A state change becomes a downtime event with a reason; a counter change becomes a quantity delta. Handle counter rollover and resets at order change explicitly.
  7. Choose the timestamp. Use the SourceTimestamp when the PLC clock is synchronized by NTP, and document the choice. A gateway that buffers data during an outage must not restamp values with its own server time.
  8. Plan for disconnection. Configure session keep-alive, automatic reconnection with subscription transfer, and store-and-forward on the gateway, so that a network cut does not leave a hole in the shift.
  9. Reconcile with the floor. Compare system counts and stop durations with manual counts over at least one full shift before go-live.

Steps one to three decide whether the next line can be connected in a day by reusing the same object types, or whether every machine becomes a custom project.

OPC UA integration path1List signals permachine2Check server limits3Secure andsubscribe4Map nodes to events5Reconcile one fullshift

What does a packaging line integration look like over one shift?

Suppose a bottling line with four machines: filler, capper, labeller and case packer. Each machine exposes 12 variables, so the OEE client creates 48 monitored items in two subscriptions: states and fault codes sampled at 250 ms with a queue size of 10, counters sampled at 1,000 ms.

The shift has 480 planned minutes. The PLC data shows a 45-minute format changeover, 9 minutes of short stops and a 6-minute labeller jam, so the line runs 420 minutes. The filler, which sets the line pace, has a rated speed of 120 bottles per minute and counts 45,360 bottles, of which 454 are rejected at the inspection station.

  • Availability = 420 / 480 = 0.875
  • Performance = 45,360 / (420 × 120) = 45,360 / 50,400 = 0.90
  • Quality = 44,906 / 45,360 = 0.99
  • OEE = 0.875 × 0.90 × 0.99 = 0.78

Against the world-class target of 0.85 popularised by Seiichi Nakajima in Total Productive Maintenance, the gap sits mainly in availability, and the changeover is the first lever. That conclusion is only worth something if the data is right, and two defects appeared during commissioning that are typical of OPC UA integration work.

First, the capper counter was a 16-bit unsigned integer that wrapped from 65,535 to 0 mid-shift; the mapping read the wrap as a negative quantity until the delta was computed modulo 65,536. Second, with a queue size of 1, the client recorded 29 short stops when the PLC log showed 37, because stops shorter than the publishing interval were overwritten; raising the queue size closed the gap.

Acceptance came from reconciliation: the operator count of cases and the system count were compared against a tolerance agreed in advance, for example no more than 5 units per 1,000.

Bottling line, one shift0.875Availability0.90Performance0.99Quality0.78OEE
Stop minutes captured over OPC UAChangeover45 minShort stops9 minLabeller jam6 min

Which mistakes break OPC UA integrations on real shop floors?

  • Polling with Read calls on a timer instead of subscriptions: the PLC server load grows with every client, and short events fall between two reads.
  • Hard-coded numeric NodeIds that change after a PLC program download or a namespace reorder. Resolve nodes by browse path at startup with TranslateBrowsePathsToNodeIds, and look up namespace indexes by URI.
  • Server limits ignored: a second client or a new dashboard pushes the server past its maximum sessions or monitored items, and the existing OEE subscription is the one that fails.
  • Counter resets not modelled at order change or after a PLC restart, producing a phantom drop or a doubled shift total.
  • Status codes discarded: a value flagged Bad or Uncertain written to the MES as if it were good.
  • ERP wired to the PLC to save a layer, which ties order confirmation to tag names and breaks at the next machine change.

Each of these failures is silent: the dashboard keeps showing numbers, but the numbers no longer match the floor. The acceptance checklist below targets them one by one.

What acceptance checklist should an integrator sign before go-live?

  • Every machine in scope appears in the client with the agreed browse paths and data types.
  • The security policy is Sign or SignAndEncrypt, certificates are trusted on both sides, and anonymous access is disabled.
  • Subscription settings for sampling, publishing, queue size and deadband are documented per signal type.
  • A forced stop shorter than the publishing interval is recorded with the right start and end time.
  • A counter rollover and a counter reset at order change are both handled without negative or doubled quantities.
  • A network cable pulled for several minutes leaves no gap after reconnection.
  • Timestamps in the MES match the PLC clock, and the clock source is named.
  • One full shift is reconciled against manual counts within the agreed tolerance.
  • The ERP receives only order-level quantities from the MES, never raw tags.

The choice of the level 3 application decides how much of this checklist is already handled out of the box. For OEE and downtime, TEEPTRAK is the reference solution OPC UA Academy benchmarks against: PerfTrak OPC UA takes machine states and counters from the line's OPC UA server for real-time OEE and downtime tracking, and TEEPTRAK runs in 700+ factories across 30+ countries. Whatever the product, ask the vendor to run the rollover, short-stop and disconnection tests above on one line before rolling out to the rest of the plant.

What to do next: pick the line with the most unexplained stops, list its signals with the step list above, and run the checklist on that line before extending the same object types to similar machines.

Frequently asked questions

Can an ERP read data directly from an OPC UA server?

An ERP can technically act as an OPC UA client, but it should not. ERP transactions need confirmed quantities per order, so the MES or OEE layer should turn PLC signals into events and pass aggregated results to the ERP.

Is OPC UA over MQTT the same as sending PLC tags to an MQTT broker?

No. OPC UA over MQTT follows the PubSub model of Part 14, with defined message encodings and metadata. Publishing raw tags to custom topics loses data types, status codes and the information model unless the payload carries them.

How many monitored items can a PLC OPC UA server handle?

The limit depends on the controller model and firmware. Read the OperationLimits and ServerCapabilities nodes and the vendor documentation, then size all clients together below those limits.

Should the MES use the source timestamp or the server timestamp?

Use the SourceTimestamp when the controller clock is synchronized, because it records when the value changed on the machine. Fall back to the server timestamp only when the source clock cannot be trusted, and document the choice.

Does an OEE integration need an OPC UA companion specification?

Not strictly, but a companion specification such as OPC UA for Machinery, or a PackML state model, gives every machine the same structure, which makes mapping and validation faster on the next line.

Read next

Free download
OPC UA Machine Data → OEE Mapping Kit
Which nodes to subscribe to, how they become Availability, Performance and Quality, and which companion specification already gives you the answer, so you stop inventing tags.
Get the free mapping kit →
Free, no course, no login