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.
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
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.Data Types
| Data Type | OPC UA Type | Description |
|---|---|---|
BOOLEAN | Boolean | True/False value |
SBYTE | SByte | Signed 8-bit integer |
BYTE | Byte | Unsigned 8-bit integer |
INT16 | Int16 | Signed 16-bit integer |
UINT16 | UInt16 | Unsigned 16-bit integer |
INT32 | Int32 | Signed 32-bit integer |
UINT32 | UInt32 | Unsigned 32-bit integer |
INT64 | Int64 | Signed 64-bit integer |
UINT64 | UInt64 | Unsigned 64-bit integer |
FLOAT / FLOAT32 | Float | 32-bit floating point |
DOUBLE / FLOAT64 | Double | 64-bit floating point |
STRING | String | Unicode string |
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 read/write operations:Complete Examples
- Basic Connection
- Secure Connection
- BrowsePath Mode
- Array Values
- Kepware Connection
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

