OPC UA - Establish Communication
In order to set up a functioning communication between the WinCC OA OPC UA client and WinCC OA OPC UA server the following steps are necessary. Detailed explanations can be found in the further chapters. It is assumed that WinCC OA is already installed.
1. Creating datapoints
-
An internal connection datapoint of type _OPCUAServer has to exist for each used server and an internal datapoint of the type _OPCUASubscription for each used subscription (see also internal datapoints of the OPC UA client). These datapoints are created and configured in the corresponding panels (see configuration of the servers and configuration of a subscription).
-
The config entry server = "<connection datapoint>" must be defined in the [opcua] section to set up the communication. You have to enter the name of the server connection datapoint (without the "_").
2. Startup of the client
Start the WinCC OA OPC UA client like every other WinCC OA manager:
Insert the OPC UA client manager (WCCOAopcua) to be started in the WinCC OA console. All WinCC OA standard command line
options can be used for the OPC UA client. There are no unique command line options for the client. In case that several managers are running each manager (=driver) must be started
with another manager number. The manager number is specified by the -num<manager number> option. The use of the further parameters are described in the
corresponding documentation chapters.
When the WinCC OA OPC UA manager is running, the simulation driver must be stopped.
3. Set internal datapoints
A server can be added dynamically to a WinCC OA project without a restart of the OPC UA client. Therefore the name of the OPC UA datapoint (see step 1.) must be written to the "_OPCUA<manager number>.Command.AddServer DPE. In order to establish a connection between an OPC UA datapoint and the manager successfully, the OPC UA data point must be already created with the corresponding number of the manager. As a result the connection will be established as long as the client is active and running. If the client stops, the connection is severed and will not be reestablished automatically after the restart of the client. To set the connection persistent, the OPC UA datapoint must be added to the "_OPCUA<manager number>.Config.Servers" datapoint element. If there is already a peripheral address for the server, this step is not necessary anymore since it is added automatically to the DPE "_OPCUA<manager number>.Config.Servers".
4. Connection setup on the WinCC OA OPC UA server (in WinCC OA project)
Assignment of datapoint elements to the datapoint groups OPCUARead (data that can only be read over OPC UA) and OPCUAWrite (data that can be read and written over OPC UA).
For further information see Access to WinCC OA data.
5. Startup of the server
For enabling an OPC UA client to communicate with WinCC OA over the WinCC OA OPC UA server, the OPC UA server manager must be added to the WinCC OA console. This manager establishes the communication with the Event Manager.
Start the WinCC OA OPC UA server manager.
In the event that the WinCC OA OPC UA server manager cannot be started and an error message is displayed in the WinCC OA log viewer, the reason for that could be:
- The server port number is occupied (in order to change it see possible config entries for the OPC UA client)
- The certificate directory cannot be found (for information on certificates see certificates)
6. Definition of the peripheral addresses in the WinCC OA client project
The hardware address in the target system is assigned to the address of the WinCC OA datapoint element via the peripheral address. See Definition of the peripheral address of the OPC UA driver.
7. Browsing for items in the WinCC OA client project
Browsing for items in the server address space - see Browsing for Items.
