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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Connect to an Allen-Bradley PLC

No ratings

 

GUIDE CONCEPT

 

This guide introduces connecting an Allen-Bradley PLC to ThingWorx Kepware Server.

 

YOU'LL LEARN HOW TO

 

  • Create and run a simple ladder logic application on an Allen-Bradley PLC
  • Connect the PLC to 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)

 

In this continued step, you'll now connect an Allen-Bradley PLC to Connected Components Workbench and then to ThingWorx Kepware Server.

 

In a later guide, we'll propogate that information further from ThingWorx Kepware Server into ThingWorx Foundation.

 

NOTE: Both Rockwell Automation's Connected Components Workbench and ThingWorx Kepware Server are time-limited trials. If significant time has passed while persuing this Learning Path, you may need to reinitialize them. Consult the Troubleshooting step of this guide for more information.

 

 

 

Step 2: Setup PLC

 

This guide uses an inexpensive Allen-Bradley Micro820 PLC as a demonstration.

 

ThingWorx Kepware Server offers drivers for hundreds of devices, making this step the only one that contains device-specific instructions.

 

Read and understand installation instructions before making any electrical connections to the PLC.

 

1. Connect the postive lead of a 24V power supply along with a 6" test lead to Terminal 1 of the output terminal block.

 

2. Connect the negative lead of the power supply to Terminal 2.

 

PLCwiring-0-0-0-0-1537465110.jpg

 

3. Confirm the test lead is secure from making contact with anything conductive; it will be  connected to +24V. Power on the supply and confirm the LEDs briefly light.

 

PLC_LEDs-1540-712-1971-1617-1537465397.jpg

 

 

4. Carefully touch the test lead to the Input 1 terminal and confirm the indicator LED for Input 1 turns on.

 

IoTProductMgmt_2-1664452710622.png

 

5. Power off the supply before continuing to the next step.

 

 

 

Step 3: Create PLC Project

 

In this step, you will create a simple PLC application. This application will connect to a ThingWorx Mashup in subsequent guides in the Learning Path.

 

 1. After opening Connected Components Workbench, click New... in the Project section.

 

2. Enter ThingWorxGuide in the Name field and click Create.

 

3. Browse to the PLC model you are using and click Select, then Add to Project.

 

IoTProductMgmt_0-1664456945635.png

 

4. Right-click Program, then left-click Add > New LD: Ladder Diagram

 

IoTProductMgmt_1-1664456945637.png

 

5. Double-click Prog1 to open the ladder window.

 

IoTProductMgmt_2-1664456945638.png

 

Ladder Logic

 

You will create a simple application that will turn on output 2 when there is a signal on input 2.

 

 1.. Right-click in the box to the left of the rung, hover over Insert Ladder Elements, then click on Direct Coil

 

.IoTProductMgmt_12-1664396534163.png

 

 

2. Click the I/O - Micro820 tab towards the right and select an output coil - this guide uses _IO_EM_DO_02. Then click OK

            

IoTProductMgmt_13-1664396534164.png

 

 

3. Add an input contact by right-clicking in the box to the left of the rung, hover over Insert Ladder Elements, then click on Direct Contact.

 

4. Click the I/O - Micro820 tab and scroll down to select an input - this guide uses _IO_EM_DI_02. Then click OK.

 

IoTProductMgmt_14-1664396534166.png

 

 

 5. The program window should now look like this:

 

IoTProductMgmt_15-1664396534167.png

 

Upload

 

Next, you will propagate the program to the PLC.

 

1. Secure the test lead then apply power to the PLC.

 

2. Connect an ethernet cable directly between the PLC and your Windows computer.

 

3. Click Device > Connect to connect to the PLC; a pop-up will appear saying the project does not match the program in the controller.

 

 

NOTE: When either your PLC or computer are restarted, they may be assigned a new IP address, requiring you to reconfigure the connection. Click the tab labled with your PLC, then click the pencil icon next to connection path, click Browse, expand the Ethernet driver, highlight the active controller, and click OK. Click Close and then Connect.

 

 

IoTProductMgmt_0-1664457539052.png

 

4. Click Download current project to the controller

 

IoTProductMgmt_1-1664457539061.png

5. Confirm overwriting any program in the controller by clicking Download.

 

6. After your project is downloaded, run it on the controller by clicking Yes.

 

IoTProductMgmt_2-1664457539063.png

 

7. Touch the test lead to the I-02 terminal, and your program will turn on the #2 output.

  • You can confirm your project is working by both hearing the soft click from the PLC and seeing the output indicator turn on.
IoTProductMgmt_3-1664457539105.png

 

 

 

Step 4: Configure ThingWorx Kepware Server

 

Now that you have a simple project running on the PLC, you need to configure ThingWorx Kepware Server to monitor it.

 

1. Open ThingWorx Kepware Server, right-click on Connectivity, and click New Channel.

 

2. Select Allen-Bradley Micro800 Ethernet from the drop-down, then click Next.

 

IoTProductMgmt_0-1664458299906.png

 

 

3. Click Next to accept the defaults, and click Finish to create Channel2.

 

4. Click Click to add a device below Channel2, enter myPLC in the name field, and click Next.

 

5. Enter the IP address of your PLC, then click Next.

  • The IP address of your PLC is shown in Connected Components Workbench in Device > Configure.

 

IoTProductMgmt_1-1664458299912.png

 

 

NOTE: The IP address of the PLC may change when it is power cycled and must be updated in ThingWorx Kepware Server to match

 

6. Click Next to accept default values for each pop-up, and click Finish to create the myPLC device.

 

IoTProductMgmt_2-1664458299913.png

 

 

7. Click the Click to add a static tag message.

 

8. Enter Coil2 in the Name field, _IO_EM_DO_02 in the Address field, change the Data Type drop-down to Boolean, and click OK.

  •  The address must exactly match a variable name in the PLC.

 

IoTProductMgmt_3-1664458299915.png

 

 

9. Create a second tag by right-clicking on myPLC again and clicking New Tag.

 

10. Enter Coil3 in the Name field, _IO_EM_DO_03 in the Address field, select Boolean from the Data Type drop-down, and click OK.

 

IoTProductMgmt_4-1664458299916.png

 

 

 

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 icon in system tray.

 

IoTProductMgmt_0-1664458946183.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 Connect to an Allen-Bradley PLC tutorial.

You've learned how to:

 

  • Create and upload a simple ladder logic application to a PLC
  • Connect a PLC to ThingWorx Kepware Server

 

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

 

Learn More

 

Capability

Resource

Analyze

Monitor an SMT Assembly Line

 

 

Additional Resources

 

For additional information on ThingWorx Kepware Server:

 

ResourceLink
WebsiteConnecting & Managing Industrial Assets
DocumentationKepware documentation
SupportKepware Support site
Version history
Last update:
‎Mar 07, 2023 01:56 PM
Updated by:
Labels (2)
Contributors