Skip to main content
Version: 2.0-dev

OPCUAOPC UA Integration Guide

Connect MaestroHub to industrial OPC UA servers for secure read, write, browse, and monitor operations across your production assets. This guide covers connection setup, function authoring, and pipeline integration.

Overview

The OPC UA connector gives you:

  • Secure sessions with selectable security policies, message signing, and certificate trust
  • Namespace-aware browsing to discover tags before wiring them into functions
  • Low-latency read/write calls tuned for both cyclic polling and on-demand commands
  • Real-time subscriptions for event-driven monitoring of node value changes
  • Centralized access control leveraging OPC UA user authentication and Maestro role-based access
Companion Protocols

Combine OPC UA reads with Modbus, MQTT, or REST nodes to blend shop-floor signals with enterprise data.

Connection Configuration

Creating an OPC UA Connection

From ConnectionsNew ConnectionOPC UA, configure the fields below:

OPC UA Connection Creation Fields

1. Profile Information
FieldDefaultDescription
Profile Name-A descriptive name for this connection profile (required, max 100 characters)
Description-Optional description for this OPC UA connection
2. OPC UA Server Configuration
FieldDefaultDescription
Server Hostname-OPC UA server hostname or IP address (e.g., opcua.example.com) - required
Port4840OPC UA server port (1-65535)
Path-Optional server path (e.g., /opcua)

Server URL Format

The full server URL is automatically constructed: opc.tcp://{hostname}:{port}{path}
Example: opc.tcp://opcua.example.com:4840/opcua

3. Security Configuration
3a. Security Policy and Mode
FieldDefaultDescription
Security PolicyNoneOPC UA security policy for message encryption - required
Security ModeNoneOPC UA security mode for message protection - required

Security Policy Options

  • None: No security
  • Basic128Rsa15: Basic 128-bit RSA encryption
  • Basic256: 256-bit encryption
  • Basic256Sha256: 256-bit encryption with SHA-256 (recommended)

Security Mode Options

  • None: No message protection
  • Sign: Messages will be signed for integrity
  • SignAndEncrypt: Messages will be signed and encrypted

Important Validation Rules

  • When Security Policy is None, Security Mode must also be None.
  • When Security Policy is not None, certificates are required.
3b. Certificates

(Only displayed when Security Policy is NOT None)

FieldDefaultDescription
Client Certificate-Client certificate for server authentication (PEM format)
Client Private Key-Private key for client certificate (PEM format, required when certificate is provided)
4. Authentication
FieldDefaultDescription
Authentication TypeAnonymousAuthentication method for OPC UA server access - required
Username-OPC UA server username (required when Authentication Type is UsernamePassword)
Password-OPC UA server password (required when Authentication Type is UsernamePassword)

Authentication Type Options

  • Anonymous: No credentials required
  • UsernamePassword: Requires both username and password
5. Connection Timeouts
FieldDefaultDescription
Connection Timeout (seconds)30Maximum time to establish connection (1-300 seconds)
Request Timeout (seconds)5Maximum time to wait for server response (1-300 seconds)
6. Session Configuration
FieldDefaultDescription
Session Timeout (minutes)60OPC UA session timeout duration in minutes (0-1440, 0 = disabled, max 24 hours)
Reconnect Interval (seconds)1Interval for reconnection attempts in seconds (1-60, max 1 minute)
7. Retry Configuration
FieldDefaultDescription
Max Retries3Maximum number of retry attempts (0-10)
Retry Delay (milliseconds)500Delay between retry attempts in milliseconds (100-10000 ms, 100 ms - 10 s)
8. Connection Labels
FieldDefaultDescription
Labels-Key-value pairs to categorize and organize this OPC UA connection (max 10 labels)

Example Labels

  • environment: production - Deployment environment
  • team: automation - Responsible team
  • protocol: opcua - Connection protocol
  • region: us-east-1 - Geographical region
Notes
  • Security Configuration: When Security Policy is set to anything other than None, certificates become mandatory.
  • Certificate Validation: Private key is required when a client certificate is provided.
  • Authentication: When Authentication Type is UsernamePassword, both username and password fields become required.
  • Server URL: The system automatically constructs the full OPC UA server URL from hostname, port, and path.
  • Session Management: Session timeout can be disabled by setting it to 0, but this is not recommended for production environments.
  • Retry Behavior: The system will attempt reconnection based on the reconnect interval and will retry failed operations according to the retry configuration.
  • Default Port: The standard OPC UA port is 4840.
  • Timeout ranges: All timeout values must be within their specified ranges to ensure proper operation.

