27 OPC UA: Companion Models and Implementation
More
Depth: Practitioner
Progress saves as you read. Mark sections complete as you go; your progress appears in the sidebar.
- Podcast audio coming soon
- Character narration audio coming soon
27.2 Learning Objectives
By the end of this chapter, you will be able to:
- choose OPC UA companion specifications for a domain
- plan an implementation with semantic and security evidence
- evaluate OPC UA integration in a practical plant workflow
27.3 Choose a Model the Machines Can Share
The OPC Foundation provides base specifications. A companion specification defines a standardized information model for an industry domain. For packaging states and production counters, the bottling team should examine PackML. OPC UA for Machinery supplies a general manufacturing baseline machine model; EUROMAP addresses plastics and rubber machines; MTConnect addresses CNC and machining-center data models. ISA-95 supports enterprise integration between manufacturing execution systems (MES) and enterprise resource planning (ERP), while PLCopen covers motion-control coordination and reusable machine logic.
These models offer common interfaces across vendors, less custom mapping, and industry consensus on data organization. For the bottling team, the benefit is a shared interpretation of machine state and production count across vendors. That benefit depends on selecting a model that describes the equipment domain; generic state vocabulary does not make a machining model a packaging model. Conformance testing supports interoperability, but the model name alone does not guarantee plug-and-play integration. Record the supported version, tests, and local extensions so clients know which behavior they can rely on.
Read Figure 1 through its five steps. The base node model is generic; the companion layer adds domain types shared by peer machines. The site-specific extension introduces local meaning and can quietly break integration if undocumented. Conformance evidence and the client contract make those assumptions visible. A valid server can still be hard to integrate when its local rules are unclear.
27.4 Fit the Runtime and Plan Recovery
With the model chosen, check where it can run. OPC UA spans operating systems, hardware, and languages, from embedded PLCs and gateways to historians, MES, and enterprise servers. Embedded devices may have only megabytes of RAM and processors rated in MHz. Nano or Micro profiles limit required capabilities; prioritize reliability and verify subscription support rather than assuming every embedded server offers complex subscriptions. Server-class implementations can support high-performance subscriptions, complex models, and enterprise integration, but their supported profiles still determine available features.
Availability also needs explicit design. Server redundancy provides multiple servers with the same address space; client failover reconnects to a backup; network redundancy supplies dual Ethernet paths. Test the combination the plant actually uses.
For session recovery, subscription transfer can preserve subscriptions when the receiving server supports the required state. It does not automatically copy them to an independent backup. Sequence numbers identify missing notifications and support recovery when notifications remain available for retransmission. Secure-channel renewal rotates security tokens and keys. These mechanisms address different parts of continuity, so reconnection alone is insufficient evidence of complete recovery. Verify whether the historian resumes with the expected notifications and model, and distinguish a recovered connection from recovered data. Reliability has priority over adding features that the embedded devices cannot support.
27.5 Tune Changes Without Hiding the Process
The next problem is load. A publishing interval sets the subscription’s notification publishing cycle; the chapter’s typical range is 100 ms–5 s. The sampling interval controls how often the server samples an underlying value and can be faster. Queue size bounds buffered changes between publications. Lifetime count bounds how many publishing intervals a subscription can survive without available client Publish requests.
Read several nodes in one request, and use an indexed range to retrieve only needed array elements. Group related monitored items in subscriptions. Apply dead-band filtering to report changes only beyond a configured threshold, such as a temperature change greater than 0.5°C. Changes within the deadband are not sent; retain raw history separately when needed. For variables fluctuating within tolerance, filtering reduces notifications only when those small changes can safely be omitted.
Batching combines variable updates into messages and reduces per-message overhead. In the calculator’s simplified model, a 24-byte header shared by 10 variables contributes bytes per variable. This assumed header size is a sizing input, not a universal OPC UA wire cost. Validate deadband and queue settings against actual process data before treating the estimate as a capacity plan.
A historian receiving 2,000 variables across 20 PLCs at 100 ms can miss updates during bursts. If a trace shows a subscriber queue overflowing, size buffering from burst duration and drain rate, and filter confirmed noise. Sustained overload needs more capacity or a lower rate. A different trace requires a different response: values arriving 3 seconds late with no overflow and a 3-second publishing interval call for a cadence closer to the required 1-second trends, after checking capacity.
27.6 Put Each Consumer Behind the Right Boundary
Tuning makes sense only in its architecture. Figure 2 places OPC UA between real-time operational technology (OT) and operations or enterprise consumers. Keep an owner and a boundary rule at each step.
Read downward from Level 4: Enterprise, where ERP and business planning access analytics through REST APIs. Next, Operations shows cloud platforms receiving publish-subscribe data over MQTT. Supervisory control places SCADA systems in the role of OPC UA clients that consume data. Direct control places edge gateways in the server role, where they aggregate data. At the bottom, Field devices communicate through native industrial protocols. These boundaries connect local operational systems to operations and enterprise consumers. OPC UA supplies structured meaning without making cloud software responsible for deterministic control.
Read upward from field devices: native protocols carry fast local signals, edge gateways aggregate them as OPC UA servers, SCADA consumes them as clients, cloud platforms receive publish-subscribe data over MQTT, and enterprise applications access analytics through REST APIs. OPC UA bridges PLC control and operations integration across ISA-95 Levels 0–3; MES operates at Level 3, while ERP operates at Level 4. It supplies structured meaning without making cloud software responsible for deterministic control.
Three integration patterns meet different needs. In PLC to Cloud, an embedded PLC server feeds an edge subscriber, which publishes to an MQTT broker for cloud consumption. In Multi-vendor Integration, each vendor exposes a server; a central OPC UA aggregator collects the models into a unified namespace, giving SCADA one endpoint. In Legacy Integration, a gateway converts Modbus/PROFIBUS data into a standardized model for modern clients while existing equipment remains unchanged.
The bottling plant combines these patterns. Gateways can expose Modbus RTU serial and PROFINET Ethernet data through one modeled namespace while existing control links remain in place. Industrial Protocols compares Modbus, PROFINET, and EtherCAT when deciding where such bridges belong.
Use client-server interaction for SCADA/HMI requests and configuration. PubSub supports decoupled distribution over UDP, Ethernet, or MQTT mappings; consider MQTT for cloud telemetry. Timing constraints determine which pattern fits, as Real-Time Requirements and ISA-95 explains. Selected read-only datasets should cross an edge or demilitarized zone (DMZ) boundary. Operational write methods stay within approved OT paths unless remote authorization, safety review, and recovery are engineered.
27.7 Test the Business Case Against Site Assumptions
A shared integration layer also needs an operating-cost case. Compare custom point-to-point integration with OPC UA using site estimates. Calculator defaults are planning placeholders, not vendor quotes or guaranteed savings.
In Year 1, gateways and software can increase costs, while reduced integration labor may compensate. In Years 2–3, lower maintenance can produce positive return on investment (ROI) if models, gateways, and certificate lifecycles are easier to operate than the custom alternative. In Years 4–5, standardized onboarding may reduce the effort to add equipment and increase savings.
The model omits outage windows, validation, vendor support, license terms, cybersecurity review, and ongoing namespace and certificate ownership. Include these in the plant’s decision rather than treating a three-year scenario output as an industry benchmark. The maintenance-analytics goal also needs usable data: Predictive Maintenance develops condition-monitoring and ML-based failure-prediction use cases for the collected values.
27.8 Release the Bottling Migration With Evidence
Return to the bottling line with three steps. First, inventory and map protocols. Identify native OPC UA servers and record endpoint policies, namespaces, and writable nodes. Put legacy serial and vendor-specific Ethernet sources behind gateways that add asset names, units, quality codes, timestamps, and references. Separate SCADA/HMI operational contracts from historian, MES, and cloud analytics contracts.
Second, implement the architecture. SCADA browses, reads, subscribes, and performs approved writes through native servers or an aggregator. Gateways preserve a unified namespace instead of flattening equipment into anonymous tags. Cloud consumers receive selected read-only datasets through the edge or DMZ broker, without direct control-network sessions.
Third, tune by purpose. Preserve every meaningful safety/interlock transition and test queue overflow. Bound sampling and queues for the control cell’s diagnostic needs. Apply deadband to quality metrics only when the process owner confirms small changes are noise. Dashboards and OEE can use slower aggregates when operators do not require every raw sample.
An endpoint exposing thousands of PLC tags without units, quality, hierarchy, or ownership is connected but not integrated. Model assets, variables, methods, and references. Give trust lists, renewal, user identity, role mapping, rejected-client handling, and endpoint policy named owners before release; neglected certificate expiry can turn a maintenance window into an outage.
OPC UA’s layered security includes X.509 application certificates for application identity and mutual authentication, message signing and encryption, user authentication options, and audit logging. Legacy Modbus and PROFIBUS lack these native protections. Never use Security Policy “None” in production. Release only when reviewers can trace one value from controller or gateway through namespace and security policy into historian or dashboard, preserving unit, quality, timestamp, owner, allowed writes, and the decision it supports.
Summary
The bottling migration joins working equipment through native servers and gateways while preserving shared meaning. Companion specifications reduce custom mapping when versions and extensions are documented. Subscription settings must preserve significant changes, and each consumer needs an explicit boundary and contract.
OPC UA’s self-describing, object-oriented model of nodes, references, and attributes helps clients discover capabilities across platforms. Security and recovery still require configured policies, tested behavior, and named owners. A deployment is ready when its evidence connects a source value to an authorized operational or analytics use.
Start with the industry’s companion model, tune from process evidence, and trace meaning and authorization through every boundary before release.

