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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Model an Allen-Bradley PLC

No ratings

 

Learn how to connect ThingWorx Kepware Server to Foundation.

 

Guide Concept

 

This guide will teach you how to create a backend Data Model in ThingWorx Foundation that works with ThingWorx Kepware Server to collect data from an Allen-Bradley PLC and send it to ThingWorx Foundation.

system_diagram-kepserver--640-480.png

 

You'll learn how to

 

  • Create a Data Model in ThingWorx Foundation that accepts information from ThingWorx Kepware Server

 

NOTE:  The estimated time to complete this guide is 30 minutes

 

 

 

Step 1: Learning Path Overview

 

Assuming you are using this guide as part of the Rockwell Automation Learning Path, then you have now completed each of the following installations:

 

  1. Connected Components Workbench
  2. ThingWorx Kepware Server
  3. ThingWorx Foundation (for Windows)

 

You’ve also connected an Allen-Bradley PLC to Connected Components Workbench and then to ThingWorx Kepware Server.

 

In this guide, we’ll propagate that information further from ThingWorx Kepware Server into ThingWorx Foundation.

 

 

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 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. In the Description field, enter an appropriate description, such as Industrial Gateway Thing to connect to ThingWorx Kepware Server.

    02_kepserv_name_template.png

     

  6. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
  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 Industrial Gateway 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.

    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 IP address of your ThingWorx Foundation server.
  7. Enter the Port number. If you are using the “hosted” Developer Portal trial, enter 443.

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

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

 

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

 

This step will create a new Thing in ThingWorx Foundation representing two output coils of the PLC.

 

Create Thing for PLC coils

 

  1. In ThingWorx Foundation Composer, on the left, click MODELING -> Industrial Connections, then click IndConn_Server.
    12-re9-industrial-connections.png

     

  2. At the top, click Discover.
  3. Expand Channel2, then click myPLC.
  4. Select check-boxes next to Coil2 and Coil3, then click Bind to New Entity.

    Create_coil_thing.png

     

  5. Scroll to select RemoteThing, then click OK.

    select_remoteThing.png

     

  6. Enter the name PLCcoils,
  7. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
  8. then click Save.

 

Test ThingWorx Foundation to PLC Communication

 

  1. Click the Properties and Alerts tab.
  2. Confirm that the isConnected Property has a check in the Value field, indicating a good connection between ThingWorx Kepware Server and the PLC.
  3. Click the pencil icon in the Coil3 line to open the edit panel, click the True radio button, then click the save checkmark button.

    Test_coil3.png

     

  4. You should here a soft click from the PLC and the Output 3 indicator will illuminate.
    • ThingWorx Foundation is now controlling the PLC through its connection to ThingWorx Kepware Server.

 

 

Step 5: Troubleshooting

 

  1. If the connection to the PLC stops working and there is a Thumbs Down icon next to your properties, the ThingWorx Kepware Server trial edition drivers are not connected to your PLC.

    • The trial edition stops running after 2 hours and must be stopped and restarted.
    • Right-click on ThingWorx Kepware Server icon in system tray.

    Stop_runtime.png

     

    • Click Stop Runtime service.
    • Wait a minute for the process to stop, then click Start Runtime service.
  2. If Connected Components Workbench does not connect to PLC, check the IP address of the PLC using RS Linx Classic software that was installed as part of Connected Components Workbench.
    • RS Linx Classic is located Start > All Programs > Rockwell Software > RSLinx > RSLinx Classic
    • Click AB_ETHIP-1, Ethernet and IP addresses of connected PLCs will be discovered

NOTE: A changed PLC IP Address (typically seen through Connected Components Workbench) will require an IP Address change in ThingWorx Kepware Server settings.

 

 

 

Step 6: Next Steps

 

Congratulations! You've successfully completed the Model an Allen-Bradley PLC guide.

You've learned how to:

 

  • Create a data model that can accept information from ThingWorx Kepware Server
  • Connect ThingWorx Kepware Server to Foundation

 

The next guide in the Using an Allen-Bradley PLC with ThingWorx learning path is Visualize an Allen-Bradley PLC.

 

Learn More

 

  Capability      Resource
AnalyzeMonitor an SMT Assembly Line

 

Additional Resources

 

For additional information on ThingWorx Kepware Server:

 

  Resource              Link
DocumentationKepware documentation
SupportKepware Support site
Version history
Last update:
‎Mar 07, 2023 01:59 PM
Updated by:
Labels (1)
Contributors