AdvancedHMI Software

General Category => Support Questions => Topic started by: BRX_Noob on December 13, 2018, 05:00:08 PM

Title: Multiple CSV files
Post by: BRX_Noob on December 13, 2018, 05:00:08 PM
Hello,

So I am currently using Basic Data Logger 2 to save multiple points from the PLC. I am trying to do two things with this though.
The first is to implement a start test/ stop test button to create the file and store data collection for the time I start and stop. Currently, as soon as the interface is running, data is taken and continues until I close the program.
The second is to have multiple CSV files saved for each test, rather than just saving into the previous file.
Thanks
Title: Re: Multiple CSV files
Post by: Godra on December 13, 2018, 10:58:22 PM
Just a quick suggestion, not that I've tried it, would be to try using your button's Click event to assign a new name to the BasicDataLogger's log file every time the test is started or prior to starting it. A new name could possibly include the current Date+Time.

Title: Re: Multiple CSV files
Post by: BRX_Noob on December 14, 2018, 01:51:26 PM
How would I assign the click event? Currently all I see is PLC Address Click, which only assigns something to the PLC. In BasicDataLogger2 the file name is set as PLCDataLog.log, so I don't lnow how it would change that with the button.
Title: Re: Multiple CSV files
Post by: Godra on December 14, 2018, 10:38:42 PM
You should spend some time browsing this forum and reading the topics/posts.

This particular post explains how to access events and has a picture attached as well:

https://www.advancedhmi.com/forum/index.php?topic=2078.msg11795#msg11795

The code for changing the name could be similar to this:

Code: [Select]
    Private Sub BasicButton1_Click(sender As Object, e As EventArgs) Handles BasicButton1.Click
        Me.BasicDataLogger21.FileName = "PLCDataLog " & DateTime.Now.ToString("dd-MMM-yy HH:mm:ss")
    End Sub