Function Builder

Creating OPC UA Functions

After saving the connection, author reusable OPC UA functions:

  1. Open FunctionsNew Function
  2. Choose OPC UA Read, Write, Browse, or Monitor as the function type
  3. Select the OPC UA connection profile you configured
  4. Define target nodes, payload mappings, and execution options
OPC UA Function Creation

Create reusable read, write, browse, and monitor operations for OPC UA assets

Quick Add: Bulk Function Creation

When you need to create multiple OPC UA functions at once, the Quick Add feature accelerates the setup process by allowing batch creation from a table or CSV import.

When to Use Quick Add

  • Onboarding a new OPC UA server with many nodes to monitor
  • Converting existing node lists from spreadsheets or server documentation
  • Rapidly setting up data collection for multiple process variables
  • Standardizing function definitions across similar OPC UA devices

How to Use Quick Add

  1. Navigate to your OPC UA connection in Connections
  2. Click Quick Add Functions button
  3. Choose your input method:
    • Table Entry: Define functions row by row in the interface
    • CSV Import: Upload a prepared CSV file with node definitions
OPC UA Quick Add Interface

Quick Add Functions dialog for OPC UA with table entry and CSV import options

Table Columns

ColumnDescriptionExample
Function NameUnique identifier for the functionReactor_Temperature
TypeOPC UA operationRead Value, Write Value, Browse Nodes
NSNamespace index2
Node IdentifierOPC UA node ID with type prefixs=Sensors.Temp01

Supported Function Types

  • Read Value: Read current value from an OPC UA node
  • Write Value: Write a value to an OPC UA node
  • Browse Nodes: Explore the node structure and discover child nodes
  • Monitor Nodes: Subscribe to value changes and receive real-time notifications

Node Identifier Formats

OPC UA node identifiers must include a type prefix:

  • i=123 - Numeric identifier (e.g., i=2253 for ServerStatus)
  • s=StringId - String identifier (e.g., s=Device.Sensor.Temperature)
  • g=550e8400-e29b-41d4-a716-446655440000 - GUID identifier
  • b=SGVsbG8gV29ybGQ= - Byte string (Base64 encoded)

CSV Import Format

name,type,namespaceIndex,identifier
Temperature,opcua.read,2,s=Sensors.Temp
SetPoint,opcua.write,2,s=Controls.SetPoint
PressureSensor,opcua.read,2,i=1001
BrowseRoot,opcua.browse,0,i=84

Validation Rules

  • Function names must be unique within the connection
  • Namespace index is required (typically 0 for standard nodes, 2+ for custom nodes)
  • Node identifier must follow OPC UA format with type prefix (i=, s=, g=, b=)
  • Identifier format is validated during entry

Best Practices

  • Use meaningful function names that match your process or equipment hierarchy
  • Leverage the Browse function to discover available nodes before creating read/write functions
  • Keep namespace indexes consistent across related nodes
  • Test a small batch first when importing large CSV files
  • Document the OPC UA server's namespace structure for team reference

Read Function

Purpose: Read values from specific OPC UA nodes. Configure node identifiers, data types, and request timeouts with full OPC UA protocol support for real-time data collection.

Configuration Fields

FieldTypeRequiredDefaultDescription
Namespace IndexNumberYes-OPC UA namespace index (0-65535)
Node IdentifierStringYes-OPC UA node identifier with type prefix. Examples: i=123 (numeric), s=StringId (string), g=550e8400-e29b-41d4-a716-446655440000 (GUID), b=SGVsbG8gV29ybGQ= (byte string)
Request Timeout (seconds)NumberNo5Maximum time to wait for server response (1-60 seconds)

Use Cases: Sensor data reading, process variable monitoring, device status checking, real-time data collection

Write Function

Purpose: Write values to specific OPC UA nodes. Configure node identifiers, value types, and write operations with full OPC UA protocol support for control operations.

Configuration Fields

FieldTypeRequiredDefaultDescription
Namespace IndexNumberYes-OPC UA namespace index (0-65535)
Node IdentifierStringYes-OPC UA node identifier with type prefix. Examples: i=123 (numeric), s=StringId (string), g=550e8400-e29b-41d4-a716-446655440000 (GUID), b=SGVsbG8gV29ybGQ= (byte string)
Value to WriteObjectYes-Value to write to the OPC UA node (supports parameters). Example: {"temperature": ((value)), "timestamp": "((now))"}
Request Timeout (seconds)NumberNo5Maximum time to wait for server response (1-60 seconds)

Use Cases: Setpoint configuration, control command sending, parameter updates, device control operations

Browse Function

Purpose: Browse the OPC UA node structure and discover references. Explore node hierarchies, find child nodes, and discover the complete node tree with configurable depth limits.

Configuration Fields

FieldTypeRequiredDefaultDescription
Namespace IndexNumberYes0OPC UA namespace index (0-65535)
Node IdentifierStringYes-OPC UA node identifier to browse. Examples: i=84 (Root folder - standard root node), i=85 (Server object), i=2253 (ServerStatus), s=MyCustomNode (string identifier)
Request Timeout (seconds)NumberNo10Maximum time to wait for server response (1-60 seconds)

Use Cases: Node structure exploration, device capability discovery, server information browsing, hierarchical data navigation

Monitor Function

Purpose: Subscribe to OPC UA node value changes and receive real-time notifications. Unlike read operations that poll for data, monitor functions establish continuous subscriptions that push updates when values change—enabling event-driven automation without constant polling.

Pipeline Trigger

Monitor functions are designed for use as pipeline triggers. When configured, incoming value changes automatically start pipeline executions. See OPC UA Trigger Node for pipeline integration details.

How Monitoring Works

OPC UA monitoring follows a structured workflow:

  1. MaestroHub creates a Subscription on the OPC UA server with a defined publishing interval
  2. One or more Monitored Items are registered for specific nodes
  3. The server samples each node at its configured sampling interval
  4. When values change, the server queues notifications and publishes them to MaestroHub
  5. MaestroHub receives notifications and triggers pipeline executions
  6. Subscriptions remain active until explicitly stopped or the connection ends

This push-based model is optimized for low-latency, continuous telemetry and is essential in industrial environments where many node values change frequently.

Configuration Fields

Monitor function configuration is defined at two levels: subscription parameters that control publishing behavior, and node parameters that define how each node is sampled.

Subscription Parameters
FieldTypeRequiredDefaultDescription
Publishing Interval (ms)NumberNo100Interval in milliseconds at which the subscription publishes notifications to MaestroHub. Lower values provide faster updates but increase network traffic.
PriorityNumberNo0Subscription priority (0–255). When multiple subscriptions have pending notifications, higher priority subscriptions are serviced first. Use 0 if no special priority is needed.
Monitored Nodes

Add one or more nodes to monitor. Each node can have individual sampling settings:

FieldTypeRequiredDefaultDescription
Namespace IndexNumberYes-OPC UA namespace index (0-65535)
Node IdentifierStringYes-OPC UA node identifier with type prefix: i=123 (numeric), s=MotorSpeed (string), g=550e8400-e29b-41d4-a716-446655440000 (GUID), b=SGVsbG8= (byte string)
Sampling Interval (ms)NumberNo0How often the server samples this node. 0 = fastest practical rate, -1 = use publishing interval as sampling interval.
Queue SizeNumberNo10Maximum notifications to buffer for this node (1–1000). Larger queues prevent data loss during bursts but use more memory.
Discard OldestBooleanNotrueWhen the queue is full: true = discard oldest notification and add new one, false = replace the newest notification.

Example Configuration

{
"publishingInterval": 100,
"priority": 0,
"nodes": [
{
"namespaceIndex": 2,
"identifier": "i=123",
"samplingInterval": 0,
"queueSize": 10,
"discardOldest": true
},
{
"namespaceIndex": 2,
"identifier": "s=MotorSpeed",
"samplingInterval": 50,
"queueSize": 5,
"discardOldest": true
},
{
"namespaceIndex": 3,
"identifier": "s=Temperature",
"samplingInterval": 100,
"queueSize": 20,
"discardOldest": false
}
]
}

This configuration creates a subscription with a 100ms publishing interval, monitoring three nodes—each with its own sampling interval, queue size, and discard policy.

