Skip to main content

Dev Station Technology

Opc ua integration guide

OPC UA Integration: Connecting Machines For Industry 4.0

OPC UA is a platform-independent, service-oriented protocol that exchanges contextualized data securely between factory-floor machines and enterprise IT systems. It replaced OPC Classic, runs on any platform and is the usual standard for Industry 4.0 integration.

Key takeaways

  • Protocol: OPC UA is a platform-independent protocol for secure data exchange between machines and enterprise systems.
  • Integration: Integration takes 3 steps: connect securely, browse the Address Space and subscribe to nodes.
  • Security: Use SignAndEncrypt with the Basic256Sha256 policy for sensitive OT data.
  • Pilot: Validate one non-critical asset with UaExpert before writing production code.
  • Dev Station: Dev Station builds OPC UA clients, gateways and cloud pipelines for US and UK plants.

01

What is OPC UA?

OPC Unified Architecture (OPC UA) is a platform-independent, service-oriented communication protocol developed and maintained by the OPC Foundation for secure and reliable data exchange in industrial automation. It is the successor to OPC Classic, which was bound to Microsoft DCOM and limited to Windows. OPC UA, by contrast, runs cross-platform, from embedded PLCs to cloud servers, and it is the de facto standard for IT/OT convergence.

What sets OPC UA apart from legacy protocols is its self-describing information model. Rather than exposing a flat list of memory tags (like DB1.DBD4), OPC UA models data into a hierarchical, semantic Address Space where every node carries rich metadata: NodeId, BrowseName, DataType, AccessLevel, and Description. This contextualization lets an IT developer who has never touched a PLC browse Objects > Machine_1 > MainMotor > MotorSpeed and immediately understand it is the rotational speed in RPM, which removes manual tag mapping.

Key insight: OPC UA is not just a transport layer. It is a full information modeling framework. The combination of secure transport, rich metadata, and standardized companion specifications (e.g., OPC UA for Machinery, Robotics, Machine Vision) is what makes it the communication backbone of Industry 4.0.

02

How does OPC UA work?

OPC UA operates on a client-server architecture (with an additional Pub/Sub variant for brokerless or broker-based messaging). The server, typically embedded in a PLC or running as software on an industrial PC, exposes a modeled Address Space. The client (a SCADA system, MES, IoT gateway, or custom application) connects, authenticates, browses, and subscribes to data.

The built-in security stack

Unlike older industrial protocols that assume a closed network, OPC UA was designed with cybersecurity from the ground up. Every connection is authenticated and encrypted using X.509 certificates and configurable security policies.

X.509 Certificate Exchange

Client and server present digital certificates. The server initially places the client cert in a rejected folder; an administrator manually moves it to the trusted list. Mutual trust is established before any data flows.

Security Policies

Negotiated policies like Basic256Sha256 define the encryption and signing algorithms. The message security mode is selected per channel: None, Sign, or SignAndEncrypt (recommended for all sensitive OT data).

Session & Secure Channel

A secure channel protects the transport layer; a session layers user authentication and authorization on top. Sessions can be assigned user identities and role-based access controls on individual nodes.

Address Space Browsing

Once authenticated, the client browses the hierarchical node tree. Each Variable node exposes attributes (NodeId, BrowseName, DataType, AccessLevel, Description) so data is self-documenting, no external spec sheet needed.

Pub/Sub and client-server communication models

OPC UA supports two complementary patterns. The Client-Server model handles request/response interactions (read, write, browse, method call) and subscriptions. The Pub/Sub model decouples publishers from subscribers via a broker (e.g., MQTT) or brokerless UDP multicast, ideal for fan-out to many consumers and cloud-scale scenarios.

Aspect Client-Server (Subscriptions) Pub/Sub
Coupling Tight, client establishes session with a specific server Loose. Publisher does not know subscribers
Best For Control loops, SCADA polling, configuration writes, method calls Cloud telemetry, multi-consumer analytics, edge-to-cloud fan-out
Transport opc.tcp (binary), HTTPS opc.tcp, UDP multicast, MQTT, AMQP
Reliability Acknowledged notifications, retransmission on reconnect Configurable QoS levels; broker handles durability

