Hello everyone,
I created a script allowing to create a daily file each day after midnight but I have some troubles among campbelle dataloggers. For one of them, all is OK and the file is well generated. For others, the program runs well for a time and then no more files are created and I dont know why.
Here is some precisions of the device :
- USR drive of about 1.5 Mb is created for each datalogger (no NL115 or 116 available, but if it is necessary, I will buy).
- once the file created on the USR, it is then automatically downloaded with schedule in Setup and deleted just after so that the USR cannot be saturated with files. It also prevents any problem of data loss, if for example the PC running Loggernet is shutting down
- here is the code I'me using :
in the DataTable inscrutions :
TableFile ("USR:BBCasBS01.dat",11,7,0,1,Day,Outstat,Lastfilename)
a subroutine for time :
Sub BBCasTimeFormat
Public TimeStamps As String *17
Public rTime(9)
Public YYYY As String *4
Public MM As String *2
Public DD As String *2
Public hh As String *2
Public mn As String *2
Public ss As String *2
RealTime(rTime)
YYYY = rTime(1)
If rTime(2)<10 Then MM ="0"&rTime(2) Else MM = rTime(2)
If rTime(3)<10 Then DD ="0"&rTime(3) Else DD = rTime(3)
If rTime(4)<10 Then hh ="0"&rTime(4) Else hh = rTime(4)
If rTime(5)<10 Then mn ="0"&rTime(5) Else mn = rTime(5)
If rTime(6)<10 Then ss ="0"&rTime(6) Else ss = rTime(6)
TimeStamps = YYYY&MM&DD&hh&mn&ss
EndSub
The creation of daily file :
If Outstat Then
Lastfiletime = BBCasBS01.Timestamp(3,1)
SplitStr(timearray(),Lastfiletime,"",6,0)
Desiredtime = timearray(3)&timearray(2)&timearray(1)&timearray(4)&timearray(5)
Newfilename = "USR:BBCas_BM_"+Desiredtime+"_L01_F01.dat"
FileRename(Lastfilename,Newfilename)
EndIf
NextScan
If you have ideas of what is happening ?