Output Data Format

When a monitored node value changes, MaestroHub receives a notification with the following structure:

{
"value": 23.5,
"nodeId": "ns=2;i=123",
"namespaceIndex": 2,
"identifier": "i=123",
"sourceTimestamp": "2024-01-15T10:30:00.000Z",
"serverTimestamp": "2024-01-15T10:30:00.001Z",
"statusCode": "Good"
}
FieldDescription
valueThe current value of the monitored node
nodeIdFull OPC UA node identifier
namespaceIndexNamespace index of the node
identifierNode identifier string
sourceTimestampTimestamp when the value was sampled at the source
serverTimestampTimestamp when the server processed the notification
statusCodeOPC UA status code indicating data quality

Reconnection Behavior

MaestroHub automatically handles connection disruptions to ensure monitoring continuity:

ScenarioBehavior
Connection lostSystem detects disconnection and queues pending operations
Connection restoredSubscriptions and monitored items are automatically recreated
Session timeoutNew session established with all monitors restored
MaestroHub restartAll monitors for enabled pipelines are restored on startup

No manual intervention is required—monitoring continues seamlessly after transient failures.

Best Practices

Sampling and Publishing Intervals

  • Set publishingInterval based on how quickly you need to react to changes (100–1000ms is typical)
  • Set samplingInterval equal to or faster than publishingInterval to avoid missing changes
  • Use samplingInterval: 0 for critical nodes that need the fastest possible updates

Queue Size Selection

  • Use smaller queues (1–10) for real-time dashboards where only the latest value matters
  • Use larger queues (20–100) for data logging where every change must be captured
  • Enable discardOldest: true to always see the most recent values

Node Selection

  • Group related nodes (e.g., sensors on the same machine) into a single monitor function
  • Create separate monitor functions for nodes with different criticality or update requirements
  • Use the Address Space Browser to discover available nodes before configuring monitors

Use Cases: Real-time equipment monitoring, process variable tracking, alarm condition detection, production event streaming, quality metric collection

Using Parameters

Parameters follow the ((parameterName)) syntax and appear in the function editor panel.

ConfigurationDescriptionExample
TypeCoerce runtime values into OPC UA data typesnumber, string, boolean, datetime, buffer
RequiredEnforce presence of the parameterRequired / Optional
Default ValueProvide fallback values for unattended runs0, false, NOW()
DescriptionHelp field to capture node purpose"Target furnace temperature in °C"
OPC UA Function Parameters

Configure parameter validation, defaults, and descriptions for OPC UA calls

Pipeline Integration

Use the OPC UA connection functions you create here as nodes inside the Pipeline Designer to coordinate machine data with the rest of your production flow.

Connector Nodes

Drag in the read, write, or browse node, bind its parameters to upstream outputs or constants, and tune retries or error branches so operators get the right context at the right moment.

If you are planning broader orchestration, review the Connector Nodes page for guidance on where OPC UA nodes fit within multi-system automation patterns.

Trigger Nodes

Use OPC UA Monitor functions as pipeline triggers to start executions automatically when node values change. The OPC UA Trigger Node enables fully event-driven automation—no polling required.

When to use triggers vs. connector nodes:

ApproachUse Case
OPC UA TriggerStart pipelines when specific node values change (event-driven)
OPC UA Read NodeRead values within an already-running pipeline (request-response)
OPC UA Read node in pipeline designer

OPC UA node with function selection, connection, and parameter bindings

Common Use Cases

Event-Driven Equipment Monitoring

Subscribe to temperature, vibration, or energy tags using Monitor functions and automatically trigger pipelines when values change. Forward updates to MQTT, REST, or historian targets for real-time central visibility without polling overhead.

Real-Time Alarm Processing

Monitor alarm condition nodes and trigger immediate notifications or corrective actions when alarms activate. Capture alarm timestamps, acknowledge states, and operator responses in a complete audit trail.

Production Event Streaming

Stream production counters, cycle times, and quality metrics to analytics platforms as they change. Use subscriptions to capture every value change for accurate OEE calculations and trend analysis.

Command and Control

Trigger setpoint updates, mode changes, or alarm acknowledgements based on business rules or operator actions, with MaestroHub logging command details, operators, and timestamps for complete audit trails.