;{CR10X}
;
; Program by: Dr. Marc van Iersel
; Department of Horticulture
; The University of Georgia
; 1111 Miller Plant Science Building
; Athens, GA 30602-7273
; USA
;
; Tel: +1-706-583-0284
; Fax: +1-706-542-0624
; www.hortphys.uga.edu
;
; FEEDBACK HIGHLY APPRECIATED!
;
;
; This program controls irrigation in 16 separate containers
; using a Campbell Scientific SDM16ACDC relay driver and AM25T multiplexer
;
; Control ports 1, 2 , 3 connected to C1 C2 C3 of SDM16ACDC relay driver
; Control port 6 and 7 connected to RES and CLK of multiplexer
; Excitation channel 2 connected to the excitation channel on the multiplexer
; which is needed for measuring the internal temperature of the multiplexer.
; This will be used as the reference temperature for thermocouple measurements.
; 16 solenoid valves are connected to a SDM relay driver and supplied with 110 V AC from a regular outlet.
; The AM25T multiplexer and SDM16ACDC relay driver get 12V power from the CR10X datalogger
; ECH2O-10 probes are connected to multiplexer channels 1 to 8 in a single-ended fashion (total of 16 ECH2O probes)
; All excitation wires of the ECH2O probes are connect together and then connected to
; excitation channel 1 on the datalogger
;********************************************************************
; THIS PROGRAM IS WRITTEN SPECIFICALLY FOR DECAGON's ECH2O-10 PROBES.
;********************************************************************
;**************************************************
; DO NOT USE THIS PROGRAM WITH OTHER MODEL PROBES!
;**************************************************
; NOTE: probe calibration may depend on your specific wiring configuration
; I recommend that you calibrate your own probes in your specific substrate,
; using your particular wiring configuration
; 16 type-T thermocouples are connected to AM25T multiplexer channel 9-24 (differential)
; The multiplexer is connected to the CR10X SE1 and 2 channels
;
; Program controls irrigation once every 20 minutes
; Volumetric water content (vwc) from 16 probes is averaged and sampled once every 120 minutes
; Maximum and minimum VWC and number of irrigations per day for each treatment are determined daily,
; along with the time at which the minimum and maximum occured in each container.
; Table 1 will be executed every 20 minutes. This part of the program measures VWC and determines which plots
; need to be irrigated.
*Table 1 Program
01: 1200 Execution Interval (seconds)
; The first 16 statements set the irrigation threshold for the 16 individual containers
; Changing these values will allow for individual irrigation control in 16 treatments
; In this example program all set points are set to 0.25 m3/m3
1: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 1 Z Loc [ SetPoint1 ]
2: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 2 Z Loc [ SetPoint2 ]
3: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 3 Z Loc [ Setpoint3 ]
4: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 4 Z Loc [ SetPoint4 ]
5: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 5 Z Loc [ SetPoint5 ]
6: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 6 Z Loc [ SetPoint6 ]
7: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 7 Z Loc [ SetPoint7 ]
8: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 8 Z Loc [ SetPoint8 ]
9: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 9 Z Loc [ SetPoint9 ]
10: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 10 Z Loc [ SetPoin10 ]
11: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 11 Z Loc [ SetPoin11 ]
12: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 12 Z Loc [ SetPoin12 ]
13: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 13 Z Loc [ SetPoin13 ]
14: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 14 Z Loc [ SetPoin14 ]
15: Z=F x 10^n (P30)
1: 0.25 F
2: 00 n, Exponent of 10
3: 15 Z Loc [ SetPoin15 ]
16: Z=F x 10^n (P30)
1: .25 F
2: 00 n, Exponent of 10
3: 16 Z Loc [ SetPoin16 ]
;Set the datalogger control ports for use with multiplexer and relay driver (MvI)
17: Set Port(s) (P20)
1: 7337 C8..C5 = output/1ms/1ms/output
2: 7777 C4..C1 = output/output/output/output
; turn on AM 25T (see multiplexer manual for more detailed programming instructions)
18: Do (P86)
1: 46 Set Port 6 High
; Calculate reference temperature. The following 3 instructions measure the temperature of the multiplexer
; The instructions come straight from the AM25T manual.
; We need to know the reference temperature for the thermocouple measurements later in the program
;
; Note that the proper excitation voltage in this instruction depends on the serial number of the AM25T,
; as well as the measurement range specified under parameter 2. Check your user's manual to see how to
; use this instruction!!!!!!
19: Full Bridge (P6)
1: 1 Reps
2: 23 25 mV 60 Hz Rejection Range
3: 1 DIFF Channel
4: 2 Excite all reps w/Exchan 2
5: 250 mV Excitation
6: 17 Loc [ RefTemp_C ]
7: -.001 Mult
8: .09707 Offset
20: BR Transform Rf[X/(1-X)] (P59)
1: 1 Reps
2: 17 Loc [ RefTemp_C ]
3: 10.025 Multiplier (Rf)
21: Temperature RTD (P16)
1: 1 Reps
2: 17 R/R0 Loc [ RefTemp_C ]
3: 17 Loc [ RefTemp_C ]
4: 1.0 Mult
5: 0.0 Offset
; Measure voltage output from 16 probes and store voltage output
; In each loop, we measure two probes, so 8 loops measure 16 probes
22: Beginning of Loop (P87)
1: 0 Delay
2: 8 Loop Count
23: Do (P86)
1: 77 Pulse Port 7
24: Do (P86)
1: 77 Pulse Port 7
; The step loop index statement increases the storage location by 2, each time the loop
; is executed. This is necessary, because we measure two probes in each loop.
25: Step Loop Index (P90)
1: 2 Step
; This instruction measures two ECH2O probes, and stores the output in location 1 - 16
; The 0.001 multiplier converts the units from milliVolts to Volts
26: Excite-Delay (SE) (P4)
1: 2 Reps
2: 5 2500 mV Slow Range
3: 1 SE Channel
4: 1 Excite all reps w/Exchan 1
5: 1 Delay (0.01 sec units)
6: 2500 mV Excitation
7: 18 -- Loc [ V_1 ]
8: 0.001 Mult
9: 0.0 Offset
27: End (P95)
; Measure growing medium temperature from 16 containers
; Temperature is measured with type T thermocouples.
; NOTE: These thermocouples will corrode if not protected.
; We cover the thermocouples with petroleum jelly,
; and then cover them with heat-shrink tubing.
; The use of thermistors would eliminate this problem.
28: Beginning of Loop (P87)
1: 0 Delay
2: 16 Loop Count
29: Do (P86)
1: 77 Pulse Port 7
30: Do (P86)
1: 77 Pulse Port 7
; The reference temperature in this statement is what was measued at the start of the program
; Thermocouple temperatures are done with a differential measurement, temperatures are stored in location 34-49
31: Thermocouple Temp (DIFF) (P14)
1: 1 Reps
2: 21 2.5 mV 60 Hz Rejection Range
3: 1 DIFF Channel
4: 1 Type T (Copper-Constantan)
5: 17 Ref Temp (Deg. C) Loc [ RefTemp_C ]
6: 34 -- Loc [ Tsoil1 ]
7: 1.0 Mult
8: 0.0 Offset
; Correcting for erroneous Tsoil measurements
; There is a risk that the thermocouples in the substrate may corrode and quit working
; This statement sets measurements that are bad (more than 50 C or less than 0 C) to 23.2 C
; 23.2 C is the temperature at which the probes were calibrated.
;Check if temperature > 50 C
32: If (X<=>F) (P89)
1: 34 -- X Loc [ Tsoil1 ]
2: 3 >=
3: 50 F
4: 30 Then Do
33: Z=F x 10^n (P30)
1: 23.2 F
2: 00 n, Exponent of 10
3: 34 -- Z Loc [ Tsoil1 ]
34: End (P95)
;Check if temperature < 0 C
35: If (X<=>F) (P89)
1: 34 -- X Loc [ Tsoil1 ]
2: 4 <
3: 0 F
4: 30 Then Do
36: Z=F x 10^n (P30)
1: 23.2 F
2: 00 n, Exponent of 10
3: 34 -- Z Loc [ Tsoil1 ]
37: End (P95)
; For each degree C, the probe output increases by 1.88 mV.
; We need to correct the voltage output from the probes
; to correct for the actual temperature of the substrate.
; The base temperature for the calibrations was 23.2,
; so we need to calculate the difference between the
; substrate temperature and 23.2 C
38: Z=X+F (P34)
1: 34 -- X Loc [ Tsoil1 ]
2: -23.2 F
3: 50 -- Z Loc [ Tdiff1 ]
; So, Tdiff1 - Tdiff16 will contain the the substrate temperature - 23.2 C
39: Z=X*F (P37)
1: 50 -- X Loc [ Tdiff1 ]
2: 1.88 F
3: 66 -- Z Loc [ CF1 ]
; Now CF1 - CF16 is the voltage (in milliVolts) that needs to be subtracted from the measured probe voltage
; Since the probe output is in volts, we need to divide the CF values by 1000 to convert them to volts.
40: Z=X*F (P37)
1: 66 -- X Loc [ CF1 ]
2: 0.001 F
3: 66 -- Z Loc [ CF1 ]
; Subtract this correction factor from the measured voltage
41: Z=X-Y (P35)
1: 18 -- X Loc [ V_1 ]
2: 66 Y Loc [ CF1 ]
3: 82 -- Z Loc [ CorrV1 ]
; So now CorrV1-16 contain the temperature-corrected voltage measurements
42: End (P95)
; turn-off AM 25T
43: Do (P86)
1: 56 Set Port 6 Low
; Now that we have the temperature-corrected voltage, we can plug the values into the calibration equation.
; this equation is based on Krishna Nemali's calibration of the ECH2O probes for Fafard 2P and 4P substrate
; The r2 for this equation was 0.96 (see his dissertation for details)
; This equation does not work for substrates with a low EC!!!!!!!!!!
44: Polynomial (P55)
1: 16 Reps
2: 82 -- X Loc [ CorrV1 ]
3: 98 -- F(X) Loc [ VWC1 ]
4: -0.01833 C0
5: -0.23356 C1
6: 1.3421 C2
7: 0.0 C3
8: 0.0 C4
9: 0.0 C5
; Irrigation control statements for containers 1 to 16
; Determine cumulative irrigation for each container
; This is the control section of the program
; This loop compares the VWC to the irrigation setpoint and decide whether irrigation needs to be turned on.
45: Beginning of Loop (P87)
1: 0000 Delay
2: 16 Loop Count
46: If (X<=>Y) (P88)
1: 98 -- X Loc [ VWC1 ]
2: 4 <
3: 1 -- Y Loc [ SetPoint1 ]
4: 30 Then Do
; When the volumetric water content (VWC) is less than the set point, location 114 is set to 1.
; A value of 1 indicates that this container needs to be irrigated.
; Location 114 - 129 will be used later to open and close the irrigation valves.
47: Z=F x 10^n (P30)
1: 1 F
2: 00 n, Exponent of 10
3: 114 -- Z Loc [ irr1 ]
; If we program a solenoid valve to open, we also increase this counter by 1.
; This way this counter keeps track of how often we water each treatment.
; If you know how much water is applied in each irrigation, you can use this
; to calculate the total amount of water applied to each container.
48: Z=Z+1 (P32)
1: 130 -- Z Loc [ CumIrr1 ]
; If VWC is higher than the set point, location 114 is set to 0.
; A value of 0 indicates that a container does not need to be irrigated.
49: Else (P94)
50: Z=F x 10^n (P30)
1: 0.0 F
2: 00 n, Exponent of 10
3: 114 -- Z Loc [ irr1 ]
51: End (P95)
52: End (P95)
; Output section of the program
; Average and data sampling
; Output is collected every 2 hours
53: If time is (P92)
1: 0 Minutes (Seconds --) into a
2: 120 Interval (same units as above)
3: 10 Set Output Flag High (Flag 0)
54: Real Time (P77)^28492
1: 0110 Day,Hour/Minute (midnight = 0000)
55: Average (P71)^24343
1: 16 Reps
2: 98 Loc [ VWC1 ]
56: Average (P71)^9790
1: 16 Reps
2: 34 Loc [ Tsoil1 ]
; This output is collected daily
57: If time is (P92)
1: 0 Minutes (Seconds --) into a
2: 1440 Interval (same units as above)
3: 10 Set Output Flag High (Flag 0)
58: Real Time (P77)^27779
1: 0110 Day,Hour/Minute (midnight = 0000)
; This will determine the irrigation frequency
59: Sample (P70)^26641
1: 16 Reps
2: 130 Loc [ CumIrr1 ]
; This will determine the daily maximum VWC
60: Maximum (P73)^27949
1: 16 Reps
2: 10 Value with Hr-Min
3: 98 Loc [ VWC1 ]
; This will determine the daily minimum
61: Minimum (P74)^30394
1: 16 Reps
2: 10 Value with Hr-Min
3: 98 Loc [ VWC1 ]
; At his point, we have measured the water content in each container,
; and determined which containers need to be irrigated.
; In the Table 2 program, we will actually open the solenoid valves and
; irrigate the containers that need it.
; The execution interval of table 2 determines how long the plants will
; be irrigated at each irrigation (in this case, 10 s).
; Table 2 is basically another program that runs in the datalogger
; at the same time as program 1 (although at different intervals).
*Table 2 Program
02: 10 Execution Interval (seconds)
; Previously, we set location 114-129 to 1 if the VWC was below the
; set point or 0 if the VWC was above the set point.
; Now this info is sent to the SDM16ACDC relay driver.
; It will close the switch for a particular valve if the value
; in a particular location is 1, open it if it is 0
; location 114 corresponds to container 1, 115 to container 2, etc.
1: SDM-CD16 / SDM-CD16AC (P104)
1: 1 Reps
2: 00 SDM Address
3: 114 Loc [ irr1 ]
; Now we set location 1114 - 129 to 0, so next time this program runs,
; the previous instruction will open all switches
; which will close all valves (a bit confusing, but a closed switch
; allows power to the solenoid valve, thus opening it and starting irrigation.
;
; Since Table 2 runs every 10 seconds, ech container will irrigate for 10 seconds
; when the VWC is below the set point.
2: Beginning of Loop (P87)
1: 0000 Delay
2: 16 Loop Count
3: Z=F x 10^n (P30)
1: 0.0 F
2: 00 n, Exponent of 10
3: 114 -- Z Loc [ irr1 ]
4: End (P95)
*Table 3 Subroutines
End Program
-Input Locations-
1 SetPoint1 1 1 1
2 SetPoint2 1 0 1
3 Setpoint3 1 0 1
4 SetPoint4 1 0 1
5 SetPoint5 1 0 1
6 SetPoint6 1 0 1
7 SetPoint7 1 0 1
8 SetPoint8 1 0 1
9 SetPoint9 1 0 1
10 SetPoin10 1 0 1
11 SetPoin11 1 0 1
12 SetPoin12 1 0 1
13 SetPoin13 1 0 1
14 SetPoin14 1 0 1
15 SetPoin15 1 0 1
16 SetPoin16 1 0 1
17 RefTemp_C 1 3 3
18 V_1 5 1 1
19 V_2 17 0 1
20 V_3 1 0 0
21 V_4 1 0 0
22 V_5 1 0 0
23 V_6 1 0 0
24 V_7 1 0 0
25 V_8 1 0 0
26 V_9 0 0 0
27 V_10 0 0 0
28 V_11 0 0 0
29 V_12 0 0 0
30 V_13 0 0 0
31 V_14 0 0 0
32 V_15 0 0 0
33 V_16 0 0 0
34 Tsoil1 1 4 7
35 Tsoil2 1 1 0
36 Tsoil3 1 1 0
37 Tsoil4 1 1 0
38 Tsoil5 1 1 0
39 Tsoil6 1 1 0
40 Tsoil7 1 1 0
41 Tsoil8 1 1 0
42 Tsoil9 1 1 0
43 Tsoil10 1 1 0
44 Tsoil11 1 1 0
45 Tsoil12 1 1 0
46 Tsoil13 1 1 0
47 Tsoil14 1 1 0
48 Tsoil15 1 1 0
49 Tsoil16 1 1 0
50 Tdiff1 1 1 1
51 Tdiff2 1 0 0
52 Tdiff3 0 0 0
53 Tdiff4 0 0 0
54 Tdiff5 0 0 0
55 Tdiff6 0 0 0
56 Tdiff7 0 0 0
57 Tdiff8 0 0 0
58 Tdiff9 0 0 0
59 Tdiff10 0 0 0
60 Tdiff11 0 0 0
61 Tdiff12 0 0 0
62 Tdiff13 0 0 0
63 Tdiff14 0 0 0
64 Tdiff15 0 0 0
65 Tdiff16 0 0 0
66 CF1 1 2 2
67 CF2 0 0 0
68 CF3 0 0 0
69 CF4 0 0 0
70 CF5 0 0 0
71 CF6 0 0 0
72 CF7 0 0 0
73 CF8 0 0 0
74 CF9 0 0 0
75 CF10 0 0 0
76 CF11 0 0 0
77 CF12 0 0 0
78 CF13 0 0 0
79 CF14 0 0 0
80 CF15 0 0 0
81 CF16 0 0 0
82 CorrV1 1 1 1
83 CorrV2 1 1 0
84 CorrV3 1 1 0
85 CorrV4 1 1 0
86 CorrV5 1 1 0
87 CorrV6 1 1 0
88 CorrV7 1 1 0
89 CorrV8 1 1 0
90 CorrV9 1 1 0
91 CorrV10 1 1 0
92 CorrV11 1 1 0
93 CorrV12 1 1 0
94 CorrV13 1 1 0
95 CorrV14 1 1 0
96 CorrV15 1 1 0
97 CorrV16 1 1 0
98 VWC1 5 4 1
99 VWC2 9 3 1
100 VWC3 9 3 1
101 VWC4 9 3 1
102 VWC5 9 3 1
103 VWC6 9 3 1
104 VWC7 9 3 1
105 VWC8 9 3 1
106 VWC9 9 3 1
107 VWC10 9 3 1
108 VWC11 9 3 1
109 VWC12 9 3 1
110 VWC13 9 3 1
111 VWC14 9 3 1
112 VWC15 9 3 1
113 VWC16 17 3 1
114 irr1 1 1 3
115 irr2 1 1 0
116 irr3 1 1 0
117 irr4 1 1 0
118 irr5 1 1 0
119 rr6 1 1 0
120 irr7 1 1 0
121 irr8 1 1 0
122 irr9 1 1 0
123 irr10 1 1 0
124 irr11 1 1 0
125 irr12 1 1 0
126 irr13 1 1 0
127 irr14 1 1 0
128 irr15 1 1 0
129 irr16 1 1 0
130 CumIrr1 1 1 1
131 CumIrr2 1 1 0
132 CumIrr3 1 1 0
133 CumIrr4 1 1 0
134 CumIrr5 1 1 0
135 CumIrr6 1 1 0
136 CumIrr7 1 1 0
137 CumIrr8 1 1 0
138 CumIrr9 1 1 0
139 CumIrr10 1 1 0
140 CumIrr11 1 1 0
141 CumIrr12 1 1 0
142 CumIrr13 1 1 0
143 CumIrr14 1 1 0
144 CumIrr15 1 1 0
145 CumIrr16 1 1 0
-Program Security-
0000
0000
0000
-Mode 4-
-Final Storage Area 2-
0
-CR10X ID-
0
-CR10X Power Up-
3
-CR10X Compile Setting-
3
-CR10X RS-232 Setting-
-1
-Final Storage Labels-
0,Day_RTM,28492
0,Hour_Minute_RTM
1,VWC1_AVG,24343
1,VWC2_AVG
1,VWC3_AVG
1,VWC4_AVG
1,VWC5_AVG
1,VWC6_AVG
1,VWC7_AVG
1,VWC8_AVG
1,VWC9_AVG
1,VWC10_AVG
1,VWC11_AVG
1,VWC12_AVG
1,VWC13_AVG
1,VWC14_AVG
1,VWC15_AVG
1,VWC16_AVG
2,Tsoil1_AVG,9790
2,Tsoil2_AVG
2,Tsoil3_AVG
2,Tsoil4_AVG
2,Tsoil5_AVG
2,Tsoil6_AVG
2,Tsoil7_AVG
2,Tsoil8_AVG
2,Tsoil9_AVG
2,Tsoil10_AVG
2,Tsoil11_AVG
2,Tsoil12_AVG
2,Tsoil13_AVG
2,Tsoil14_AVG
2,Tsoil15_AVG
2,Tsoil16_AVG
3,Day_RTM,27779
3,Hour_Minute_RTM
4,irr2,26641
4,irr3
4,irr4
4,irr5
4,rr6
4,irr7
4,irr8
4,irr9
4,irr10
4,irr11
4,irr12
4,irr13
4,irr14
4,irr15
4,irr16
4,CumIrr1
5,VWC1_MAX,27949
5,VWC1_Hr_Min_MAX
5,VWC2_MAX
5,VWC2_Hr_Min_MAX
5,VWC3_MAX
5,VWC3_Hr_Min_MAX
5,VWC4_MAX
5,VWC4_Hr_Min_MAX
5,VWC5_MAX
5,VWC5_Hr_Min_MAX
5,VWC6_MAX
5,VWC6_Hr_Min_MAX
5,VWC7_MAX
5,VWC7_Hr_Min_MAX
5,VWC8_MAX
5,VWC8_Hr_Min_MAX
5,VWC9_MAX
5,VWC9_Hr_Min_MAX
5,VWC10_MAX
5,VWC10_Hr_Min_MAX
5,VWC11_MAX
5,VWC11_Hr_Min_MAX
5,VWC12_MAX
5,VWC12_Hr_Min_MAX
5,VWC13_MAX
5,VWC13_Hr_Min_MAX
5,VWC14_MAX
5,VWC14_Hr_Min_MAX
5,VWC15_MAX
5,VWC15_Hr_Min_MAX
5,VWC16_MAX
5,VWC16_Hr_Min_MAX
6,VWC1_MIN,30394
6,VWC1_Hr_Min_MIN
6,VWC2_MIN
6,VWC2_Hr_Min_MIN
6,VWC3_MIN
6,VWC3_Hr_Min_MIN
6,VWC4_MIN
6,VWC4_Hr_Min_MIN
6,VWC5_MIN
6,VWC5_Hr_Min_MIN
6,VWC6_MIN
6,VWC6_Hr_Min_MIN
6,VWC7_MIN
6,VWC7_Hr_Min_MIN
6,VWC8_MIN
6,VWC8_Hr_Min_MIN
6,VWC9_MIN
6,VWC9_Hr_Min_MIN
6,VWC10_MIN
6,VWC10_Hr_Min_MIN
6,VWC11_MIN
6,VWC11_Hr_Min_MIN
6,VWC12_MIN
6,VWC12_Hr_Min_MIN
6,VWC13_MIN
6,VWC13_Hr_Min_MIN
6,VWC14_MIN
6,VWC14_Hr_Min_MIN
6,VWC15_MIN
6,VWC15_Hr_Min_MIN
6,VWC16_MIN
6,VWC16_Hr_Min_MIN