hello
i am using a cr800 to connect to a SDI12 sensor. Afterwards, i connect to a ftp server to sent the data to the server. This works for a couple of times, however after several scans the connection to the ftp server fails. However, when reinstalling the same program, the code works perfectly for a next couple of time. I guess that i somewhere overwrite memory so that the logger gets confused. I have three ideas how i might solve the problem.
1) Having a correct code (so ... does someone see a problem in the code below?)
2) Giving a command that the code should be recompiled after several scans (however, does such a command exist).
3) Automatically turn the datalogger off and on which enforces the logger to recompile the progroam (however, is it possible that the logger turns off and on by himself?)
Thanks for any hints
CODE:
'CR800 Series Datalogger
'Declare Public Variables
'Example:
Public PTemp, batt_volt
Public YSIMeasure(16) As String *128
Public YSIDatum, YSIZeit As String *128
Public YSITemp_C, YSILeitf_mS_cm, YSITiefe_Fuss, YSITrueb_FNU, YSIBatt_V
Public FTPSuccess As Boolean
Public LastFname As String * 256
Public OutStat As Boolean
Public fname As String * 256
Public rTime(9) 'declare as public and dimension rTime to 9
Public FileToSend As String * 256
Public FEOF As Long
Public fid1, fid2, fid3 As Long
Public i
Const Ort = "somewhere"
'Define Data Tables
DataTable (Daten,1,-1)
'DataInterval (0,10,Min,10)
TableFile("USR:Daten_",8,1,0,24,Hr,OutStat,LastFname)
Minimum (1,batt_volt,FP2,0,False)
Sample (1,PTemp,FP2)
Sample (1,YSITemp_C, FP2)
Sample (1,YSILeitf_mS_cm, FP2)
Sample (1,YSITiefe_Fuss, FP2)
Sample (1,YSITrueb_FNU, FP2)
Sample (1,YSIBatt_V,FP2)
EndTable
'Main Program
BeginProg
SetStatus("USRDriveSize",1000000)
Scan (15,Min,0,0)
PanelTemp (PTemp,250)
Battery (Batt_volt)
SDI12Recorder (YSIMeasure(),1,0,"M!",1.0,0)
YSIDatum = YSIMeasure(1)
YSIZeit = YSIMeasure(2)
YSITemp_C = YSIMeasure(3)
YSILeitf_mS_cm = YSIMeasure(4)
YSITiefe_Fuss = YSIMeasure(5)
YSITrueb_FNU = YSIMeasure(6)
YSIBatt_V = YSIMeasure(7)
CallTable Daten
If OutStat Then
OutStat = False
'... here is the code to connect to the ftp server
EndIf
NextScan
EndProg
SoilResearcher,
First, what version of the CR800 OS are you using?
Second, what communication device are you using?
Third, does the value of CommsMemFree get smaller with each scan?
Certainly with the FileManage command you can address #2) (recompile under program control), however this would not be a favorable solution. Answer the above questions, and we'll get to the bottom of this.
Sam x839