OPC-UA
The OPC-UA driver combines server and client functionalities in a single driver.
The name of this driver is: opcua
The routing address of the first OPC-UA driver is 1620
The data point file for the first OPC-UA driver is: opcua1.txt
The configuration file for the global settings of the first OPC-UA driver is: opcua1.cfg
The path for certificates is: ./opcua1/
For the OPC-UA driver as well as all other gateway drivers the data point definitions are as follows:
Type | Description |
---|---|
M | Integer value (binary data points, counters) which can/shall only be read by the gateway |
S | Integer value which can be either read or written by the gateway. |
X | Floating point value (with decimal place) which can/shall only be read by the gateway |
Y | Floating point value (with decimal place) which can be either read or written by the gateway. |
A | String is used e.g. in BACnet Trends and ESPA 4.4.4 data points |
The OPC-UA addresses are defined as follows:
[<modifier> <system> <NodeId>; <specialType>] [<modifier> <system> <<ns>;<Id>; <specialType>]
Description | Value |
---|---|
modifier | M, S, X, Y (Sets the OPC-UA AccessLevel for the datapoint/node) |
system | Directs the driver to act either as Server (Srv) or as Client (Cli) |
NodeId | Typical OPC-UA NodeId, terminated with a semicolon (';') The Namespace (ns) is part of an NodeId. When it's omitted, the ns will point\\to Namepsace 0 (defined by http://opcfoundation.org/UA/). This namespace includes predefined addresses of OPCFoundation. To avoid conflicts it is recommended to use ns=1 or ns=2! ns=1 : Namespace-Index 1, already defined by opcua configuration parameter ApplicationUri ns=2 : Namespace-Index 2, optional and needs to be defined by opcua configuration parameter Namespace i=numeric (z.B.: ns=1;i=4711;) s=string (z.B.: ns=1;s=current-time;) g=guid (z.B.: ns=1;g=C496578A-0DFE-4b8f-870A-745238C6AEAE;) Bytestring (b) is currently not supported. |
specialType | Optional: Reserved for special types like the Failure-Datapoint (failure) or the BadTime-Indication-Datapoint (badtime). All special types are and should be read-only! |
Format
The Format tells the driver about the datatype of the datapoint.
Possible values are:
Value | Description |
---|---|
BIT | Boolean true or false |
SINT8 | 8 bit signed integer |
UINT8 | 8 bit unsigned integer |
SINT16 | 16 bit signed integer |
UINT16 | 16 bit unsigned integer |
SINT32 | 32 bit signed integer |
UINT32 | 32 bit unsigned integer |
SINT64 | 64 bit signed integer |
UINT64 | 64 bit unsigned integer |
FLOAT32 | 32 bit float |
FLOAT64 | 64 bit float = double |
Displayname
Sets the OPC-UA Displayname of the datapoint
Description
Sets the OPC-UA Description of the datapoint
Examples
[A Srv ns=1; i=9;]
name = Timestamp format = STRING
[M Cli i=4712;] name = Client1 Datapoint (readonly) on namespace 0 index 4712 format = SINT16 [S Cli i=815;] name = Client9 Datapoint (read-/writeable) on namespace 0 index 815 format = UINT16 [M Cli ns=1; i=4710; failure] name = Cl1 Failure-Datapoint on namespace 1 index 4710 format = SINT32 [M Cli ns=1; s=FailureTime; badtime] name = Client 1 Time-Failure-Datapoint on namespace 1 by name "FailureTime" format = SINT32 [X Cli ns=2; s={Device,201};{BinaryInput,4016};PresentValue;] name = Client-2 BI-4016 format = FLOAT64 [Y Srv ns=1; s=some_value;] name = Server Datapoint (read-/writeable) on namespace 1 by name "some_value" format = FLOAT32 ua_displayname = Server Datapoint 'some_value' ua_description = another dp [Y Srv ns=1;g=C496578A-0DFE-4b8f-870A-745238C6AEAE;] name = Server Datapoint (read-/writeable) on namespace 1 by guid "C496578A-0DFE-4b8f-870A-745238C6AEAE" format = FLOAT32
Driver-Configuration
Common Settings (Section: OPC_UA)
Param | Default | Type | Range | Description |
---|---|---|---|---|
PollInterval | 3 | int | 0-255 | Timevalue (1/100 second) to switch through the Communication-Systems (e.g. 1 Server + 2 Clients = 3 Communication-Systems) Keep this value as low as possible for the use of a server! |
CommandsPerStep | 3 | int | 0-255 | Defines the amount of commands to be executed within one poll. e.g. 3 systems and 3 commands are resulting in maximum of 9 commands per cycle. Keep it balanced with your communication systems |
MaxRetries | 3 | int | 0-255 | Number of Retries. After exceeding the limit, a failure is set to the communication system! |
IsClient | 0 | int | 0-1 | Sets the driver to server- or client-mode |
Server Settings (Section: Server)
Param | Default | Type | Range | Description | |
---|---|---|---|---|---|
Connection | Interface | LAN1 | string | Defines on which interface the server socket will listen. Possible values are: - LAN1 for eth0 only - LAN2 for eth1 only - all for no exclusive binding |
|
PortNumber | 4840 | int | 1-65534 | Defines Port Number of Server | |
UserTokenType | anonymous | string | - anonymous - username („gw“ & „service“) - certificate |
||
SecurityMode | 0 | int | 0-2 | - 0 „None“ - 1 „Sign“ - 2 „Sign and Encrypt“ |
|
Encryption | none | string | To use the encryption, the SecurityMode must not be 0 (None) - „none“ - „RSA“ - „B256“ - „SHA“ (With encryption enabled, the ApplicationUri needs to match the URI from the certificate) |
||
Certificate | „“ | string | Certificate-File (e.g.: „/ugw/config/opcua1/server_cert.der“) | ||
PrivateKey | „“ | string | PrivateKey-File (e.g.: „/ugw/config/opcua1/server_key.der“ | ||
Namespaces | ApplicationUri | http://www.mbs-solutions.de/OPCUA/ | uri | Namespace 1 (With encryption enabled, the ApplicationUri needs to match the URI from the certificate) |
|
Namespace | „“ | uri | Namespace 2 (optional) | ||
Discovery-Client | RegisterServerAt | uri | Registers the OPC-UA server at Discovery-Server (e.g. opc.tcp://192.168.7.111:4840) - Currently, only open62541-Servers are supported! - A Server isn't able to self-register itself leads to a timeout |
||
RegisterPeriod | 600 | int | Re-Register frequency in seconds | ||
RegisterDelay | 500 | int | Delays the first registry up to x milliseconds | ||
RegisterTimeout | 2 | int | Register-Timeout in seconds |
At this point the server is only supporting two users!
Username | Password |
---|---|
service | SERVICE |
gw | GATEWAY |
Client Settings (Section: Client)
Param | Default | Type | Range | Description | |
---|---|---|---|---|---|
Connection | Timeout | 5 | int | 0-4294967295 | Response Timeout in seconds (5 seconds) |
SecureChannelLifeTime | 36000 | int | 0-4294967295 | Secure Channel Lifetime in seconds (60 * 60 * 10 = 10 hours) | |
PollMode | 0 | int | 0-1 | Sets how the client recognize value changes: - 0 for subscriptions - 1 for polling |
|
EndPointUrl | opc.tcp://opcua-srv:4840 | string | ServerEndPoint for the Client | ||
UserTokenType | anonymous | string | - anonymous - username - certificate |
||
SecurityMode | 0 | int | 0-2 | - 0 „None“ - 1 „Sign“ - 2 „Sign and Encrypt“ |
|
Encryption | none | string | To use the encryption, the SecurityMode must not be 0 (None) - „none“ - „RSA“ - „B256“ - „SHA“ |
||
Certificate | „“ | string | Certificate-File (e.g.: „/ugw/config/opcua1/client_cert.der“ | ||
Privatekey | „“ | string | PrivateKey-File (e.g.: „/ugw/config/opcua1/client_key.der“ | ||
Username | „“ | string | username for login (or empty), mandatory if UserTokenType = username | ||
Password | „“ | string | password for login (or empty), mandatory if UserTokenType = username |