OPC UA Overview
TheOPCUA route enables communication with OPC UA servers, providing a standardized, cross-platform protocol for industrial automation. It supports multiple authentication modes, security policies, and both NodeId and BrowsePath addressing.
Basic Syntax
Connection Configuration
OPCUA_CONFIG Parameters
OPC UA server endpoint URL (e.g.,
opc.tcp://localhost:4840).Authentication mode:
0- Anonymous (no authentication)1- Username/Password2- Certificate
Username for authentication (required if AUTH_MODE is 1).
Password for authentication (required if AUTH_MODE is 1).
Enable security mode. Default: false.
Security policy level:
0- None1- Basic128Rsa152- Basic2563- Basic256Sha2564- Aes128_Sha256_RsaOaep5- Aes256_Sha256_RsaPss
Message security mode:
0- None1- Sign2- SignAndEncrypt
Automatically accept untrusted server certificates. Default: false.
Suppress nonce validation errors. Default: false.
Connection timeout in milliseconds. Default: 90000.
Security Configuration
- Anonymous (No Security)
- Username/Password
- Certificate Authentication
For development or trusted networks:
NodeId Addressing
OPC UA uses NodeIds to identify variables. The format is:ns=<namespace>;s=<identifier> or ns=<namespace>;i=<numeric_id>
| Format | Example | Description |
|---|---|---|
| String identifier | ns=2;s=Channel1.Device1.Tag1 | Most common, human-readable |
| Numeric identifier | ns=2;i=1234 | More efficient, used by some servers |
| GUID identifier | ns=2;g=12345678-1234-1234-1234-123456789012 | Globally unique identifiers |
Finding NodeIds
Use an OPC UA browser tool (like UaExpert, Prosys OPC UA Browser, or similar) to explore the server’s address space and find the correct NodeIds.BrowsePath Mode
For servers that support it, you can use symbolic paths instead of NodeIds:Enable BrowsePath mode - treat all TAG addresses as browse paths instead of NodeIds.
Root path for browsing when USE_BROWSE_PATH is enabled. Default: Objects.
BrowsePath Example
Data Types
| Data Type | OPC UA Type | Description |
|---|---|---|
BOOLEAN / BOOL | Boolean | True/False value |
SBYTE / SINT | SByte | Signed 8-bit integer |
BYTE / USINT | Byte | Unsigned 8-bit integer |
INT16 / INT / WORD | Int16 | 16-bit integer |
UINT16 / UINT | UInt16 | Unsigned 16-bit integer |
INT32 / DINT | Int32 | Signed 32-bit integer |
UINT32 / UDINT / DWORD | UInt32 | Unsigned 32-bit integer |
INT64 / LINT | Int64 | Signed 64-bit integer |
UINT64 / ULINT / LWORD | UInt64 | Unsigned 64-bit integer |
FLOAT / FLOAT32 / REAL | Float | 32-bit floating point |
DOUBLE / FLOAT64 / LREAL | Double | 64-bit floating point |
CHAR | Char | Single character |
WCHAR | WChar | Wide character |
TIME | Time | Time duration |
DATE | Date | Date value |
TOD | TimeOfDay | Time of day |
STRING | String | Unicode string (configurable STRING_SIZE) |
TAG Configuration
Complete TAG Example
TAG Parameters
Address Configuration
Address Configuration
OPC UA NodeId (e.g.,
ns=2;s=MyVariable or ns=2;i=1234) or BrowsePath if USE_BROWSE_PATH is enabled.OPC UA data type:
BOOLEAN, BYTE, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING.Indicates if the value is an array. Default: false.
Value Transformation
Value Transformation
Filtering
Filtering
Publishing
Publishing
Event-Based Operations
For on-demand OPC UA operations (not polling), use the EVENT syntax. Publish a message to SOURCE_TOPIC to trigger the operation; the route executes it and publishes the result to DESTINATION_TOPIC.Supported Operations
| Operation | Description | Query Parameters |
|---|---|---|
READ | Read a node value on demand | node_id, data_type |
WRITE | Write a value to a node | node_id, data_type, value |
Query Parameters
| Parameter | Description | Example |
|---|---|---|
operation | Operation type: READ or WRITE | READ |
node_id | OPC UA NodeId (string or numeric) | ns=2;i=2, ns=2;s=Process.Temp |
data_type | OPC UA data type | INT32, FLOAT, DOUBLE, STRING |
value | Value to write (WRITE only) | 42, 23.5, "hello" |
Read Example
Read a node value on demand:Write Example
Write a FLOAT value to a node on demand:Complete Examples
- Basic Connection
- Secure Connection
- BrowsePath Mode
- Array Values
- Kepware Connection
- Combined (Cyclic + On-Demand)
Simple OPC UA connection with anonymous access:
Security Best Practices
Use Encryption in Production
Use Encryption in Production
Always enable security for production deployments:
Don't Auto-Accept Certificates
Don't Auto-Accept Certificates
In production, properly configure certificate trust:Instead, exchange certificates between client and server during commissioning.
Use Strong Authentication
Use Strong Authentication
Prefer username/password or certificate authentication over anonymous:
Troubleshooting
Connection Timeout
Connection Timeout
- Verify endpoint URL is correct
- Check firewall allows TCP port (usually 4840)
- Ensure server is running and accessible
- Try increasing TIMEOUT value
Security Rejection
Security Rejection
- Verify security policy matches server configuration
- Check certificate trust (may need to accept in server)
- For testing, try
WITH AUTO_ACCEPT_UNTRUSTED_CERTIFICATES "true" - Ensure client certificates are properly configured
NodeId Not Found
NodeId Not Found
- Use OPC UA browser to verify correct NodeId
- Check namespace index (ns=) is correct
- Verify node exists in server’s address space
- Try BrowsePath mode if NodeId is unclear
Authentication Failed
Authentication Failed
- Verify username and password
- Check user has appropriate permissions
- Ensure AUTH_MODE matches server requirements
Incorrect Values
Incorrect Values
- Verify DATA_TYPE matches server variable type
- Check IS_ARRAY setting for array values
- Verify SCALING and OFFSET calculations
Next Steps
Siemens S7
Direct connection to Siemens PLCs.
ADS (Beckhoff)
Connect to TwinCAT systems.

