Application Note No. 9 Product: Keywords: Problem: OPC Easy Connect Suit bidirectional OPC-Communication How to create and use a bidirectional OPC-Communication with OPC Tunnel Solution: The OPC Easy Connect Suite includes solutions for different use cases. The OPC Tunnel can be used to avoid problems with the DCOM security settings. Thus the DCOM communication is translated into a TCP/IP communication, no DCOM is necessary. If there is an OPC Client and an OPC Server on both PC and you want to connect each of them with an OPC Tunnel you need a bidirectional communication. This document explains how this can be configured. In this document we implement the configuration from the picture above. For this purpose, the OPC Tunnel is installed on both computers. Two instances of the OPC Tunnel will be used on both PC. The name of the first instance is empty and can not be changed. The second 1
instance then gets a unique name (InstancePC1, InstancePC2). Every OPC Tunnel instance gets a unique item prefix: PC1_TC: Tunnel on PC1, connected with an OPC Client (Tunnel Client) PC1_TS: Tunnel on PC1, connected with an OPC Server (Tunnel Server) PC2_TC: Tunnel on PC2, connected with an OPC Client (Tunnel Client) PC2_TS: Tunnel on PC2, connected with an OPC Server (Tunnel Server) 1.) Install the Softing OPC Demo Client, the Softing OPC Demo Server and the OPC Easy Connect on both PC. 2.) Now we configure the Tunnel Server on PC2 with the item prefix PC2_TS. Go to PC2 and double click on the system tray icon of the OPC Easy Connect: In the Tray application select the instance and press the Configure -Button. Now the Project Wizard occurs. Please do the following settings in the dialogs of the Project Wizard (you find the title of the dialog in the dialog caption): Dialog Title Product OPC Tunnel Tunnel Server System Connection Type: DA Provide Items Server Connection Test Settings Select OPC Tunnel and press Select Server side and press OPC Tunnel IP Port 56765 is suggested. Take this and press IP Port 8090 is suggested. Take this and press Press the button Add Server Connection Select DA Server and press Select Local/Data Access/Softing OPC Toolbox Demo OPC DA Server and press Enter Item Prefix PC2_TS and press Press Connection Test to check, if the local Softing Demo Server can be started. Then press Finish Press Finish 2
Apply the message The project contents will be deleted. Do you want to create a new project? with Yes. Exit the OPC Easy Connect configurator. Double click on the system tray icon of the OPC Easy Connect again, select the instance and press the Restart button to activate the first Tunnel Server instance on PC2 for later communication tests. 3.) Now we configure the Tunnel Client on PC1 with the item prefix PC1_TC. Go on PC1 and execute a double click on the system tray icon of the OPC Easy Connect. Select the instance and press the Configure -Button. Now the Project Wizard occurs. Please do the following settings in the dialogs: Dialog Title Product OPC Tunnel System Connection Type: OPC Tunnel DA/AE Server Provide Items Server Connection Test Settings Select OPC Tunnel and press Select Client side and press IP Port 8090 is suggested. Take this and press Press the button Add Server Connection Select Tunnel DA Server and press Enter the IP-Address from PC2 and take the suggested OPC Tunnel IP Port 56765. Press Enter Item Prefix PC1_TC and press Press Connection Test to check, if your Tunnel Client can connect the Softing Demo Server on PC2. Then press Finish Press Finish Exit the OPC Easy Connect configurator. 3
4.) Start the OPC Demo Client on PC1 and connect to the local Softing OPC Easy Connect. As result you will see the namespace of the Demo Server on PC2. 5.) Configure the Tunnel Server on PC1 with the item prefix PC1_TS. Go to PC1 and start the OPC Easy Connect Tray. Press the Add Button to create a second instance. Enter the name InstancePC1 and press the OK Button. Select this instance and press the Configure Button. In the upcoming Project Wizard please do the following settings: Dialog Title Product Settings Select OPC Tunnel and press 4
OPC Tunnel Tunnel Server System Connection Type: DA Provide Items Server Connection Test Select Server side and press OPC Tunnel IP Port 56768 is suggested. Take this and press IP Port 8091 is suggested. Take this and press Press the button Add Server Connection Select DA Server and press Select Local/Data Access/Softing OPC Toolbox Demo OPC DA Server and press Enter Item Prefix PC1_TS and press Press Connection Test to check, if the local Softing Demo Server can be started. Then press Finish Press Finish Exit the OPC Easy Connect configurator. In the Tray application select the second instance InstancePC1 and press the Restart button to activate the Tunnel Server instance on PC1 for later communication tests. 6.) Now we configure the Tunnel Client on PC2 with the item prefix PC2_TC. Go to PC2 and start the OPC Easy Connect Tray. Press the Add Button to create a second instance. Enter the name InstancePC2 and press the OK Button. Select this instance and press the Configure Button. 5
In the Project Wizard do the following settings: Dialog Title Product OPC Tunnel System Connection Type: OPC Tunnel DA/AE Server Provide Items Server Connection Test Settings Select OPC Tunnel and press Select Client side and press IP Port 8091 is suggested. Take this and press Press the button Add Server Connection Select Tunnel DA Server and press Enter the IP-Address from PC1 and enter the OPC Tunnel IP Port 56768. Press Enter Item Prefix PC2_TC and press Press Connection Test to check, if your Tunnel Client can connect the Softing Demo Server on PC1. Then press Finish Press Finish Exit the OPC Easy Connect configurator. 7.) Start the OPC Toolbox Demo Client on PC2 and connect locally to the second instance of the Softing OPC Easy Connect. As result you will see the namespace of the Demo Server on the remote PC1. 6
7
Now all Tunnel Instances are configured and can be used for bidirectional communication. Note: The OPC Tunnel Instances PC1_TS and PC2_TS must be started by hand. Starting an application from one PC to another is a DCOM feature! Licensing of the OPC Tunnel: You need on both computers as well as a basic license (OPC-EC-BCL) as a further license for 10 servers (OPC-EC-SRV-10). 8