cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Connect to an Azure OPC UA Server Part 1

No ratings

 

 

Use ThingWorx Kepware Server as an OPC UA Client

 

GUIDE CONCEPT

 

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.

 

system-overview-wide.png

 

 

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.

 

system-overview-wide.png

 

 

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.

  1. Download the ThingWorx Kepware Server executable installer.
  2. Right-click on the installer and select Run as administrator.
    • Click Yes in the pop-up asking if you want to proceed.
  3. Select your Language and click OK.
     

    01_icis_language.png

     

  4. On the "Welcome" screen, click Next.
     

    kepware-6-10-install.png

     

  5. Accept the End-User License Agreement and click Next.
     

    03_icis_accept.png

     

  6. Set the destination folder for the installation and click Next.
     

    04_icis_destination.png

     

  7. Set the Application Data Folder location and click Next.

    • Note that it is recommended NOT to change this path.

     

    05_icis_appdata.png

     

  8. Select whether or not you'd like a Shortcut to be created and click Next.
     

    06_icis_shortcut.png

     

  9. On the "Vertical Suite Selection" screen, keep the default of Typical and click Next.
     

    07_icis_vertical.png

     

  10. On the "Select Features" screen, keep the defaults and click Next.
     

    08_icis_features.png

     

  11. The "External Dependencies" screen simply lists everything that will be installed; click Next.
     

    09_icis_dependencies.png

     

  12. On the "Default Application Settings" screen, leave the default of Allow client applications to request data through Dynamic Tag address and click Next.
     

    10_icis_dynamic.png

     

  13. 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.
     

    11_icis_password.png

     

  14. Click Install to being the installation.
     

    12_icis_install.png

     

  15. Click Finish to exit the installer.
     

    13_icis_finish.png

     

 

Step 3: Create Industrial Gateway

 

To make a connection between ThingWorx Kepware Server and ThingWorx Foundation, you must first create a Thing

 

  1. In ThingWorx Composer, click Browse.
  2. On the left, click Modeling -> Things.
     

    new-thing.png

     

  3. Click + NEW.
  4. In the Name field, enter IndConn_Server, including matching capitalization.
     

    create-industrial-gateway.png

     

  5. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
  6. In the Base Thing Template field, enter indus, then select the IndustrialGateway Thing template from the sorted list.
  7. 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.

 

  1. Follow the steps to Create an Application Key and note the value.
    • The appKey will be used in the the next step.
  2. Open the ThingWorx Kepware Server Configuration Windows application, then right-click on Project.
     

    TKS-configuration.png

     

  3. Select Properties….
     

    Twix_Properties.png

     

  4. In the Property Editor pop-up, click ThingWorx.
  5. In the Enable field, select Yes from the drop-down.
  6. In the Host field, enter the URL or IP address of your ThingWorx Foundation server, without http:// or https://.
  7. Enter the Port number.
     
    IoTProductMgmt_7-1666210591650.png
     

     

  8. In the Application Key field, copy and paste the Application Key you just created.
  9. In the Trust self-signed certificates field, select Yes from the drop-down.
  10. In the Trust all certificates field, select Yes from the drop-down.
  11. 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://
  12. Type IndConn_Server in the Thing Name field, including matching capitalization.
  13. 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.
  14. Click Apply in the pop-up.
  15. Click Ok.

 

In the ThingWorx Kepware Server Event window at the bottom, you should see a message indicating Connected to ThingWorx.

 
Twix_Connected.png
 

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

 

  1. Follow the steps to create an OPC UA server in Azure.
  2. Enter Resource Group, click Review + create.
     

    deploy-template.png

     

  3. Click Create.
     

    create-from-template.png

     

  4. In about a minute, the deployment success screen will be displayed.
     

    deployment-success.png

     

  5. Click Go to resource, and copy FQDN.
     

    deployment-info.png

     

  6. Open ThingWorx Kepware Server Configuration.
     

    TKS-configuration (1).png

     

  7. Right-click, then click New Channel.
  8. Scroll down to select OPC UA Client, then click Next.
     

    new-opc-ua-client-channel.png

     

  9. Click Next twice to accept default settings, then enter the FQDN copied earlier.
  10. Add :50000 to the end of the domain name.
     

    add-opcua-info.png

     

  11. Click Next to accept all defaults.
  12. Click Yes to trust the certificate.

 

Click here to view Part 2 of this guide.

Version history
Last update:
‎Mar 07, 2023 02:30 PM
Updated by:
Labels (2)
Contributors