A couple of years ago, prior to the release of Studio 5000 v21, Rockwell demonstrated a future feature for it's new “multi-core” programmable automation controllers. This new feature was a very robust, controller based data logging system.
Unfortunately, since that demo a couple of years back nothing more has been hear about this feature. Well, at least I haven't been able to find anything out despite my efforts. However, I can confirm it's not in the soon to be released version 22, which was the originally targeted release.
But even without that new feature there is a way to log CSV files to you CompactLogix or ControlLogix's Compact Flash or SD card. And it's accomplished with a piece of free sample code from Rockwell's own sample code website. Below is a link to the free code in question:
Having tested the sample myself, I have to say it works as advertised. Simply changed the code to match your processor model and version (the sample code is version 17,) change one rung to indicate the slot of your processor, and download.
There are two Tags in the program
which controls it's behavior. The first Tag is the “logging_enabled” bit, which does just what it says. The second Tag is “max_file_size,” and this is the setpoint that when reached will unlatch the “logging_enabled” bit.
The output of this program is a CSV file which is easily opened in Microsoft Excel. Once open, you set the first column to the Date format, and the second column to Time format, and you end up with a document which looks just like the example below:
In my opinion, to make this code fully functional the following features would need to be added:
- Easy way to tell which tags are being logged, and add new tags to be logged.
- Addition of a series of tags to be used as “row 1 headers”
- Automatically create new files at a predetermined time (midnight)
- Easy way to specify CSV file naming parameters
- Automatic deletion of older files after a certain number of files are present, or a percentage of the card had been filled.
That said, if you need to log to your CompactLogix or ControlLogix external CF or SD card, this sample code is a simple and easy to use free solution.
I hope you've found this article about logging to a CompactLogix or ControlLogix external CF or SD card helpful. If you have any questions, comments, or corrections, please don't hesitate to share them with us by using the “post a comment or question” link below.
- Community Q & A: Questions of the Week - October 26, 2021
- MDT AutoSave: Automatic Backup, Compare, Archive (P81) - October 21, 2021
- Top Ten Podcast Episodes - October 18, 2021