opcua-adapter
is an MTConnect adapter process to collect data from OPC UA servers and provide the stream updates for MTConnect Agent according to the requirements of MTConnect specification.
Usage:
opcua-adapter [config file - default is opcua-adapter.cfg]
# This configuration is for MetaAgent opcua-adapter
#
# OPC UA Server connection info
#
OpcUAServer:
name: OPCUA
# url: <opcua server's url>
url: opc.tcp://milo.digitalpetri.com:62541/milo
#
# applicationUri: <application name, for some OPC UA server, they may require it to match the client's certificate and/or the server's application name>
# default is urn:open62541.server.application
#
# namespaceFilter: <comma separated list of node's id using regex matching. stream data only from this node or below>
namespaceFilter: ns=2;s=File.*, \ # top nodes allows regex
ns=2;s=Dynamic/RandomDouble, \ # any individual node and their children
ns=2;s=Dynamic/RandomFloat, \
ns=2;s=Dynamic/RandomInt32, \
ns=2;s=CTT/Static/DA Profile/Analog Type
#
# sampleInterval: <the fastest rate at which OPC UA server's monitored items should be accessed and evaluated (ms)>
# default is 0, indicates that it should use the fastest practical rate
#
# Additional optional connection info
# cert: <location of the certificate file. Format: DER>
# key: <location of the key file. Format: PEM>
# user: <user's id>
# password: <user's password>
#
# certificateCheck: [true, false]
# default is false
#
# messageSecurityMode: [None, sign, sign&encrypt]
# securityPolicy: [None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128_Sha256_RsaOaep]
#
# messageSecurityMode and SecurityPolicy are only required if the server does not provide discovery service
#
#
# OPC UA MTConnect Adapter setting
#
server:
# port: <port # to listen on>
port: 7878
# licenseKey: <your license key - default is demo mode if not provided>
logging:
# serverity can be debug, info, warn, error or off, default is info
severity: info
#
# suppress timestamp, default is false
# messageOnly: <true or false>
OPCUAServer
url
: The OPC UA server's connection URLapplicationUrl
: Specify the application URL, for some OPC UA servers, they may require it to match the client's certificate and the server's application URL, the default is urn:open62541.server.application.namespaceFilter
: comma-separated list of node's id using regex matching. stream data only from this node or below.sampleInterval
: the fastest rate at which the OPC UA server's monitored items should be accessed and evaluated (ms), the default is 0, indicating that it should use the fastest practical rate.user / password
: the OPC UA server's login credential if required.key /cert
: the location of the client's certificate and its key file.certificateCheck
: Validate the OPC UA server's certificate, the default is false.messageSecurityMode
: None, sign, or sign&encrypt.securityPolicy
: None, Basic128Rsa15, Basic256, Basic256Sha256, or Aes128_Sha256_RsaOaep.server
port
: The port # to listen on
C:\Program Files\MetaAgent\examples\opcua-adapter>opcua-adapter
Metalogi MetaAgent - OPCUA/MTConnect Adapter 2.2.0.600 - built on Wed Oct 11 22:28:27 2023
[2023-10-29T06:16:27] info Settings are loaded from opcua-adapter.cfg
[2023-10-29T06:16:27] info Product OPC UA <=> MTConnect is verified
[2023-10-29T06:16:27] warn AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2023-10-29T06:16:31] warn The server returned Endpoints with a different EndpointUrl opc.tcp://milo.digitalpetri.com:62541/milo/discovery than was used to initialize the connection: opc.tcp://milo.digitalpetri.com:62541/milo/discovery. Some servers require a complete match of the EndpointUrl/DiscoveryUrl (including the path) to return all endpoints.
[2023-10-29T06:16:32] info Top branch selected: Files [ns=2;s=Files]
[2023-10-29T06:16:44] info Node selected: RandomDouble [ns=2;s=Dynamic/RandomDouble]
[2023-10-29T06:16:44] info Node selected: RandomFloat [ns=2;s=Dynamic/RandomFloat]
[2023-10-29T06:16:44] info Node selected: RandomInt32 [ns=2;s=Dynamic/RandomInt32]
[2023-10-29T06:16:45] info Node selected: Analog Type [ns=2;s=CTT/Static/DA Profile/Analog Type]
[2023-10-29T06:16:48] info # of monitor nodes = 38
[2023-10-29T06:16:48] info # of event nodes = 0
[2023-10-29T06:16:48] info Create subscription succeeded, id 6249 for data changes
[2023-10-29T06:16:48] info Waiting for connection to OPC UA Server...
[2023-10-29T06:16:48] info OPC UA Server is connected. Start accepting connections.
[2023-10-29T06:16:48] info Server started, waiting on port 7878