Author Topic: Instructions For Logging Data Through Cycle  (Read 2134 times)

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Instructions For Logging Data Through Cycle
« on: May 16, 2017, 03:46:15 PM »
I have been searching for a video to show how to create a datalog on a project. I need to log 8 (integer) temperatures and 1 (real number) pressure with date/time for the length of a cycle that can be 5 hours, and not log when NotInCycle bit is on. This is for a AB SLC503.

I would like to have a separate Excel log for each cycle run that can be copied and archived with the lot's archive. Or after a cycle would the log be copied and deleted for the next cycle?

Is there a video that shows a good way of doing this?


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Instructions For Logging Data Through Cycle
« Reply #1 on: May 16, 2017, 06:45:18 PM »
Since you want to store the data in Excel files, the first thing you want to do is get familiar with EPPlus. You can Google that to find a lot of examples. This is one:

http://www.jimmycollins.org/blog/?p=547

There are also some sample projects using Excel:

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

I would start with a blank Visual Studio project to get familiar with it, then use the concepts in AdvancedHMI.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Instructions For Logging Data Through Cycle
« Reply #2 on: May 17, 2017, 05:11:10 PM »
Archie,

Thanks for the good information


AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Instructions For Logging Data Through Cycle
« Reply #3 on: June 27, 2017, 11:03:46 AM »
Archie,

I have been working on this Excel log and have some questions:

How do I send a data point to an Excel file? Everything so far shows how to send a set text  or numerical value.

In naming the file does can it be named "[RecipeNumber][Date/Time] Cycle"? Again, everything I have come up with creates a file with a set name, and doesn't appear to close it and create a new file at the start of the next cycle.

When I wirte data into Column1 of the Excel file, how do I move the pointer to Column2 for the next minutes data

Would this write to the Excel file no matter what screen of AdvancedHMI was open, or would it have to be left on one screen during the entire cycle?

On that note, I have a screen with ChartByArray with line graphs showing the temperatures and pressure every minute, would that update is not on that screen?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Instructions For Logging Data Through Cycle
« Reply #4 on: June 28, 2017, 09:51:07 AM »
Did you check the sample project KeepingRecordsFromCLXtoExcelFile? It shows how to read a value from a PLC and put it into an Excel file:

Code: [Select]
Dim EndTime As String = EthernetIPforCLXCom1.Read("FillRecords[0].EndTime")
ExcelPackage.Workbook.Worksheets(1).Cells(FirstBlankRow, 1).Value = EndTime


The screen that does the logging will either need to be left open or remove the code behind the form that StopsComsOnHidden

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Instructions For Logging Data Through Cycle
« Reply #5 on: June 28, 2017, 01:28:50 PM »
Archie,

Thanks, I have been going through all the links search showed up and somehow skipped over that section in the sample project.