;{CR23X} ;{CR23X} spin23b 1/31/2002 ver 3.3 ; ;Changes made by Jason Ritter, Campbell Scientific, Inc. ;on 3/29/02 ; ;Created Subroutine 1 for hourly data output ;Moved P95 to instruction to allow unconditional execution ; of Subroutine 1 ;Added command at end of subroutine 1 to reset intensity value ; to zero at the top of each hour ;Added hourly precipitation accumulator to make sure that total ; tips were being recorded ;Changed input location for air temp in deg-C and named it AT_C ;Changed location parameters for converting AT_C to tempf ;Changed label "dummy" to "_15minppt" ;added labels for input locations 26, 27, and 28 ; ;Saved file as SPIN23F2.CSI ; *Table 1 Program 01: 60 Execution Interval (seconds) ;Turn on AT/RH sensor (probably HMP45C) 1: Do (P86) 1: 41 Set Port 1 High ;Pause 150 msec before making measurements, so the ;probe can stabilize on true readings 2: Delay w/Opt Excitation (P22) 1: 1 Ex Channel 2: 15 Delay W/Ex (units = 0.01 sec) 3: 0000 Delay After Ex (units = 0.01 sec) 4: 0000 mV Excitation ;Measure the temperature in degrees-C 3: Volt (SE) (P1) 1: 1 Reps 2: 25 5000 mV, 60 Hz Reject, Fast Range 3: 1 SE Channel 4: 30 Loc [ AT_C ] 5: .1 Mult 6: -40 Offset ; Measure relative humidity in percent 4: Volt (SE) (P1) 1: 1 Reps 2: 25 5000 mV, 60 Hz Reject, Fast Range 3: 2 SE Channel 4: 1 Loc [ RH ] 5: .1 Mult 6: 0.0 Offset ;Turn off AT/RH sensor 5: Do (P86) 1: 51 Set Port 1 Low ;Measure 4 soil temperature probes, degrees Fahrenheit 6: Temp (107) (P11) 1: 4 Reps 2: 5 SE Channel ; 3: 1 Excite all reps w/E1 4: 3 Loc [ soiltem_1 ] 5: 1.8 Mult 6: 32 Offset 7: Excite-Delay (SE) (P4) 1: 1 Reps 2: 24 1000 mV, 60 Hz Reject, Slow Range 3: 9 SE Channel 4: 3 Excite all reps w/Exchan 3 5: 2 Delay (units 0.01 sec) 6: 1000 mV Excitation 7: 8 Loc [ _________ ] 8: 0.72 Mult 9: 0 Offset ;Measure solar radiation 8: Volt (Diff) (P2) 1: 1 Reps 2: 20 Auto, 60 Hz Reject, Slow Range (OS>1.06) 3: 6 DIFF Channel 4: 9 Loc [ solar ] 5: .2866 Mult 6: 0.0 Offset ; Measure windspeed, mph 9: Pulse (P3) 1: 1 Reps 2: 2 Pulse Channel 2 ; 3: 22 Switch Closure, Output Hz 4: 7 Loc [ wind_dir ] 5: 1.789 Mult 6: 0.629 Offset ;measure rain, inches 10: Pulse (P3) 1: 1 Reps 2: 1 Pulse Channel 1 3: 2 Switch Closure, All Counts 4: 10 Loc [ rain ] 5: .01 Mult 6: 0.0 Offset ;add rain tips to hourly accumulator 11: Z=X+Y (P33) 1: 31 X Loc [ hrly_rain ] 2: 10 Y Loc [ rain ] 3: 31 Z Loc [ hrly_rain ] ;put fixed values in locations 26, 27, 28 12: Z=F (P30) 1: 0.0 F 2: 0 Exponent of 10 3: 28 Z Loc [ zero ] 13: Z=F (P30) 1: 0.37 F 2: 0 Exponent of 10 3: 27 Z Loc [ _0_37____ ] 14: Z=F (P30) 1: 0.47 F 2: 0 Exponent of 10 3: 26 Z Loc [ _0_47 ] ;If pyanometer reading is negative, set to zero 15: If (X<=>F) (P89) 1: 9 X Loc [ solar ] 2: 4 < 3: 0 F 4: 30 Then Do 16: Z=F (P30) 1: 0.0 F 2: 0 Exponent of 10 3: 9 Z Loc [ solar ] 17: End (P95) ;If RH reading is greater than 100%, then ;set equal to 100% 18: If (X<=>F) (P89) 1: 1 X Loc [ RH ] 2: 3 >= 3: 100 F 4: 30 Then Do 19: Z=F (P30) 1: 100 F 2: 0 Exponent of 10 3: 1 Z Loc [ RH ] 20: End (P95) ;convert air temperature from celsius to fahrenheit 21: Z=X*F (P37) 1: 30 X Loc [ AT_C ] 2: 1.8 F 3: 2 Z Loc [ tempf ] 22: Z=X+F (P34) 1: 2 X Loc [ tempf ] 2: 32 F 3: 2 Z Loc [ tempf ] ; measure battery voltage 23: Batt Voltage (P10) 1: 13 Loc [ batt ] ;store value 6999 in location 16 24: Z=F (P30) 1: 6999 F 2: 0 Exponent of 10 3: 16 Z Loc [ blank99 ] ;Every 15 minutes, calculate rain values for intensity ;calculations 25: If time is (P92) 1: 0000 Minutes (Seconds --) into a 2: 15 Interval (same units as above) 3: 10 Set Output Flag High (Flag 0) 26: Set Active Storage Area (P80) 1: 3 Input Storage Area 2: 11 Loc [ _15minppt ] 27: Totalize (P72) 1: 1 Reps 2: 10 Loc [ rain ] 28: If (X<=>Y) (P88) 1: 11 X Loc [ _15minppt ] 2: 3 >= 3: 12 Y Loc [ intens ] 4: 30 Then Do 29: Z=X (P31) 1: 11 X Loc [ _15minppt ] 2: 12 Z Loc [ intens ] 30: End (P95) ;Call output subroutine every 60 minutes 31: If time is (P92) 1: 0000 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 1 Call Subroutine 1 *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines ;Subroutine to give hourly data output and ;reset intensity value to zero and ;reset hourly precip total to zero 1: Beginning of Subroutine (P85) 1: 1 Subroutine 1 2: Do (P86) 1: 10 Set Output Flag High (Flag 0) 3: Set Active Storage Area (P80) 1: 1 Final Storage Area 1 2: 115 Array ID 4: Real Time (P77) 1: 120 (Same as 220) D,Hr/Mn 5: Sample (P70) 1: 8 Reps 2: 1 Loc [ RH ] 6: Totalize (P72) 1: 1 Reps 2: 9 Loc [ solar ] 7: Sample (P70) 1: 1 Reps 2: 31 Loc [ hrly_rain ] 8: Sample (P70) 1: 1 Reps 2: 12 Loc [ intens ] 9: Sample (P70) 1: 1 Reps 2: 16 Loc [ blank99 ] 10: Sample (P70) 1: 1 Reps 2: 16 Loc [ blank99 ] 11: Sample (P70) 1: 1 Reps 2: 27 Loc [ _0_37____ ] 12: Sample (P70) 1: 1 Reps 2: 16 Loc [ blank99 ] 13: Sample (P70) 1: 1 Reps 2: 26 Loc [ _0_47 ] ;reset rainfall intensity value and hourly precip 14: Z=F (P30) 1: 0 F 2: 0 Exponent of 10 3: 12 Z Loc [ intens ] 15: Z=F (P30) 1: 0 F 2: 0 Exponent of 10 3: 31 Z Loc [ hrly_rain ] 16: End (P95) End Program 1 [ RH ] RW-- 2 2 ----- ------ --- 2 [ tempf ] RW-- 2 2 ----- ------ --- 3 [ soiltem_1 ] RW-- 1 1 Start ------ --- 4 [ soiltem_2 ] RW-- 1 1 ----- Member --- 5 [ soiltem_3 ] RW-- 1 1 ----- Member --- 6 [ soiltem_4 ] RW-- 1 1 ----- ------ End 7 [ wind_dir ] RW-- 1 1 ----- ------ --- 8 [ _________ ] RW-- 1 1 ----- ------ --- 9 [ solar ] RW-- 2 2 Start ------ --- 10 [ rain ] RW-- 2 1 ----- ------ --- 11 [ _15minppt ] RW-- 2 1 ----- ------ --- 12 [ intens ] RW-- 2 2 ----- ------ --- 13 [ batt ] -W-- 0 1 ----- ------ --- 14 [ _________ ] ---- 0 0 ----- ------ --- 15 [ _________ ] ---- 0 0 ----- ------ --- 16 [ blank99 ] RW-- 3 1 ----- ------ --- 17 [ _________ ] ---- 0 0 ----- ------ --- 18 [ _________ ] ---- 0 0 ----- ------ --- 19 [ _________ ] ---- 0 0 ----- ------ --- 20 [ _________ ] ---- 0 0 ----- ------ --- 21 [ _________ ] ---- 0 0 ----- ------ --- 22 [ _________ ] ---- 0 0 ----- ------ --- 23 [ _________ ] ---- 0 0 ----- ------ --- 24 [ _________ ] ---- 0 0 ----- ------ --- 25 [ _________ ] ---- 0 0 ----- ------ --- 26 [ _0_47 ] RW-- 1 1 ----- ------ --- 27 [ _0_37____ ] RW-- 1 1 ----- ------ --- 28 [ zero ] -W-- 0 1 ----- ------ --- 29 [ battery ] ---- 0 0 ----- ------ --- 30 [ AT_C ] RW-- 1 1 ----- ------ --- 31 [ hrly_rain ] RW-- 2 2 ----- ------ ---