CompactLogix - Saving Fill Records from PLC to server.

KristienP

Member
Join Date
Jan 2015
Location
Nova Scotia
Posts
44
Customer has a site that fills trailers, a Fill Record is kept on each one (start time, finish time, volume, truck ID, etc) in the PLC. Currently, the Fill Record is a custom data type (Fill_Records), consisting of DINT, REAL, and STRING tags.

There are 500 records kept in an array of the custom data type (Data Type = Fill_Records[500]), sorted from newest to oldest, the oldest gets deleted when a new record is added. The values are viewed from FactoryTalk View on a pop-up. They can scroll through all 500 of them.

What the customer wants is to be able to keep a years worth of fill records (I don't have a specific number, but it's multiple trailers a day, every day of the year), and have the values stored on their server, and in a printer friendly version.

Can I setup Excel/CSV to read the data from the PLC? Can the PLC be set to write the values from these tags into an Excel/CSV file? I'm at a bit of a loss on how to keep up to date fill records for them.

Historian would just log the values, and over-write the previous value every time a new truck is filled and the Fill_Records[500] array updates (Fill_Records value shift one place in the array).
 
FactoryTalk View ME or SE? If SE you can write a VBA function to append the values of Fill_Records[0] whenever a truck is finished and the array is updated to a CSV, or store them in a database if you like.
 
I was in the process of creating an AdvancedHMI sample project to do something very similar. I went ahead and set up the sample to be almost exactly as you described. The project can be downloaded from here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects

The zip file is named KeepingRecordsFromCLXToExcelFile

If you wanted to use this, you only need the free Visual Studio Community Edition (2013 or 2015) to edit the project. Once open with VS, edit PLCConfig.ini to set the IP address of the PLC. Then change the property of the BasicLabel to point to the trigger tag in the PLC. And finally double click the form to get back to the code and edit the name of the tags to be saved in the Excel file.

This project will be a complete stand-alone project not needing any OPC server or run time license.
 
I was in the process of creating an AdvancedHMI sample project to do something very similar. I went ahead and set up the sample to be almost exactly as you described. The project can be downloaded from here:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects

The zip file is named KeepingRecordsFromCLXToExcelFile

If you wanted to use this, you only need the free Visual Studio Community Edition (2013 or 2015) to edit the project. Once open with VS, edit PLCConfig.ini to set the IP address of the PLC. Then change the property of the BasicLabel to point to the trigger tag in the PLC. And finally double click the form to get back to the code and edit the name of the tags to be saved in the Excel file.

This project will be a complete stand-alone project not needing any OPC server or run time license.

I don't actually have any experience with Visual Studio. I found PLCConfig.ini just fine, but have no idea where the BasicLabel is that needs to be modified, or where to edit the names of the tags.
 
First thing to do is Build->Build Solution to make sure all of the files are up to date.

In Solution Explorer, you will see 3 projects. Expand down (if not already) the AdvancedHMI project and under that you will see MainForm.vb under that. Double click that to open it in Design view

On the form you will see a label (BasicLabel). Click on that once to select.

In the Properties Window, look for PLCAddressValue. Set that to a Bool tag that will go True to indicate a record is ready to save

Back in the MainForm design view, right click in a blank area and select View Code. You will now see some VB code with plenty of comments. In that code you will see where it reads tags. Edit those tag names to match your PLC program tags.
 

Similar Topics

I'm using a 1769-L16ER-BB1B. I'm storing recipe data in an array of user-defined data types. For disaster recovery purposes, I need to make sure...
Replies
12
Views
8,830
Hi everyone, i have a compact logic 1769-L18 PLC and I'm using FTalk View ME for the display. I wanted to do some visualization on Grafana. At...
Replies
1
Views
95
Does anyone know what the data transfer rate for this series of CompactLogix PLC's? 1769-L24ER-QB1B to be exact. Cheers.
Replies
1
Views
91
Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
112
Hello all, and thank you in advance for any assistance you may be able to provide! This is my first post, so if I need to reformat or change...
Replies
8
Views
429
Back
Top Bottom