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 Industrial Devices and Systems Part 2

No ratings

 

Step 5: 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. In ThingWorx Foundation, click Browse > Modeling > Industrial Connections.

    07-cids-industrial-connections.png

     

  2. Click IndConn_Server.
  3. 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.
     

    08-cids-discover.png

  4. Expand Channel1.
  5. Click Device1.

    • On the right, you’ll see Tag1 and Tag2, which are pre-defined Tags to assist with connectivity testing.

    09-cids-device1.png

     

  6. Click the checkbox next to Tag1.
  7. Click Bind to New Entity.


    10_indconn_remotething_template.png

     

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

    04-cids-new-ind-thing.png

     

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

     

  3. If Project is not already set, search for and select PTCDefaultProject.

    05-cids-ind-thing-info.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 Channel1_Device1_Tag1.

    12-cids-industrial-properties.png

     

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

 

Step 6: Log to Value Stream

 

Now that you have explored the Properties of IndConn_Tag1, you’ve seen how ThingWorx Kepware Server feeds information to ThingWorx Foundation.

 

To get an even better indication of changes and confirm continued connectivity, we will log the changes to a Value Stream in order to record the values with a TimeStamp.

 

Create Value Stream

 

  1. In ThingWorx Foundation, click Browse > Data Storage > Value Streams.

    13-cids-value-streams.png

     

  2. Click + New.

    14-cids-value-stream-popup.png

     

  3. In the Choose Template pop-up, select ValueStream.
  4. Click OK.
  5. Type IndConn_ValueStream in the Name field.
  6. In the Description field, enter an appropriate description, such as Value Stream to record changes from ThingWorx Kepware Server.
  7. If Project is not already set, search for and select PTCDefaultProject.
  8. Click Save.
     

    06-cids-value-stream.png



Bind Value Stream

 

  1. Return to the IndConn_Tag1 Thing.
  2. At the top, select General Information.
  3. In the Value Stream field, search for and select IndConn_ValueStream.

    07-cids-set-thing-value-stream.png

     

  4. At the top, select Properties and Alerts.
     

    17-cids-properties.png

  5. Click Channel1_Device1_Tag1.

    • A new set of options will expand from the right.

    18-cids-modify-property.png

     

  6. Check the box for Persistent.
  7. Check the box for Logged.

    19-cids-persistent-logged.png

     

  8. In the top-right, click the Check button to close the expanded options.
  9. Click Save.

    20-cids-thing-saved.png

     

All changes to the Tag1 Property fed from ThingWorx Kepware Server are now stored and TimeStamped to the IndConn_ValueStream.

 

 

Step 7: Visualize the Data

 

We'll now create a Mashup to visualize the record of information from ThingWorx Kepware Server.

 

  1. In ThingWorx Foundation, click Browse > Visualization > Mashups.

    21-cids-mashups.png

     

  2. Click +New.

    01-uiv92-new-mashup-popup.png

     

  3. In the New Mashup pop-up, leave the default selections and click OK.

    23-cids-new-mashup.png

     

  4. In the Name field, type IndConn_Mashup.
  5. If Project is not already set, search for and select PTCDefaultProject
  6. At the top, click Save.

    24-cids-mashup-saved.png

     

  7. At the top, click Design.

    25-cids-design.png

     

  8. At the top-left, ensure the Widgets tab is selected.

    26-cids-widgets-tab.png

     

  9. In the Filter Widgets field at the top-left, type line.
  10. Drag-and-drop a Line Chart onto the central canvas area.
     

    27-cids-drag-drop-line-chart.png

 

Add Data

 

  1. At the top-right, ensure the Data tab is active.

    28-cids-data-tab.png

     

  2. Click the + button.

    29-cids-add-data.png

     

  3. In the Entity Filter field, search for and select IndConn_Tag1.
  4. In the Services Filter field, type queryprop.
  5. Click the right-arrow button beside QueryPropertyHistory.
    • The QueryPropertyHistory Service of the IndConn_Tag1 Thing will appear on the right in the Selected Services field.
  6. Check the box under Execute on Load in the Selected Services field.

    30-cids-queryprop.png

     

  7. Click Done.
    • Note that the QueryPropertyHistory Service now appears on the right side Data tab.
  8. On the top-right Data tab, expand Things_IndConn_Tag1 > QueryPropertyHistory > Returned Data.

    31-cids-expanded-queryprop.png

     

  9. Drag-and-drop All Data from the QueryPropertyHistory Service from the right onto the Line Chart in the center.
     

    32-cids-drag-drop-all-data.png

  10. In the Select Binding Target pop-up, select Data.

    33-cids-bind-data.png

     

Configure Chart Properties

 

  1. Click the Line Chart to select it.
  2. In the bottom-left Properties, type xaxisfield in the filter.
  3. Expand the drop-down for XAxisField.

    34-cids-expand-xaxisfield.png

     

  4. Select timestamp.
  5. At the top, click Save.
  6. Click View Mashup. (You may have to enable pop-ups in your browser.)

    35-cids-view-mashup.png

     

The IndConn_Mashup will show you the recorded history of Property changes that came from ThingWorx Kepware Server.

 

Because the Tag1 Example is a ramp, you’ll notice a slowly-increasing value in the Line Chart.

 

Reload the Mashup's browser-tab to see the value increase even further.

 

NOTE: If the Mashup visualization is blank, confirm your connection to ThingWorx Kepware Server. Return to the Test Connection section of the "Bind Industrial Tag" step.

 
 

Step 8: Next Steps

 

Congratulations! You've successfully completed the Connect Industrial Devices and Systems guide.

 

You've learned how to:

 

  • Connect ThingWorx Kepware Server to ThingWorx Foundation
  • Secure the connection with an Application Key
  • Create an IndustrialGateway Thing
  • Map ThingWorx Kepware Server Tags to ThingWorx Foundation Thing Properties
  • Visualize Data from connected digital assets

 

Learn More

 

CapabilityResource
ConnectConnect to an Allen-Bradley PLC

 

Additional Resources

 

For additional information on ThingWorx Kepware Server:

 

ResourceLink
DocumentationKepware documentation
SupportKepware Support site
Version history
Last update:
‎Nov 11, 2022 03:50 PM
Updated by:
Labels (2)
Contributors