OPC UA servers can be categorized into two groups based on how they interact with the device they serve. The first group consists of servers that run directly on the device itself, such as the HMI operator panel of a CNC machine. These servers utilize internal protocols and built-in libraries to interact with the controller, as direct access via the Ethernet network is not possible. Examples of such servers include SINUMERIK S7 ONLINX, which uses built-in HMI libraries to access PROFIBUS, and CNDEX, which uses built-in HMI libraries to access OpenCNC controllers.

The second group of OPC UA servers run on external servers and access controllers or CNCs via Ethernet. Examples of these servers include FANUC FOCAS, SYNTEC, and MODBUS TCP.

Some OPC UA servers support both options, i.e., remote and embedded. The OPC UA server SINUMERIK S7 TCP is an example of such a server. In some cases, this server must run directly on the HMI operator panel, connecting to CNC controller and PLC via an internal Ethernet network.

Each OPC UA server instance serves one device, and this works well for embedded servers. However, for servers that run on an external server machine and access devices via Ethernet, separate instances are used. You can specify an instance through the instance command line parameter, and multiple instances of the OPC UA server can run concurrently. Each running instance will serve a corresponding device and must be assigned a free TCP port. The default port used by the OPC UA server is TCP port 4840, but you can specify a different port using the port command line parameter.

Here is a command example to start “dev1” instance of SINUMERIK S7 TCP server:

dpa.opcu.s7nck.exe /instance:dev1 /port:4841 /dev:192.168.0.1 /nck /plc

Each instance uses its own set of certificates and requires a separate license. Besides, each instance may optionally have its own “alias.json” file for aliases configuration. The directory structure corresponding to the instance names should be used to set up the required certificates, license files and alias configurations.

c:\program files\
    X-tensive\
        DPA.UA\
            s7nck\
                instances\
                    default\
                        .cert
                        .key
                        alias.json
                        license.txt
                    dev1\
                        .cert
                        .key
                        license.txt
                    dev2\
                        .cert
                        .key
                        license.txt

The ctrl utility is used to manage instances, including registering and unregistering instances. To register a new instance, you can use the following command:

dpa.ua.s7nck.ctrl.exe /install /instance:dev1 /port:4841 /dev:192.168.0.1 /nck /plc

This will register a new service on the system with the name “DPAOPCUA.S7TCP.dev1”, where the instance name is added as a suffix to the service name.

Starting the instance service:

net start DPAOPCUA.S7TCP.dev1

Deleting an instance:

dpa.ua.s7nck.ctrl.exe /uninstall /instance:dev1

Before deleting an OPC UA server instance, you must stop the corresponding service using the command:

net stop DPAOPCUA.S7TCP.dev1

You can view registered instances and statuses of corresponding services using the list command:

dpa.ua.s7nck.ctrl.exe /list