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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Connect Kepware Server to ThingWorx Foundation Part 1

No ratings

Overview

 

This guide has step-by-step instructions for connecting ThingWorx Kepware Server to ThingWorx Foundation. This guide will demonstrate how easily industrial equipment can be connected to ThingWorx Foundation without installing any software on production equipment. NOTE: This guide's content aligns with ThingWorx 9.3The estimated time to complete ALL 2 parts of this guide is 30 minutes. 

 

Step 1: Learning Path Overview

 

 

This guide explains the steps to connect ThingWorx Kepware Server with ThingWorx Foundation and is part of the Connect and Monitor Industrial Plant Equipment Learning Path.

You can use this guide independently from the full Learning Path. If you want to learn to connect ThingWorx Kepware Server to ThingWorx Foundation, this guide will be useful to you.

When used as part of the Industrial Plant Learning Path, you should have already installed ThingWorx Kepware Server and created an Application Key. In this guide, we will send information from ThingWorx Kepware Server into ThingWorx Foundation. Other guides in this learning path will use Foundation's Mashup Builder to construct a website dashboard that displays information and from ThingWorx Kepware Server. We hope you enjoy this Learning Path.

 

Step 2: Create Gateway

 

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

WARNING: To avoid a timeout error, create a Thing in ThingWorx Foundation BEFORE attempting to make the connection in ThingWorx Kepware Server.

  1. In ThingWorx Foundation 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.
  5. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
  6. In the Description field, enter an appropriate description, such as Industrial Gateway Thing to connect to ThingWorx Kepware Server.

     

    Step 2.png
  7. In the Base Thing Template field, enter indus, then select the IndustrialGateway Thing template from the sorted list.
  8. Click Save.

 

Step 3: Connect to Foundation

 

Now that you’ve created an IndustrialGateway Thing and an Application Key, you can configure ThingWorx Kepware Server to connect to ThingWorx Foundation.

  1. Return to the ThingWorx Kepware Server Windows application.
  2. Right-click Project.
  3. Select Properties….

    Step3 Step3.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, Do not enter http://

      7. Enter the Port number. If you are using the "hosted" Developer Portal trial, enter 443.IoTProductMgmt_3-1658879215385.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 a secure port. Select Yes if you are using an http port.

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.

IoTProductMgmt_4-1658879215387.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 4: Bind Industrial Tag

 

Now that you've established a connection, you can use ThingWorx Foundation to inspect all available information on ThingWorx Kepware Server.

ThingWorx Kepware Server includes some information by default to assist you with verifying a valid connection with ThingWorx Foundation.

 

Create New Thing

 

  1. Return to ThingWorx Foundation.
  2. Click Browse.
  3. Click Modeling -> Industrial Connections.IoTProductMgmt_5-1658879215388.png

     

  4. Click IndConn_Server.
  5. At the top, click Discover. 
    • The Discover option is exclusive to Things inheriting the IndustrialGateway Thing Template and displays information coming from ThingWorx Kepware Server.

      Create New Thing Step 4 Step 5.png       6. Expand Simulation Examples.

       7. Click Functions. On the right, you’ll see several pre-defined Tags to assist with connectivity testing.

       Create New Thing Step 4 Step 7.png

       8. Click the checkbox next to Random3.

       9. Click Bind to New Entity.

       Create New Thing Step 4 Step 9.png

      10. In the Choose Template pop-up, select RemoteThing and click OK.

 

Finalize New RemoteThing

 

You’ll now be in an interface to create a new Thing with a predefined Property based on ThingWorx Kepware Server Tag1.

  1. Type IndConn_Tag1 in the Name field.
  2. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
  3. In the Description field, enter an appropriate description, such as Thing with a property fed from an Kepware Server Tag.
    • The Base Thing Template has been automatically set to RemoteThing.
    • The Implemented Shapes has been automatically set to IndustrialThingShape.
      Finalize New RemoteThing.png

4. Click Save.

 

Test Connection

 

The IndConn_Tag1 Thing you created now has a Property with a value that will change with each update from ThingWorx Kepware Server. The Tag1 we utilized is a 'ramp' and therefore, the value will increase at regular intervals.

  1. At the top, click Properties and Alerts.
    • Under Inherited Properties, you will see entries for both RemoteThing and IndustrialThingShape.
    • The Property isConnected is checked, indicating a connection from Foundation to ThingWorx Kepware Server.
    • The Property IndustrialThing has been automatically set to IndConn_Server.
  2. Notice the predefined Property named Simulation_Examples_Functions_Random3.IoTProductMgmt_10-1658879215398.png

     

  3. Click Refresh repeatedly.
    • You’ll see the value increase with each Refresh. This represents data being simulated in ThingWorx Kepware Server.

 

 

Click  here to view Part 2 of this guide.

 

Version history
Last update:
‎Oct 17, 2022 05:33 PM
Updated by:
Labels (2)
Contributors