03

How do you integrate a machine with OPC UA in 3 steps?

Integrating an industrial asset via OPC UA follows a repeatable three-stage process. Whether you are connecting a single Siemens S7-1500 PLC or an entire production line, the workflow is the same.

1

Establish a secure, authenticated connection

Your client first discovers the server endpoint, either via a Local Discovery Server (LDS) or directly via its endpoint URL, e.g. opc.tcp://192.168.1.100:4840. The client then initiates a handshake, presenting its X.509 certificate. The server places the cert in a rejected folder; an administrator moves it to the trusted list. The client likewise trusts the server certificate. Once mutual trust is confirmed, a secure channel is negotiated with a security policy (Basic256Sha256) and message mode (SignAndEncrypt recommended). Finally, a session is created with user credentials and role-based access.

2

Browse the Address Space and identify target nodes

With the session active, the client traverses the Address Space of the server, a hierarchical, mesh-like structure of nodes. You locate the Variable Nodes representing the data points you need (e.g., Objects > Machine_1 > MainMotor > MotorSpeed). For each node, inspect its attributes: NodeId (unique identifier), BrowseName, DataType (Float, Int32, String), AccessLevel (read-only or read/write), and Description. Record the NodeIds. These are what you will subscribe to in the next step.

3

Create a subscription and route data to your target system

The client creates a Subscription on the server, specifying a publishing interval (e.g., 1000ms). Within the subscription, it adds Monitored Items, one for each NodeId. For each item, set a sampling interval and an optional filter (e.g., “notify only if value changes by more than 5%”). The server now monitors those data points and, at each publishing interval, pushes a batch notification of all changes to the client. This report-by-exception model is far more efficient than polling. The received data is then routed to its destination: a time-series database, a MES, a SCADA HMI, or a cloud IoT platform.

Pro tip: Start with a well-defined pilot project on a single non-critical asset. Use a diagnostic client like UaExpert to validate connectivity, browse the Address Space, and confirm data flow before writing production integration code. This de-risks the rollout and builds internal expertise.

04

How does OPC UA compare with other industrial protocols?

OPC UA beats Modbus, MQTT and Profinet on semantic interoperability and built-in security, but it is not always the lightest option at the edge.

The table below compares OPC UA with the most common alternatives.

Protocol Platform Security Data Model Best Use Case
OPC UA Cross-platform Built-in X.509, encryption, RBAC Rich, self-describing Address Space IT/OT convergence, Industry 4.0, semantic interoperability
OPC Classic (DA) Windows / DCOM DCOM (weak, deprecated) Flat tag list Legacy systems, migrate to UA
Modbus TCP Cross-platform None (relies on network isolation) Registers/coils only, no metadata Simple, low-overhead device reads
MQTT Cross-platform TLS, username/password Topic-based payload (no native semantics) Cloud telemetry, low-bandwidth edge
Profinet Siemens-centric Optional (PG/PC security) Fieldbus cycle data Real-time PLC-to-device control

When to Choose OPC UA

You need semantic data models, built-in security, cross-vendor interoperability, and integration with IT/cloud systems. Ideal for MES, SCADA, digital twin, and analytics platforms.

When to Pair with MQTT/Gateway

For cloud fan-out, low-bandwidth WAN links, or when many consumers need the same telemetry. An OPC UA-to-MQTT gateway bridges the semantic richness of UA with the lightweight publish/subscribe of MQTT.

When to Keep Modbus

For simple, deterministic reads on legacy devices where overhead must be minimal. Expose that data upward via an OPC UA server that wraps the Modbus device, preserving both simplicity and interoperability.

Real-Time Control Loops

For sub-millisecond deterministic control (motion, drive synchronization), fieldbus protocols like Profinet IRT or EtherCAT remain necessary. OPC UA complements, it does not replace, real-time fieldbus at the device level.

05

What are the main OPC UA use cases in Industry 4.0?

