Visualize an Allen-Bradley PLC Part 2
- November 7, 2022
- 0 replies
- 933 views
Step 5: Tie Data to Widgets
The Mashup now has access to the backend data via get/set Data Services.
In this step, you will tie these Data Services to the Checkbox Widgets to pull and push information.
- Click the Data tab in the upper right

- Under GetProperties, click and drag the arrow next to Channel2_myPLC_Coil2 onto the Left Checkbox.
- On the Select Binding Target pop-up, click State.

- Click the Data tab again
- Drag Channel2_myPLC_Coil3 onto the right Checkbox.
- On the Select Binding Target pop-up, click State.
Enable Automatic Updates
The GetProperties Mashup Data Service will now propagate the State of Coil2 and Coil3 from the PLC onto these Checkbox Widgets.
The GetProperties Service will be called automatically when the Mashup loads, so the Checkboxes states will be accurate on initial viewing.
However, the backend data state changes, you will need the GetProperties Service to be automatically called again to update the Checkbox Widgets.
Fortunately, it is simple to trigger this behavior.
- Click the Data tab
- Click GetProperties to select it.

- On the right of the Mashup Builder, Click the Data Properties tab

- Click the Automatically Update Values checkbox
Allow Bidirectional Sets
You also want to enable bi-directional communication, not only displaying the current value of the PLC, but also setting it via the Mashup GUI.
The SetProperties Mashup Data Service can accomplish this.
- Click the Right Checkbox to select it.

- Click the Checkbox Widget's top-left drop-down menu to expose the available options.

- Drag State over the Data tab to expand it.
- Drop onto SetProperties > Channel2_myPLC_Coil3.

- Click the right Checkbox drop-down menu again.

- Click Configure Bindings.

- Click the down arrow to the right of Changed.

- Click Add Trigger Service.
- Click the Data tab.
- Select the setProperties check box.

- Click Next to close the Trigger Services window.
- Click Done to close the Configure Bindings pop-up.
- At the top, click Save.
Step 6: View Mashup
Your Mashup is now complete with two Checkbox Widgets and connections from those Widgets to the backend data.
The left Checkbox represents Coil2, and will change its state depending on whether you have touched the lead to the appropriate input on the PLC.
The right Checkbox represents Coil3, and will display the current status as well as allow you to set the status of Output Coil 3 via checking or unchecking the box.
At the top, click View Mashup to display your web application.
- You may need to set your browser to allow pop-ups.

- Select the right checkbox.

- Note how the PLC's Output Coil 3 will immediately turn on.

- Touch the lead to the PLC's I-02, i.e. Input 2.
- The left checkbox will indicate the status of Input 2 within a couple of seconds.

Step 7: Troubleshooting
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.

- Click Stop Runtime service.
- Wait a minute for the process to stop, then click Start Runtime service.
- The trial edition stops running after 2 hours and must be stopped and restarted.
- 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
- RS Linx Classic is located Start > All Programs > Rockwell Software > RSLinx > RSLinx Classic
NOTE: A changed PLC IP Address (typically seen through Connected Components Workbench) will require an IP Address change in ThingWorx Kepware Server settings.
Step 8: Next Steps
Congratulations! You've successfully completed the Visualize an Allen-Bradley PLC guide.
In addition, assuming you have been utilizing this guide as part of the Rockwell Automation Learning Path, this represents the end of your journey.
You've learned how to:
- Create a Mashup
- Add Widgets
- Access backend data via Mashup Data Services
- Tie data to Widgets
- Create a simple web application that monitors and controls a PLC
This is the last guide in the Using an Allen-Bradley PLC with ThingWorx learning path.
Learn More
| Capability | Resource |
| Analyze | Monitor an SMT Assembly Line |
Additional Resources
For additional information on ThingWorx Kepware Server:
| Resource | Link |
| Documentation | Kepware documentation |
| Support | Kepware Support site |

