How to Use Microsoft Excel for Real-Time Communication with Rockwell Controllers

Are you an automation professional looking to retrieve real-time manufacturing or process plant data from an Excel spreadsheet? Are you interested in using this data for monitoring, controlling, testing, or decision-making purposes? In this article, we will explore how you can achieve all of this and more using Microsoft Excel and a communication protocol called Dynamic Data Exchange (DDE).

How to Use Microsoft Excel for Real-Time Communication with Rockwell Controllers
How to Use Microsoft Excel for Real-Time Communication with Rockwell Controllers

What is DDE?

DDE is a Windows mechanism that allows applications to communicate with each other. It facilitates a conversation between a “Client” (which initiates the conversation) and a “Server” (which responds to the client’s requests). To initiate a DDE conversation, a client specifies three items: the “Application” (the name of the application it wants to communicate with), the “Topic” (the subject of the conversation), and the “Item” (the specific data to be passed between applications).

Configuring the Communication

To illustrate the process, we’ll use “Microsoft Excel” to write data to “Rockwell Automation Studio 5000” using “RSLinx Classic” and “Studio 5000 Logix Emulate” software. The overall block diagram of how the programs are interconnected is displayed below:

Block Diagram

First, we need to configure the communication between the software components. This involves setting up the virtual PLC, connecting RSLinx Classic, and configuring the communication drivers. Detailed step-by-step instructions can be found on the Techal website.

Writing Data to Rockwell Controllers

Once the communication is established, you can write data from Excel to the Rockwell controllers. In Excel, you can create a project with worksheets dedicated to reading and writing data. For example, let’s assume you have a project called “READ WRITE PLC” with columns “D” and “E” for reading data (REAL and INTEGER) and columns “G” and “H” for writing data (REAL and INTEGER).

Further reading:  Home Automation using ESP32: Control Your Home with Ease

To perform the write operation, you can use Visual Basic for Applications (VBA) scripting. You can assign a script to a command button that, when clicked, triggers the write operation. The script will establish a connection to RSLinx, loop through the Excel cells to retrieve the data, and use the DDE Poke function to write the data to the PLC. A detailed explanation of the VBA script can be found on the Techal website.

Reading Data from Rockwell Controllers

You can also retrieve data from the Rockwell controllers and display it in Excel. Similar to the write operation, you can create a command button for reading data. When clicked, the script behind the button will use the DDE Request method to retrieve the data from the RSLinx DDE Topic. Again, for a more detailed explanation of the script, refer to the Techal website.

FAQs

Q: Can I use this method with other PLC brands?
A: The configuration and scripting described in this article are specific to Rockwell controllers. You may need to adapt the steps for use with other PLC brands.

Q: Do I need any additional software to implement this solution?
A: Yes, you will need Microsoft Excel, RSLinx Classic, and Studio 5000 Logix Emulate software to set up the communication and perform the data exchange.

Q: Can I perform real-time communication with multiple Rockwell controllers simultaneously?
A: Yes, you can configure multiple communication paths and exchange data with multiple Rockwell controllers using the same Excel project.

Conclusion

Using Microsoft Excel and Dynamic Data Exchange (DDE), you can establish real-time communication with Rockwell controllers, enabling you to monitor, control, test, and make informed decisions based on manufacturing or process plant data. This powerful solution provides automation professionals with a flexible and convenient way to leverage Excel’s capabilities for their automation projects.

Further reading:  ControlNet: A Reliable and High-Speed Industrial Network Protocol

If you’re interested in learning more about similar topics or require additional training, let us know in the comments section. Also, don’t forget to download the RealPars app for access to a wealth of practical knowledge as an automation engineer. Stay tuned for more informative articles and fresh videos each week!

YouTube video
How to Use Microsoft Excel for Real-Time Communication with Rockwell Controllers