The main OPC UA use cases are SCADA and HMI modernization, predictive maintenance, edge-to-cloud telemetry and digital twin synchronization.

Secure transport and semantic modeling make OPC UA useful across the industrial stack. The four patterns below have the most impact.

SCADA & HMI Modernization

Replace brittle DCOM-based OPC Classic connections with OPC UA for secure, cross-platform data acquisition from PLCs, drives, and instruments. Ignition and similar platforms natively consume OPC UA.

Predictive Maintenance

Stream vibration, temperature, and current signatures from motors and bearings via OPC UA subscriptions into ML pipelines. Semantic node descriptions let models auto-map features without manual tag sheets.

Edge-to-Cloud Telemetry

An edge gateway (Azure IoT Edge, AWS IoT SiteWise, ThingsBoard) acts as an OPC UA client, collects data, and republishes to the cloud via MQTT or HTTPS. The semantic model can be carried upward using OPC UA over MQTT.

Digital Twin Synchronization

OPC UA companion specifications (e.g., for Machinery, Machine Tools, Robotics) define standardized information models. A digital twin can subscribe to live UA data and mirror the state of the physical asset in real time with full semantic fidelity.

Common pitfall: Firewall configurations between IT and OT networks frequently block opc.tcp port 4840. Coordinate with both teams early, document the required ports and certificate trust flow, and test end-to-end with a diagnostic client before deploying production code.

06

What is the action plan for your first OPC UA integration?

Pick one non-critical asset, validate it with a diagnostic client, then build the integration and scale it.

Follow this sequence to move from concept to a live, secure data pipeline.

1

Inventory assets and select a pilot

Identify a single non-critical machine that already exposes an OPC UA server (e.g., a Siemens S7-1500 PLC or a Kepware KEPServerEX instance). Document its endpoint URL, expected security policy, and the data points you want to capture.

2

Validate connectivity with a diagnostic client

Download UaExpert (free for evaluation) or the open-source opcua-asyncio Python library. Connect, complete the certificate trust exchange, browse the Address Space, and confirm you can read and subscribe to your target nodes.

3

Build the integration and scale

Develop your production client using a mature SDK (.NET, Python, Java, Node.js). Implement subscriptions with appropriate publishing intervals and filters. Route data to your MES, SCADA, or cloud IoT platform. Once the pilot proves value, replicate the pattern across additional assets and standardize on OPC UA companion specifications for enterprise-wide semantic consistency.

Frequently asked questions

Five questions come up most often when teams plan their first OPC UA integration.

What port does OPC UA use?

OPC UA uses port 4840 by default for opc.tcp transport. Firewalls between IT and OT networks often block it, so document the required ports early.

What is the difference between OPC UA and OPC Classic?

OPC Classic is bound to Microsoft DCOM and runs only on Windows. OPC UA runs on any platform, with built-in X.509 security and a self-describing information model.

When should you use Pub/Sub instead of client-server in OPC UA?

Use client-server for control loops, SCADA polling and method calls. Use Pub/Sub for cloud telemetry and fan-out to many consumers through a broker such as MQTT.

Does OPC UA replace fieldbus protocols for real-time control?

No. Sub-millisecond deterministic control still needs fieldbus protocols such as Profinet IRT or EtherCAT, and OPC UA complements them.

Which tool validates an OPC UA connection before writing code?

UaExpert, a diagnostic client that is free for evaluation, and the open-source opcua-asyncio Python library both connect, browse the Address Space and subscribe to nodes.

Dev Station Technology provides consulting and development for OPC UA architecture design, gateway configuration, custom client and server development, and integration with IoT and analytics platforms. Most of its clients work in the United States and the United Kingdom, so client records stay in a cloud tenant owned by the client, in the region its policy requires. Contact the team at sale@dev-station.tech or visit dev-station.tech for a consultation.

Ask an AI about this

Want an AI assistant to summarize or cite this guide?

Click any link below to open the AI with a pre-filled prompt referencing this article:

Talk To Us

Tell us what you are building and what it has to connect to. An engineer answers, and you get a straight view of what the work would take.

Get In Touch →

Related articles

Let's Talk