OPC UA Server
This component implements the server side of the OPC UA standard. The component can be used to run a server able to receive requests from clients communicating with the OPC UA standard.
- Accept connection requests from customers through tcp protocol
- Read/write and browse support
- Subscription support
- Loading of xml NodeSet2 data models
The component can be customized through the following options:
- Opcua Server Tcp Port: port of the tcp protocol used for communication
- Opcua Server Application Name: an user friendly descriptive name of the application
- Opcua Server Application Uri: an unique identifier for each running instance.
- Opcua Server Product Uri: used to identify your product and it should refer to your own domain
- Opcua Server Organization Name: name of the server's owner organization
- Path to the NodeSet2 xml file for model loading: path to the xml file in the NodeSet2 format, useful to load the data architecture of the server
For the Opcua Server Application Name and Opcua Server Application Uri, an user can use two labels recognizable by the application: if inside the URIs the words
localhostare used, the system will automatically translate these in the hostname. Both will be replaced by the gateway host name, including the possible domain name part in the first case, without in the latter.
So, for example, if the user sets an ApplicationURI of the type
urn:localhost:myapplication on a gateway called
mypersonalgateway the end result will be
urn:mypersonalgateway:myapplication. Instead, using the
hostname label within the URI, the result will be
urn:mypersonalgateway.mydomain:myapplication, if a domain is available.
Matching between Server and Client Options
To allow communication between the server component and a customer, it is necessary to pay particular attention to the parameters Opcua Server Tcp Port and Opcua Server Application Name: these two are the options that characterize the communication between the two.
Indeed, the standard provides for the construction of a unique "address" whereby a client can contact a server, using the following schema:
When the server is properly instantiated, the logger shows the server address, but in a format in which the ip address is replaced by the name of the machine hosting the application: simply replace the latter with the ip address on which the server is running to get the right address.
NodeSet2 xml standard
The NodeSet2 is the OPC UA xml standard for implementing the data architecture of a server. The component allows the loading of this kind of file to speed up the definition of the content of the server, in order to avoid the manual definition of each single node, its access policy, default value and so on.
An example of this kind of file can be found:
In order to create a NodeSet2 model file, it is recommended to use a graphical modeling tool. An example of such tools is the open source opcua-modeler: it allows to create a new xml file in the NodeSet2 standard, or modify an already existing one.
WARNING: opcua-modeler allows to assign default values to the variables through the user interface, but it will not persist them in the XML file. This problem can be overcome by manually inserting the default value in the xml file (in the Open source model some examples can be found), or performing a write operation through a client.