Author Topic: Basic Data Logger 2  (Read 2952 times)

bkane

  • Newbie
  • *
  • Posts: 11
    • View Profile
Basic Data Logger 2
« on: February 28, 2018, 02:34:04 PM »
Hello

I am attempting to use the data logger 2 to write multiple values to a .csv file. I read in a previous forum post that the data can be separated into different columns using the prefix function. Does this mean I will have to use multiple data loggers for multiple outputs to put them in different columns? Or is there a way to do this using the collection function on the basic data logger 2? Also, sorry for the loaded post, but is there a way to create new .csv files every run? Or will the data logger overwrite the previous file every run?

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Basic Data Logger 2
« Reply #1 on: February 28, 2018, 05:33:38 PM »
The BasicDatalogger2 will log the value of the items listed in PLCAddressValueItems to the log file as comma separated values.

bkane

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Basic Data Logger 2
« Reply #2 on: February 28, 2018, 05:37:17 PM »
I was just going to reply to myself that I figured out what I was doing wrong. Thanks though.

But I still need to figure out how to stop writing to one .csv file and to create another one. For example, I want the logger to write to a different file every 24 hours or when I click a button. Is this at all possible?

NewControls

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Basic Data Logger 2
« Reply #3 on: March 02, 2018, 09:39:38 AM »
This is the way i have done that before, just take the "HH-mm" out of the code to make it store to a new file everyday.

Note that this time is coming from the PC this program is running on.

Code: [Select]
    Private Sub BasicDataLogger1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles BasicDataLogger1.DataChanged

        Dim logstamp As String = ".log"
        Dim timeStamp As String = DateTime.Now.ToString("yy-MM-dd-hh-mm")
        Dim Stamp As String

        Stamp = timeStamp & logstamp

        BasicDataLogger2.FileName = Stamp

    End Sub