3/17/2019 3:36 AM | |
Posts: 1 Rating:
|
can you help if this script is not running merhaba; script'le datalogger yazmaya calisiyorumelimde bu var ama calismiyor yardimci olurmusun kolaygelsin Dim fileName, folderName, fileLocation fileName = Year(Now()) & "_" & Month(Now()) & "_" & Day(Now()) & ".csv" folderName = "\Storage Card USB\Logs\" fileLocation = folderName & filename 'Continue even if there is an error On Error Resume Next 'Create File System Object Set fso = CreateObject("FileCtl.FileSystem") 'Check if the folder already exists If (fso.Dir(folderName)) = "" Then fso.MkDir folderName End If If Err.Number <> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " " & Err.Description Err.Clear End If 'Create FileCtl.File object Set fctl = CreateObject("FileCtl.File") 'Open our csv file for appending fctl.Open fileLocation, 8 If Err.Number <> 0 Then ShowSystemAlarm "Error # " & CStr(Err.Number)& " " & Err.Description Err.Clear End If currentPosition = fctl.Loc nextPosition = fctl.Seek 'If we just created the file, write the header If currentPosition = 1 And nextPosition = 1 Then fctl.LinePrint "Time, Data Point 1, Data Point 2, Data Point 3, Data Point 4, Data Point 5" End If currentTime = Hour(Time) & ":" & Minute(Time) & ":" & Second(Time) 'Create our comma separated string of data values dataValues = currentTime & _ SmartTags("DataPoint1") & ", " & _ SmartTags("DataPoint2") & ", " & _ SmartTags("DataPoint3") & ", " & _ SmartTags("DataPoint4") & ", " & _ SmartTags("DataPoint5") fctl.LinePrint dataValues fctl.Close ------------------------------------------------------------------------------------------ |
Last edited by: AutoGen_823704 at: 3/17/2019 3:39:00 AMLast edited by: Jen_Moderator at: 3/18/2019 12:11:18 PMNew subject after splitting |
|
Follow us on