Hi,
Thanks alot for your input, much appreciated
Yes the .dat file is highly configurable and i think/know it that i need to know.
Ive downloaded a .dat file from the wuhu group website, listed below.
I dont understand the wiring pinout mentioned on top of it, how to do that.
Ive run it on my datalogger but i get the number of fields error in Wuhu and cancelled all data updates because of that.
In Wuhu i dont have to use a .com port (it cant, i have just to select the cr1000 and the . Dat file), just a .dat file which the cr1000 can output as comma separate CSV file.
Here is the actual .dat file from the wuhu website:
'CR1000
'Date: 10/15/2013
'Author: Collin Daly - Campbell Scientific
'/////////////////////////////////////////////////////////////////////////////////////////
'/////////////////////////// W I R I N G F O R C R 1 0 0 0 /////////////////////////////
'/////////////////////////////////////////////////////////////////////////////////////////
'
'Insert wiring pinout here
'
'/////////////////////////////////////////////////////////////////////////////////////////
'/////////////////////////// V A R I A B L E S & U N I T S /////////////////////////////
'/////////////////////////////////////////////////////////////////////////////////////////
'
Dim AirTC
Public BattV
Public PTemp_C
Public BP_inHg
Public Rain_in
Public AirTF
Public RH
Public WS_mph
Public WindDir
Public WC_F
Public Tot24
Public TdF
Public PWSGetRequest As String * 500
Public PWSGetResponse As String * 500
Public Socket
'UTC TIme Variables
Dim TimeLong As Long
Public UTCTime As String * 30
Const UTC_OFFSET = -6*3600 '-6 Hours GMT (Adjust for your time zone)
Dim UTCTime$ As String * 30
Public UTCTime$$ As String * 30
'Units
Units BattV = Volts
Units PTemp_C = Deg C
Units BP_inHg = inHg
Units Rain_in = inch
Units AirTF = Deg F
Units RH = %
Units WS_mph = miles/hour
Units WindDir = degrees
Units WC_F = Deg F
Units TdF = Deg F
'
'/////////////////////////////////////////////////////////////////////////////////////////
'//////////////////////////////// D A T A T A B L E S ///////////////////////////////////
'/////////////////////////////////////////////////////////////////////////////////////////
'
DataTable(TimeTable,true,1)
TableHide
Sample(1,TimeLong,NSEC)
EndTable
'
DataTable(Hourly,True,-1)
DataInterval(0,60,Min,10)
Average(1,BP_inHg,FP2,False)
Totalize(1,Rain_in,FP2,False)
Average(1,AirTF,FP2,False)
Maximum(1,AirTF,FP2,False,True)
Minimum(1,AirTF,FP2,False,True)
Sample(1,RH,FP2)
Average(1,WS_mph,FP2,False)
Maximum(1,WS_mph,FP2,False,True)
Minimum(1,WS_mph,FP2,False,True)
Sample(1,WindDir,FP2)
EndTable
'
DataTable(Daily,True,-1)
DataInterval(0,1440,Min,10)
Minimum(1,BattV,FP2,False,False)
Average(1,BP_inHg,FP2,False)
Totalize(1,Rain_in,FP2,False)
Average(1,AirTF,FP2,False)
Maximum(1,AirTF,FP2,False,True)
Minimum(1,AirTF,FP2,False,True)
Sample(1,RH,FP2)
Average(1,WS_mph,FP2,False)
Maximum(1,WS_mph,FP2,False,True)
Minimum(1,WS_mph,FP2,False,True)
Sample(1,WindDir,FP2)
EndTable
'
'/////////////////////////////////////////////////////////////////////////////////////////
'/////////////////////////////// M A I N P R O G R A M //////////////////////////////////
'/////////////////////////////////////////////////////////////////////////////////////////
'
BeginProg
'Main Scan
Scan(5,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_60Hz)
'CS106 Barometric Pressure Sensor measurement 'BP_inHg'
If IfTime(59,60,Min) Then PortSet(1,1)
If IfTime(0,60,Sec) Then
VoltSe(BP_inHg,1,mV2500,1,1,0,_60Hz,0.240,500)
BP_inHg = BP_inHg*0.02953
PortSet(1,0)
EndIf
'TE525/TE525WS Rain Gauge measurement 'Rain_in'
PulseCount(Rain_in,1,1,2,0,0.01,0)
'HC2S3 (constant power) Temperature & Relative Humidity Sensor measurements 'AirTF' and 'RH'
VoltSe(AirTF,1,mV2500,2,0,0,_60Hz,0.18,-40)
VoltSe(RH,1,mV2500,3,0,0,_60Hz,0.1,0)
If RH>100 AND RH<103 Then RH=100
'05103 Wind Speed & Direction Sensor measurements 'WS_mph' and 'WindDir'
PulseCount(WS_mph,1,2,1,1,0.2192,0)
BrHalf(WindDir,1,mV2500,4,2,1,2500,True,0,_60Hz,355,0)
If WindDir>=360 Then WindDir=0
'Wind Chill calculation 'WC_F'
WC_F=35.74+0.6215*AirTF-35.75*WS_mph^0.16+0.4275*AirTF*WS_mph^0.16
If WC_F>AirTF OR WC_F=NAN Then WC_F=AirTF
If AirTF>50 OR WS_mph<3 Then WC_F=AirTF
'24 hour running total calculation 'Tot24'
Tot24=Tot24+Rain_in
If IfTime(0,1440,Min) Then Tot24=0
'Dew Point calculation 'TdF'
AirTC=(5/9)*(AirTF-32)
DewPoint(TdF,AirTC,RH)
If TdF>AirTC OR TdF=NAN Then TdF=AirTC
TdF=1.8*TdF+32
'Call Data Tables and Store Data
CallTable(Hourly)
CallTable(Daily)
NextScan
'
SlowSequence
Scan(1,min,0,0)
'Track current time
'Calculate UTC Time for Wunderground Output
TimeLong = Public.TimeStamp(1,1) - UTC_OFFSET
CallTable(TimeTable)
UTCTime = TimeTable.TimeLong(4,4) 'yyyy/MM/dd hr:mm:ss
UTCTime$ = Replace (UTCTime," ","+"):UTCTime$$ = Replace (UTCTime$,":","%3A")
'Refer to
http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol for PWS upload protocol documentation
'Change ID (yourid) and PASSWORD (yourpassword) to specific site settings
PWSGetRequest="GET /weatherstation/updateweatherstation.php?ID=yourid&PASSWORD=yourpassword&dateutc="+UTCTime$$ +"&winddir="+FormatFloat(WindDir,"%0.2f") _
+"&windspeedmph="+FormatFloat(WS_mph,"%0.2f")+"&humidity="+FormatFloat(RH,"%0.2f")+"&rainin="+FormatFloat(Rain_in,"%0.2f")+"&tempf=" _
+FormatFloat(AirTF,"%0.2f")+"&baromin="+FormatFloat(BP_inHg,"%0.2f")+"&dewptf="+FormatFloat(TdF,"%0.2f")+"&action=updateraw"+CHR(13)+CHR(10)
Socket=TCPOpen("rtupdate.wunderground.com",80,1024)
If Socket<>0 Then
'Transmit GET request
SerialOut(Socket,PWSGetRequest,"",0,0)
'Based on tests a legitimate User-Agent request-header field is required
SerialOut(Socket,"User-Agent: Mozilla/5.0"+CHR(13)+CHR(10),"",0,0)
'Based on tests a Host request-header field is not required
SerialOut(Socket,"Host: rtupdate.wunderground.com"+CHR(13)+CHR(10),"",0,0)
'Based on tests a final blank line (carriage return and line feed) is required
SerialOut(Socket,CHR(13)+CHR(10),"",0,0)
'Capture the GET request response for debugging purposes
SerialIn(PWSGetResponse,Socket,500,"",200)
EndIf
NextScan
EndSequence
EndProg
'
'/////////////////////////////////////////////////////////////////////////////////////////
'//////////////////////////////////////// E N D //////////////////////////////////////////
'/////////////////////////////////////////////////////////////////////////////////////////