
Nebul0us (Customer) asked a question.
How can I read data from an Excel spreadsheet with a P3-550 PAC controller?
I am using Productivity 3000 programming suite with a P3-550 controller. I need to read data from an Spreadsheet. Can this be done? Thanks in advance for helping!
Hi Nebul0us,
Here is a post that will use Excel to retrieve data using Modbus TCP. (Ethernet)(VBA)
HOW TO IMPLEMENT MODBUS TCP PROTOCOL USING VBA WITH EXCEL
I would recommend using a program like AdvancedHMI. Save the data to a database and then view the data in the database.This will allow you to have multiple PC with excel to link to you data.
PRODUCTIVITY 1000 SERIES PLC ADVANCEDHMI MODBUS TCP ETHERNET COMMUNICATION
I hope this helps you out.
Regards,
Garry
Thanks for the link, I check it out. We are using Wonderware for our HMI/SCADA system with Modbus comms.
So the link looks like it is for reading PLC data and writing that data to the spreadsheet. I need to do the opposite of that. I need to read the spreadsheet data and write it to the PLC. Any ideas?
Hi Nebul0us,
In the code you will see the write commands. It is commented out because I did not need them for my sample.
Regards,
Garry
Yes, but it depends on what level of effort you're looking at. See below example:
https://accautomation.ca/how-to-implement-modbus-tcp-protocol-using-vba-with-excel/
The video is using BRX as example PLC but the implementation is through Modbus. If Garry sees this post he'll be able to tell you the best approach.
I wish that AD would release a BORG API for PxK.
The structure and implementation is dirt-simple, but is not publicly available/supported..
If you want to stay away from Modbus, maybe try DataWorx 2020 Standard from BizWareDirect. AD use to have a video using a DataWorx P3K instruction (software from BizWareDirect) from the Productivity programming suite but have since taken it down because BizWareDirect didn't offer upgrades to the newer versions of Windows. That has now changed, but I do not think that they have upgradded DataWorx P3k yet.
I've done something similar using CSV files saved from Excel and pulling them into the P3-550 through the SD card. One trick that helped was figuring out how to separate date and time in Excel first, especially if you're logging timestamps. You can use Excel formulas like INT for dates and MOD for time. Once split, it's easier to parse each part in the PAC using standard string handling.
i use Pymodbus quite frequently to communicate with different PLC that support modbus. i generally use csv instead of excel but that is because our MES system exports csv files that i need to get the data to the PLC but excel files shouldn't be a problem either.
https://pymodbus.readthedocs.io/en/latest/source/examples.html