Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
multi-tool_connection_transsecs_opcua_server [2021/04/20 23:25] wikiadmin |
multi-tool_connection_transsecs_opcua_server [2024/06/01 18:19] (current) wikiadmin |
=====Developing and Testing a Multi-Tool Connection (Multi-Host) TransSECS OPC UA Server===== | =====Developing and Testing a Multi-Host TransSECS OPC UA Server===== |
| |
Normally there is a one-to-one connection from each Host running as an OPC UA Server to a specific SECS/GEM process tool. This allows your OPC UA Client to interact with that process tool through the TransSECS OPCUA Server's SECS/GEM host. Nevertheless there are applications for which you would want a single OPC UA Client to have access to the data in multiple process tools. This essentially acts as a single fab host connected to multiple tools, but each host connected tool has its own name-space within the TransSECS OPC UA Server. | This article explains how to set up multiple TransSECS host deployments to run in the same OPC UA Server. This applies to the cases in which you would want a single OPC UA Client to have access to the data in multiple process tools. Your OPC UA client essentially becomes the single host with multiple tool connections. Each host connected tool has its own name-space within the TransSECS OPC UA Server. |
| |
To prepare to run the combined OPC UA Server, you will need the OPCUAServerRunner.zip add-on package, which contains: | To prepare to run the combined OPC UA Server with your host (tool connection) deployments, you will need the MultiHostOPCUAServer.zip add-on package, which contains: |
| |
{{:pasted:20210420-232420.png?300}} | {{:pasted:20240601-175311.png}} |
| |
This zip will be used later on in these instructions. | This zip will be used later on in these instructions. |
==== Setting Up the Multi-Tool Projects ===== | ==== Setting Up the Multi-Tool Projects ===== |
| |
Each process tool will need its own TransSECS host project. Start by copying the default GEMHost project from the installation Projects directory to a work directory. This project work directory should be outside of the installer structure and in a simple directory, such as your User home directory. Make a directory there called TransSECSProjects, or something similar. It is recommended for the best results that the directory path has no spaces in it. Give this copied GEMHost project a unique name, such as Tool1Host, or GEMHostA, or some other simple name. Do the same for the number of tools you will be connecting to in this OPC UA server. | Each process tool will need its own TransSECS host project. If you already have your host projects for each of your process tools you can skip to the heading "Setting Up the Complete OPC UA Server". |
| |
| Start a new project by copying the default GEMHost project from the installation Projects directory to a work directory. This project work directory should be outside of the installer structure and in a simple directory, such as your home directory. Make a directory there called TransSECSProjects, or something similar,in a directory path which has no spaces in it. Rename the copied "GEMHost" project with a unique name such as Tool1Host, or GEMHostA, or some other simple name. Do the same for each of tools you will be connecting to in this OPC UA server. |
| |
An example directory structure for three tool connection might be: | An example directory structure for three tool connection might be: |
{{:pasted:20210419-181647.png?500}} | {{:pasted:20210419-181647.png?500}} |
| |
Load the first host project into the TransSECS Builder. Rename the tool name "GEMHost" so that it matches the project name. For example, rename the tool for first project loaded as GEMHostA to "GEMHostA". Remove the default VIDs,CEIDs,and RPTIDs (if any) by right clicking on each node and using Delete. Next right click on the Project Name (GEMHost) and add VIDs, and also add CEIDs. These two nodes will be empty. | Load the first host project into the TransSECS Builder. Rename the tool name "GEMHost" so that it matches the project name. For example, rename the tool for first project loaded as GEMHostA to "GEMHostA". Remove the default VIDs,CEIDs,and RPTIDs (if any) by right clicking on each node and using Delete. If you removed the node right click on the Project Name (GEMHostA) and add VIDs, and also add CEIDs. These two nodes will be empty for now. |
| |
{{:pasted:20210420-223524.png?500}} | {{:pasted:20210420-223524.png?500}} |
====Setting Up the Complete OPC UA Server==== | ====Setting Up the Complete OPC UA Server==== |
| |
When the code was built for each GEMHost in the previous stage, each GEMHost was built into its own OPC UA Server. In this stage of the setup all of the GEMHosts codes will be combined so that they are running in a single OPC UA Server. | When the code was built for each "GEMHost" in the previous stage, each host's deployment OPC UA Server was built into its own OPCUA directory. In this stage of the setup all of the GEMHosts will be combined so that they are running in a single OPC UA Server. |
| |
Extract the files from the OPCUAServerRunner zip into the root of the directory where the multiple GEMHost projects reside. | If you skipped the previous section because you already have your individual host OPC UA Servers built and tested for your tool connections, do these next step to prepare for the next step: Make a multi-host deployment directory in a simple directory path. For example, on Windows C:/MultiHostProject/MultiHostOPCUAServer. In this master directory make one subdirectory for each tool connection project. The name of this directory must match exactly the name of the host runtime jar in the project deployments. For example, if the deployment (runtime) jar is called Host1Runtime.jar, this subdirectory will be named "Host1". Do this for each tool connection you want to aggregate into the single OPC UA Host Server. For each of the subdirectories you made, copy the corresponding host project's built (deployment) OPCUA directory into its corresponding subdirectory. |
| |
{{:pasted:20210420-232514.png?300}} | Extract the files from the MultiHostOPCUAServer.zip add-on into the root of the directory where the multiple "GEMHost" projects reside. |
| |
Open the file "OPCServersList.properties" in a text editor such as WordPad or Notepad++. | {{:pasted:20240601-181545.png}} |
| |
| Open the file "OPCUAServersList.properties" in a text editor such as WordPad or Notepad++. |
| |
{{:pasted:20210420-005022.png}} | {{:pasted:20210420-005022.png}} |
| |
The left hand column will be the node name in the combined OPC UA Sever for the project listed on the right side. For example, the first line says "HostA=GEMHostA" which means the node name in the server will be HostA for the TransSECS project GEMHostA. The directory "GEMHostA" must exist and have a built OPC UA Server project in it. | The left hand column will be the node name in the combined OPC UA Sever for the project listed on the right side. For example, the first line says "HostA=GEMHostA" which means the node name in the server will be HostA for the TransSECS project GEMHostA. The directory "GEMHostA" must exist and have a built OPC UA Server project in it. |
| |
| The last step to prepare this multi OPC UA Server is to copy the jre into this deployment to make this portable (can be moved to your deployment system later). For Windows copy the jre directory from your TransSECS Servers installation into this directory. The default location for this on a Windows installation is C:\Users\Public\ErgoTech\TransSECSServers\MIStudioSuite. Select the whole jre directory and copy it here. |
| |
| {{:pasted:20240601-181851.png}} |
| |
| ====Running the OPU UA Server==== |
| |
| Use the runall.bat file to run the OPC UA Server. This can also be run on Linux systems (convert the contents of the runall.bat file to a shell script or contact ErgoTech for assistance). |
| |
| When you first run the server, if built with non-trial software, you will see a popup with a pre-license code unique to your system. This pre-license code will also be printed in the SECSMessages.log file. Please copy this code into an email and send this to ErgoTech so that we can send you an IOT runtime license for your system. |
| |
| {{:pasted:20210420-233052.png?500}} |
| |
| Place the IOT license into this directory and restart the OPC UA Server with the runall.bat file. |
| |
| When you start the OPC UA Server you will see the two new directories created: security and certificates. These will be used later when your OPC UA client attaches. |
| |
| {{:pasted:20210420-234019.png?300}} |
| |
| ====Connecting Your OPC UA Client==== |
| |
| For testing we use the UAExpert client. Connect your client to the OPC UA Server using the endpont URL <code>"opc.tcp://localhost:12686/MIXOPCServer"</code> any security policy that you prefer. When you first connect you will need to trust the server certificate so that the client can send its certificate to the server. |
| |
| The next step is to "trust" the client's certificate for the OPC UA Server. You will find the client's certificate in the directory |
| "security/security/pki/rejected" under the directory where you are running the server: |
| |
| {{:pasted:20210420-235004.png?600}} |
| |
| Movethis certificate to the "security/security/pki/trusted/certs" directory: |
| |
| {{:pasted:20210420-235151.png?600}} |
| |
| Once this certificate is moved to the trusted store for the server, you will be able to connect to the server with your client and see the server tree with the nodes hosta, hostb, and hostc (the names set up in the OPCServersList.properties file). |
| |
| {{:pasted:20210420-235620.png?400}} |
| |
| |
| |