-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUC_FortOrd.CR1
More file actions
251 lines (218 loc) · 6.66 KB
/
UC_FortOrd.CR1
File metadata and controls
251 lines (218 loc) · 6.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
' Fort Ord UC Reserve
' CDMA
' IP address : XXX.XXX.XXX.XXX programmed
' netmask : XXX.XXX.XXX.XXX
' gateway : XXX.XXX.XXX.XXX
'CR1000 Series Datalogger
'date: September 1, 2016
'program author: Greg McCurdy
'Wiring:
'1H - HMP60 AT/RH (black)
'1L - HMP60 AT/RH (white)
'AG - HMP60 AT/RH (blue,clear)
' - CS106 BP (yellow,clear)
'2H - CS106 BP (blue)
'2L - Li200s RS (red) SN PY90536
'AG - Li200s RS (black,clear)
' - Li190 PAR (black, clear)
'3H - Li190 PAR (red) SN Q101956 cal 7.1
'3L - 05103 WD (green)
'AG - TB4 RG Temp TC (red)
'4H - TB4 RG Temp TC (blue)
'4L -
'EX1 - 05103 WD (blue)
'AG - 05103 WD (white, clear)
'P1 - 05103 WS (red)
'AG - 05103 WS (black)
'P2 - TB4 RG (black)
'AG - TB4 RG (white,clear)
'5H - TC 10m (blue)
'5L - TC 2m (blue)
'AG - TC 10m & TC 2m (red)
'6H - Soil Temp TC ST 2" (blue)
'6L - Soil Temp TC ST 4" (blue)
'AG - Soil Temp TC ST 2",4",8",20" (red)
'7H - Soil Temp TC ST 8" (blue)
'7L - Soil Temp TC ST 20" (blue)
'AG - CS616 SM (blk,clr)
'8H - CS616 SM 4" (green)
'8L - CS616 SM vert (green)
'AG -
'EX2 -
'AG -
'EX3 -
'AG -
'G -
'5V -
'G -
'SW12 -
'G - CS106 BP (black)
'12V - CS106 BP (red)
' - HMP60 AT/RH (brown)
'12V - CS616 SM 4" (red)
' - CS616 SM vert" (red)
'G -
'C1 -
'C2 -
'C3 -
'C4 - CS106 BP (green)
'G -
'C5 - CS616 SM 4" (orange)
'C6 - CS616 SM vert (orange)
'C7 -
'C8 -
'G -
'Declare Public Variables
'Example:
Public PTemp, batt_volt, Sta_Id, AT_C, RH_pct, BP_mb, BP_inHG, RS_kw_m2, PAR
Public WS_mph, WD, PCPN_in, PCPN_tot, RGTemp_C
Public Soil_T2_C, Soil_T4_C, Soil_T8_C, Soil_T20_C
Public delta_T_C, TC_C_10, TC_C_2
Public Jdate
Public VWC4,VWC_V
Public CS616_4,CS616_V
Public SMFlag
Public rTime(9) 'declare as public and dimension rTime to 9
Alias rTime(1) = Year 'assign the alias Year to rTime(1)
Alias rTime(2) = Month 'assign the alias Month to rTime(2)
Alias rTime(3) = Day_of_Month 'assign the alias Day_of_Month to rTime(3)
Alias rTime(4) = Hour 'assign the alias Hour to rTime(4)
Alias rTime(5) = Minute 'assign the alias Minute to rTime(5)
Alias rTime(6) = Second 'assign the alias Second to rTime(6)
Alias rTime(7) = uSecond 'assign the alias uSecond to rTime(7)
Alias rTime(8) = WeekDay 'assign the alias WeekDay to rTime(8)
Alias rTime(9) = Day_of_Year 'assign the alias Day_of_Year to rTime(9)
Const a0 = -0.0663
Const a1 = -0.0063
Const a2 = 0.0007
'Define Data Tables
DataTable (TenMin,1,-1)
DataInterval (0,10,Min,0)
CardOut (0 ,-1)
Sample (1,Day_of_Year,FP2)
Sample (1,Hour,FP2)
Average (1,RS_kw_m2,FP2,False)
Maximum (1,RS_kw_m2,FP2,False,False)
Minimum (1,RS_kw_m2,FP2,False,False)
StdDev (1,RS_kw_m2,FP2,False)
Average (1,PAR,FP2,False)
Maximum (1,PAR,FP2,False,False)
Minimum (1,PAR,FP2,False,False)
WindVector (1,WS_mph,WD,FP2,False,0,0,2)
Maximum (1,WS_mph,FP2,False,False)
StdDev (1,WS_mph,FP2,False)
Minimum (1,WS_mph,FP2,False,False)
Maximum (1,AT_C,FP2,0,False)
Minimum (1,AT_C,FP2,0,False)
Average (1,AT_C,FP2,False)
Maximum (1,RH_pct,FP2,0,False)
Minimum (1,RH_pct,FP2,0,False)
Average (1,RH_pct,FP2,False)
Average (1,BP_mb,IEEE4,False)
Totalize (1,PCPN_in,FP2,False)
Sample (1,PCPN_tot,FP2)
Average (1,RGTemp_C,FP2,False)
Maximum (1,TC_C_2,FP2,0,False)
Minimum (1,TC_C_2,FP2,0,False)
Average (1,TC_C_2,FP2,False)
Maximum (1,TC_C_10,FP2,0,False)
Minimum (1,TC_C_10,FP2,0,False)
Average (1,TC_C_10,FP2,False)
Maximum (1,delta_T_C,FP2,0,False)
Minimum (1,delta_T_C,FP2,0,False)
Average (1,delta_T_C,FP2,False)
Maximum (1,Soil_T2_C,FP2,0,False)
Minimum (1,Soil_T2_C,FP2,0,False)
Average (1,Soil_T2_C,FP2,False)
Maximum (1,Soil_T4_C,FP2,0,False)
Minimum (1,Soil_T4_C,FP2,0,False)
Average (1,Soil_T4_C,FP2,False)
Maximum (1,Soil_T8_C,FP2,0,False)
Minimum (1,Soil_T8_C,FP2,0,False)
Average (1,Soil_T8_C,FP2,False)
Maximum (1,Soil_T20_C,FP2,0,False)
Minimum (1,Soil_T20_C,FP2,0,False)
Average (1,Soil_T20_C,FP2,False)
Average (1,VWC4,FP2,False)
Average (1,VWC_V,FP2,False)
Average (1,CS616_4,FP2,False)
Average (1,CS616_V,FP2,False)
Maximum (1,batt_volt,FP2,0,False)
Minimum (1,batt_volt,FP2,0,False)
Average (1,batt_volt,FP2,False)
Average (1,PTemp,FP2,False)
Sample (1,Sta_Id,FP2)
EndTable
'Define Subroutines
'Sub
'EnterSub instructions here
'EndSub
'Main Program
BeginProg
Scan (3,Sec,0,0)
If TimeIntoInterval (3,1440,Min)
SW12(0)
EndIf
If TimeIntoInterval (5, 1440, Min)
SW12(1)
EndIf
If batt_volt > 12.9 Then
SW12(1)
EndIf
If batt_volt < 12.1 Then
SW12(0)
EndIf
If TimeIntoInterval (0,60,sec) Then
SMFlag = 1
Else
SMFlag = 0
EndIf
'Store Current date and time
RealTime (rTime)
Hour = (Hour*100) + Minute
'set Station Id
Sta_Id = 423
' Datalogger Panel temperature
PanelTemp (PTemp,250)
' Datalogger Battery Voltage
Battery (batt_volt)
' HMP60 AT/RH
VoltSe (AT_C,1,mV2500,1,0,0,_60Hz,0.1,-40.0)
VoltSe (RH_pct,1,mV2500,2,0,0,_60Hz,0.1,0)
If (RH_pct > 100) AND (RH_pct < 108) Then RH_pct = 100
' Barometric Pressure (CS106)
PortSet (4 ,1 )
Delay (0,1,Sec)
VoltSe (BP_mb,1,mV2500,3,0,0,_60Hz,0.240,500)
PortSet (4,0)
BP_inHG = BP_mb * .02954
' Solar Radiation (LiCor 200s)
VoltSe (RS_kw_m2,1,mV250,4,1,0,_60Hz,0.2,0)
' PAR (Licor 190s)
VoltSe (PAR,1,mV25,5,1,0,_60Hz,0.140845,0) 'SN Q101956
' Wind Speed/Wind Dir (RM Young 05103)
PulseCount (WS_mph,1,1 ,1,1,0.2192,0)
BrHalf (WD,1,mV2500,6,Vx1,1,2500,True ,0,_60Hz,355,0)
' AT profile
TCSe (TC_C_10,1,mV2_5C,9,TypeT,PTemp,1,0,250,1.0,0)
TCSe (TC_C_2,1,mV2_5C,10,TypeT,PTemp,1,0,250,1.0,0)
delta_T_C = TC_C_10 - TC_C_2
' Soil Temperature Thermocouple
TCSe (Soil_T2_C,1,mV2_5C,11,TypeT,PTemp,True ,0,250,1.0,0)
TCSe (Soil_T4_C,1,mV2_5C,12,TypeT,PTemp,True ,0,250,1.0,0)
TCSe (Soil_T8_C,1,mV2_5C,13,TypeT,PTemp,True ,0,250,1.0,0)
TCSe (Soil_T20_C,1,mV2_5C,14,TypeT,PTemp,True ,0,250,1.0,0)
' CS616 Soil Moisture
If SMFlag = 1 Then
CS616 (CS616_4,1,15,5,1,1.0,0)
CS616 (CS616_V,1,16,6,1,1.0,0)
VWC4 = a0 + a1*CS616_4 + a2*CS616_4^2
VWC_V = a0 + a1*CS616_V + a2*CS616_V^2
EndIf
' TB4 Tipping Bucket Raingauge
PulseCount (PCPN_in,1,2,2,0,0.01,0)
PCPN_tot = PCPN_tot + PCPN_in
TCSe (RGTemp_C,1,mV2_5C,7,TypeT,PTemp,1,0,250,1.0,0)
CallTable TenMin
NextScan
EndProg