Use ThingWorx Kepware Server as an OPC UA Client
This guide will explain how ThingWorx Kepware server can function as both an OPC UA Server, and a client to a remote OPC UA Server.
Following the steps in this guide, you will create a OPC UA server in Azure, then we will teach you how to use data from the OPC UA server in ThingWorx.
YOU'LL LEARN HOW TO
- Create an OPC UA Server in Azure
- Configure Kepware as on OPC UA Client
- Connect Kepware to ThingWorx Foundation
- Monitor OPC UA data in ThingWorx Composer
NOTE: This guide's content aligns with ThingWorx 9.3. The estimated time to complete this guide is 60 minutes
Step 1: Overview Diagram
In this guide, ThingWorx Kepware Server will serve as both an OPC UA client, and a ThingWorx Foundation client. ThingWorx Kepware Server is able to connect through firewalls to provide a seamless, end-to-end connection from an OPC UA server to ThingWorx Composer. Two ThingWorx Kepware Server instances can be configured to provide a tunnel for transporting machine data across the internet.
This guide will show how to create an OPC UA server in Azure, then browse the server data using Kepware. We will create a ThingWorx Thing with a Property that dynamically represents the value on the remote server.
Step 2: Install ThingWorx Kepware Server
In addition to OPC UA, ThingWorx Kepware Server includes over 150 factory-automation protocols.
ThingWorx Kepware Server communicates between industrial assets and ThingWorx Foundation, providing streamlined, real-time access to OT and IT data — whether that data is sourced from on-premise web servers, off-premise cloud applications, or at the edge.
This step will download and install ThingWorx Kepware Server.
- Download the ThingWorx Kepware Server executable installer.
- Right-click on the installer and select Run as administrator.
- Click Yes in the pop-up asking if you want to proceed.
- Select your Language and click OK.
- On the "Welcome" screen, click Next.
- Accept the End-User License Agreement and click Next.
- Set the destination folder for the installation and click Next.
Set the Application Data Folder location and click Next.
- Select whether or not you'd like a Shortcut to be created and click Next.
- On the "Vertical Suite Selection" screen, keep the default of Typical and click Next.
- On the "Select Features" screen, keep the defaults and click Next.
- The "External Dependencies" screen simply lists everything that will be installed; click Next.
- On the "Default Application Settings" screen, leave the default of Allow client applications to request data through Dynamic Tag address and click Next.
On the “User Manager Credentials” screen, set a unique strong password for the Administrator account and click Next.
- Note that skipping setting a password can leave your system less secure and is not recommended in a production environment.
- Click Install to being the installation.
- Click Finish to exit the installer.
Step 3: Create Industrial Gateway
To make a connection between ThingWorx Kepware Server and ThingWorx Foundation, you must first create a Thing.
- In ThingWorx Composer, click Browse.
- On the left, click Modeling -> Things.
- Click + NEW.
- In the Name field, enter IndConn_Server, including matching capitalization.
- If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
- In the Base Thing Template field, enter indus, then select the IndustrialGateway Thing template from the sorted list.
- Click Save.
Step 4: Connect Kepware to ThingWorx
This step will get ThingWorx Kepware Server set-up and connected to ThingWorx Foundation.
Now that you have created an Industrial Gateway Thing, you can configure ThingWorx Kepware Server to connect to ThingWorx Foundation.
- Follow the steps to Create an Application Key and note the value.
- The appKey will be used in the the next step.
- Open the ThingWorx Kepware Server Configuration Windows application, then right-click on Project.
- Select Properties….
- In the Property Editor pop-up, click ThingWorx.
- In the Enable field, select Yes from the drop-down.
- In the Host field, enter the URL or IP address of your ThingWorx Foundation server, without http:// or https://.
- Enter the Port number.
- In the Application Key field, copy and paste the Application Key you just created.
- In the Trust self-signed certificates field, select Yes from the drop-down.
- In the Trust all certificates field, select Yes from the drop-down.
- In the Disable encryption field, select No from the drop-down if you are using another server that uses TLS - URL begins with https://.
- Select Yes if you are using a ThingWorx Foundation server without TLS - URL begins with http://
- Type IndConn_Server in the Thing Name field, including matching capitalization.
- If you are connecting with a remote instance of ThingWorx Foundation and you expect any breaks or latency in your connection, enable Store and Forward.
- Click Apply in the pop-up.
- Click Ok.
In the ThingWorx Kepware Server Event window at the bottom, you should see a message indicating Connected to ThingWorx.
NOTE: If you do not see the “Connected” message, repeat the steps above, ensuring that all information is correct. In particular, check the Host, Port, and Thing name fields for errors.
Step 5: Connect OPC UA Server to Kepware
Now that you have created an Industrial Gateway Thing, and ThingWorx Kepware Server is connected to ThingWorx Foundation, we can connect an OPC UA server to Kepware
- Follow the steps to create an OPC UA server in Azure.
- Enter Resource Group, click Review + create.
- Click Create.
- In about a minute, the deployment success screen will be displayed.
- Click Go to resource, and copy FQDN.
- Open ThingWorx Kepware Server Configuration.
- Right-click, then click New Channel.
- Scroll down to select OPC UA Client, then click Next.
- Click Next twice to accept default settings, then enter the FQDN copied earlier.
- Add :50000 to the end of the domain name.
- Click Next to accept all defaults.
- Click Yes to trust the certificate.
Click here to view Part 2 of this guide.