User Tag List

Results 1 to 3 of 3

Thread: ControlLogix and CompactLogix Datalogging to CSV File

  1. #1
    Administrator Shawn Tierney's Avatar
    Join Date
    Sep 2016
    Location
    Berkshires, MA
    Posts
    2,348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Thanks Given 
    24
    Thanks Thanks Received 
    6
    Thanked in
    6 Posts

    ControlLogix and CompactLogix Datalogging to CSV File

    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,...

    Click here to view the full article.
    Looking for affordable automation training? If you are, check out my courses at TheAutomationSchool.com!

  2. #2
    Member Emocowmoo's Avatar
    Join Date
    Feb 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    I found this thread to be very useful. I downloaded the Rockwell logic and put it into my controller, but then what!? I was logging data of nothing essentially. I've played around with this for several days to try to make the logic useful to me and I came up with a couple helpful things I think others might be interested in trying in order to collect specific data (in my case I'm collecting 2 vibration signals and a speed reference of our machine).

    One thing I noticed was that when the memory card was removed and then put back in, the logic seemed to get "stuck" and wouldn't log data anymore. I wrote a small branch of logic to "unlatch" the cfbw01.busy bit since when the memory card is removed and put back in, this bit gets stuck on and never allows the logic sequence to continue, so it doesn't log data. My logic addition will reset this 5 minutes after the memory card has been put back in (see image below).
    2.jpg

    And also, I wanted to create a .csv file on a daily basis rather than file size to make organizing our data more useful. I have my logic writing to a single file daily until midnight, then it'll create a new file for the next day and will log until midnight comes around again.3.jpg In my case, midnight happens to be when the Idt.hour bit hits '6' (this is a work in progress, I'm trying my best to figure out this logic and edit it to be useful to me). Once it hits midnight, it'll finish writing to the one .csv file for the day and create a new one... see image: 4.jpg

    Ultimately, what we want is to log data, our own data. This is done in the Raw2ascii structured text routine. Their first 2 "groups" of logic in this routine are written to log the date and time. That's good, but I also wanted to log my data for the specific date and time stamps that were being logged. I pretty much copied and pasted the first 2 "groups" of logic and edited it to use the bits I wanted to monitor in the PLC, see image: 5.jpg


    With all this being said, I now log the data I want to see, along with meaningless extra stuff that is being written to this .csv file: 6.jpg. The first 5 columns are the Date, Time, Vibration Data, Vibration Data, and Speed. The last several columns are meaningless (where it writes the values 1-10 for each row). I ended up making a macro in Excel to delete these meaningless numbers.

    Like I mentioned, this is still a work in progress, but ultimately what I'd like this logic to do is to ONLY collect the data I want and figure out how to not write the rest of that meaningless stuff to the .csv file. And I'd like to figure out how to write a top row in every .csv file that has all the headers for what each column represents.

    I hope this helps some people, I was unable to find any real examples of how to manipulate Rockwell's logic to make it their own, so I had to give it a try on my own. Btw, I'm an electrical engineer with 3 1/2 years of programming experience, so I'm still fairly new to the world of programming, but hope this helps some people.

  3. #3
    Administrator Shawn Tierney's Avatar
    Join Date
    Sep 2016
    Location
    Berkshires, MA
    Posts
    2,348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Thanks Given 
    24
    Thanks Thanks Received 
    6
    Thanked in
    6 Posts
    Good morning Emocowmoo,

    Thanks for sharing your experience with us! Some day I hope to have the time to play around with this code myself!

    Sincerely,

    Shawn Tierney, The Automation Blog
    Looking for affordable automation training? If you are, check out my courses at TheAutomationSchool.com!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •