=====Developing and Testing a Multi-Host 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 with your host (tool connection) deployments, you will need the MultiHostOPCUAServer.zip add-on package, which contains: {{:pasted:20240601-175311.png}} This zip will be used later on in these instructions. ==== Setting Up the Multi-Tool Projects ===== 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: {{: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. 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}} Change the connection parameters (hostname/IP Address, HSMS Port and Device ID) so each Host will connect to its tool. For the purpose of this example and for testing, the hostname will be left as "localhost" but the ports used are all different, such as 5010,5020, and 5030. {{:pasted:20210420-230833.png?300}} Be sure that OPCUA Server is selected as the deployment type, and press the build button (Hammer/Star button) to build the code and put TransSECS into "run" mode. After building the code, the old "GEMHost.tsx" project file will remain in the directory. This can be deleted now, but this is not necessary. {{:pasted:20210420-224619.png?300}} After the host is built, press the LIVE button (toggle from SIM). The host should connect to tool, you will see S1F13 message sent from the host and an S1F14 reply from the tool, also the same for S1F17 and its S1F18 reply. If the host does not connect, solve this problem before proceeding. Make sure the tool is running and using the communication parameters set before the build. Close this first project and load the next host project. Repeat building and connection testing for your other tools. ====Characterizing the Tools for the Host Projects==== The next step is to get the VIDs and CEIDs from the process tool so they can be used in the host project. Start with one of the GEMHost projects from the previous step. Build the project (hammer/star button) and go to LIVE mode. Right click on the empty VID node and select "Online VIDs From Tool". {{:pasted:20210420-001215.png?300}} The VIDs from the tool will populate the VIDs node. Do the same for the empty CEIDs node. Build the project one last time now that the VIDs and CEIDs are loaded. Repeat the VID and CEID characterization for each tool with its own GEMHost project. ====Setting Up the Complete 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. 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. Extract the files from the MultiHostOPCUAServer.zip add-on into the root of the directory where the multiple "GEMHost" projects reside. {{:pasted:20240601-181545.png}} Open the file "OPCUAServersList.properties" in a text editor such as WordPad or Notepad++. {{: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 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 "opc.tcp://localhost:12686/MIXOPCServer" 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}}