I don't use RSViewSE, but in RSView32, I use the internal Visual Basic program to write a VB program that: (1) sets up the CSV data log location on a hard drive, (2) selects the tags to be logged, (3) writes the CSV data file at an interval determined by an action in the EVE (Events) internal RSView program.
Here is an example that logs 4 tags to a file named "Hot Gas mmddyy", with the date changing at midnight.
Public Sub WriteCSVLogFile()
Dim AIT240 As Tag
Dim FUELLOGTOTAL As Tag
Dim RECIPE_START As Tag
Dim SYSTEMRUN As Tag
Dim LogDate As Date
Dim LogFile As Integer
Dim HeaderTrack As Integer
Dim HeaderPrint As Integer
On Error GoTo catch
MkDir ("C:\HOT_GAS_LOG")
Check:
'Check to see if the header needs to be inserted.
'HeaderTrack is an Integer bit that is set to 0 if it is 12:00 AM, otherwise set = 1.
If ((Format$(Time, "hh:mm:ss") >= #12:00:00 AM#) And (Format$(Time, "hh:mm:ss") <= #12:01:00 AM#)) Or (HeaderPrint = 0) Then
HeaderTrack = 1
Else: HeaderTrack = 0
End If
Set AIT240 = gProject.TagDb("AIT240_SCALED")
Set FUELLOGTOTAL = gProject.TagDb("FUELLOG_TOTAL")
Set RECIPESTART = gProject.TagDb("RECIPE_START_PB")
Set SYSTEMRUN = gProject.TagDb("SYSTEM_RUN")
'Set LogDate equal to current date function.
LogDate = Date
'Get available file number
LogFile = FreeFile
'Open File for writing to and name file with format date.csv
Open "C:\HOT_GAS_LOG\" & Format$(LogDate, "mmddyy") & ".csv" For Append As #LogFile
'Insert the Header into the csv file between 12:00 and 12:01 AM (or next time program runs) and then insert the data in the correct columns.
If HeaderTrack = 1 Then
Print #LogFile, " TIME"; ","; _
"AIT-240_NOX"; ","; _
"TOTAL FUEL USED"; ","; _
"RECIPE ON/OFF"; ","; _
"SYSTEM_ON/OFF"; ","; _
'Insert data into column if the header was just inserted
Print #LogFile, Format$(Time, "hh:mm:ss"); ","; _
Format(AIT240.Value, "###0"); ","; _
Format(FUELLOGTOTAL.Value, "#######0"); ","; _
Format(RECIPESTART.Value, "#0"); ","; _
Format(SYSTEMRUN.Value, "#0"); ","; _
HeaderPrint = 1
Else
'If time is anything other than 12:00 and 12:01 midnight just insert the data
Print #LogFile, Format$(Time, "hh:mm:ss"); ","; _
Format(AIT240.Value, "###0"); ","; _
Format(FUELLOGTOTAL.Value, "#######0"); ","; _
Format(RECIPESTART.Value, "#0"); ","; _
Format(SYSTEMRUN.Value, "#0"); ","; _
End If
Close #LogFile
'If the directory already exists, skip to the next line
'Error 75 is directory already created or exists.
catch: 'Error handling routine
If Err.Number = 75 Then
Err.Clear
GoTo Check
Else:
If Err.Number = 4170 Then
Print "Error#4170--Communications driver is not available."
'roErrorTagEvent (4170) - an error occurred while waiting for the operation to complete
Err.Clear
GoTo Check
End If 'End errror #4170
Err.Clear
End If 'End errror handling
End Sub