-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaxtersHighAWCBlock.CR6
215 lines (210 loc) · 9.19 KB
/
BaxtersHighAWCBlock.CR6
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
'CR6 Series
'Created by Short Cut (4.0)
'Declare Variables and Units
Dim TT_K(8)
Dim SBT_K(8)
Dim m(8)
Dim b(8)
Public BattV
Public PTemp_C
Public TT_C(8)
Public SBT_C(8)
Public TTmV(8)
Public TRHData(2)
Public Wind_ms
Alias TRHData(1)=AirTC
Alias TRHData(2)=RH
' Irr sensor 7113 7114 7115 7116 3380 3379 3390 3385
Dim MC2(8) = {129209, 104494, 105486, 95081.5, 75992, 77904.1, 77553.2, 70955 }
Dim MC1(8) = {11213500, 8846310, 9206580, 8590890, 7277220, 6942310, 7449540, 7242140 }
Dim MC0(8) = {1790070000, 1476810000, 1498060000, 1427820000, 1395890000, 1321320000, 1410870000, 1386130000 }
Dim BC2(8) = {2119.9, 3190.87, 1773.52, 2134.6, 13555.7, 12783, 12858.8, 14149.3 }
Dim BC1(8) = {14830.3, 7040.97, 117773, -10789.6, -9950.63, 85649.1, 16325.6, -11589.2 }
Dim BC0(8) = {-8456880, -5831600, -5286120, -2696420, -2662950, -9474180, -4211160, -2918440 }
Units BattV=Volts
Units PTemp_C=Deg C
Units TT_C=Deg C
Units SBT_C=Deg C
Units TTmV=mV
Units AirTC=Deg C
Units RH=%
Units Wind_ms=m/s
'Define Data Tables
DataTable(AllData,True,-1)
DataInterval(0,5,min,10)
Average(1,BattV,FP2,False)
Average(1, PTemp_C,FP2,False)
Average(1, TT_C(1),FP2,False)
Average(1, SBT_C(1),FP2,False)
Average(1, TTmV(1),FP2,False)
Average(1, TT_C(2),FP2,False)
Average(1, SBT_C(2),FP2,False)
Average(1, TTmV(2),FP2,False)
Average(1, TT_C(3),FP2,False)
Average(1, SBT_C(3),FP2,False)
Average(1, TTmV(3),FP2,False)
Average(1, TT_C(4),FP2,False)
Average(1, SBT_C(4),FP2,False)
Average(1, TTmV(4),FP2,False)
Average(1, TT_C(5),FP2,False)
Average(1, SBT_C(5),FP2,False)
Average(1, TTmV(5),FP2,False)
Average(1, TT_C(6),FP2,False)
Average(1, SBT_C(6),FP2,False)
Average(1, TTmV(6),FP2,False)
Average(1, TT_C(7),FP2,False)
Average(1, SBT_C(7),FP2,False)
Average(1, TTmV(7),FP2,False)
Average(1, TT_C(8),FP2,False)
Average(1, SBT_C(8),FP2,False)
Average(1, TTmV(8),FP2,False)
Average(1, AirTC,FP2,False)
Maximum(1, RH,FP2,False,False)
Average(1, Wind_ms,FP2,False)
EndTable
'Main Program
BeginProg
'Main Scan
Scan(5,min,1,0)
'Default CR6 Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default CR6 Datalogger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,60)
'CS215 Temperature & Relative Humidity Sensor measurements 'AirTC' and 'RH'
SDI12Recorder(TRHData(),C3,"0","M!",1,0,-1)
'Wind speed sensor
PulseCount(Wind_ms,1,U10,5,1,0.765,0.35)
If Wind_ms<0.36 Then Wind_ms = 0
'Turn AM16/32 Multiplexer On. PortSet(DataLogger com channel, State 1=on and can respond to clock pulses)
PortSet(C2,1)
Delay(0,150,mSec) 'Delay(Option, Delay, Units)
'Switch on the first AM416 Multiplexer channel. PulsePort(DataLogger channel C#, Delay)
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(1)' and 'SBT_C(1)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(1),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(1),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(1)=MC0(1)+(MC1(1)*SBT_C(1))+(MC2(1)*SBT_C(1)^2)
b(1)=BC0(1)+(BC1(1)*SBT_C(1))+(BC2(1)*SBT_C(1)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(1)=SBT_C(1)+273.15
TT_K(1)=SBT_K(1)^4+TTmV(1)*m(1)+b(1)
TT_K(1)=SQR(SQR(TT_K(1)))
'Convert target temperature into desired units
TT_C(1)=TT_K(1)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(2)' and 'SBT_C(2)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(2),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(2),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(2)=MC0(2)+(MC1(2)*SBT_C(2))+(MC2(2)*SBT_C(2)^2)
b(2)=BC0(2)+(BC1(2)*SBT_C(2))+(BC2(2)*SBT_C(2)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(2)=SBT_C(2)+273.15
TT_K(2)=SBT_K(2)^4+TTmV(2)*m(2)+b(2)
TT_K(2)=SQR(SQR(TT_K(2)))
'Convert target temperature into desired units
TT_C(2)=TT_K(2)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(3)' and 'SBT_C(3)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(3),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(3),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(3)=MC0(3)+(MC1(3)*SBT_C(3))+(MC2(3)*SBT_C(3)^2)
b(3)=BC0(3)+(BC1(3)*SBT_C(3))+(BC2(3)*SBT_C(3)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(3)=SBT_C(3)+273.15
TT_K(3)=SBT_K(3)^4+TTmV(3)*m(3)+b(3)
TT_K(3)=SQR(SQR(TT_K(3)))
'Convert target temperature into desired units
TT_C(3)=TT_K(3)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(4)' and 'SBT_C(4)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(4),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(4),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(4)=MC0(4)+(MC1(4)*SBT_C(4))+(MC2(4)*SBT_C(4)^2)
b(4)=BC0(4)+(BC1(4)*SBT_C(4))+(BC2(4)*SBT_C(4)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(4)=SBT_C(4)+273.15
TT_K(4)=SBT_K(4)^4+TTmV(4)*m(4)+b(4)
TT_K(4)=SQR(SQR(TT_K(4)))
'Convert target temperature into desired units
TT_C(4)=TT_K(4)-273.15
'Turn AM16/32 Multiplexer Off. PortSet(DataLogger channel C#, State 0=off and reset)
'Switch on the first AM416 Multiplexer channel. PulsePort(DataLogger channel C#, Delay)
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(5)' and 'SBT_C(5)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(5),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(5),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(5)=MC0(5)+(MC1(5)*SBT_C(5))+(MC2(5)*SBT_C(5)^2)
b(5)=BC0(5)+(BC1(5)*SBT_C(5))+(BC2(5)*SBT_C(5)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(5)=SBT_C(5)+273.15
TT_K(5)=SBT_K(5)^4+TTmV(5)*m(5)+b(5)
TT_K(5)=SQR(SQR(TT_K(5)))
'Convert target temperature into desired units
TT_C(5)=TT_K(5)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(6)' and 'SBT_C(6)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(6),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(6),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(6)=MC0(6)+(MC1(6)*SBT_C(6))+(MC2(6)*SBT_C(6)^2)
b(6)=BC0(6)+(BC1(6)*SBT_C(6))+(BC2(6)*SBT_C(6)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(6)=SBT_C(6)+273.15
TT_K(6)=SBT_K(6)^4+TTmV(6)*m(6)+b(6)
TT_K(6)=SQR(SQR(TT_K(6)))
'Convert target temperature into desired units
TT_C(6)=TT_K(6)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(7)' and 'SBT_C(7)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(7),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(7),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(7)=MC0(7)+(MC1(7)*SBT_C(7))+(MC2(7)*SBT_C(7)^2)
b(7)=BC0(7)+(BC1(7)*SBT_C(7))+(BC2(7)*SBT_C(7)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(7)=SBT_C(7)+273.15
TT_K(7)=SBT_K(7)^4+TTmV(7)*m(7)+b(7)
TT_K(7)=SQR(SQR(TT_K(7)))
'Convert target temperature into desired units
TT_C(7)=TT_K(7)-273.15
PulsePort(C1,10000)
'SI-111 Precision Infrared Radiometer measurements 'TT_C(8)' and 'SBT_C(8)'
'Measure SI-111 sensor body thermistor temperature
Therm109(SBT_C(8),1,U1,U2,0,60,1,0)
'Measure SI-111 output of thermopile
VoltDiff(TTmV(8),1,mV200,U3,True,0,60,1,0)
'Calculate slope (m) and offset (b) coefficients for target temperature calculation
m(8)=MC0(8)+(MC1(8)*SBT_C(8))+(MC2(8)*SBT_C(8)^2)
b(8)=BC0(8)+(BC1(8)*SBT_C(8))+(BC2(8)*SBT_C(8)^2)
'Calculate target temperature using calculated slope (m) and offset (b)
SBT_K(8)=SBT_C(8)+273.15
TT_K(8)=SBT_K(8)^4+TTmV(8)*m(8)+b(8)
TT_K(8)=SQR(SQR(TT_K(8)))
'Convert target temperature into desired units
TT_C(8)=TT_K(8)-273.15
'Turn AM16/32 Multiplexer Off. PortSet(DataLogger channel C#, State 0=off and reset)
PortSet(C2,0)
Delay(0,150,mSec) 'Delay(Option, Delay, Units)
'Call Data Tables and Store Data
CallTable AllData
NextScan
EndProg