2 cr10x program example – Campbell Scientific SDM-AO4A Four Channel Analog Output Module User Manual
Page 15

SDM-AO4A Four Channel Analog Output
'Code for DataTable OneMin
DataTable(OneMin,1,-1)
DataInterval(0,1,Min,0)
WindVector (1, WS_ms,WD_0_360, IEEE4, 0, 0, 0, 0)
Average(1,Temp_C,IEEE4,0)
Sample(1,RH,
IEEE4
EndTable
BeginProg
Scan(1,Sec,1,0)
'
Code for 03001 wind measurements, WS_ms & WD_0_360:
PulseCount(WS_ms, 1, 1, 1, 1, 0.75, 0.2)
BrHalf(WD_0_360, 1, mV1000, 1, 1, 1, 1000, True, 1000, 250, 355, 0)
'
Code for CS500 measurement, AirTC and RH:
VoltSE(Temp_C,1,mV5000,3,0,
0,
_60Hz,0.1,-40.0)
VoltSE(RH,1,mV5000,2,0, 0, _60Hz,0.1, 0)
'
Call Data Table
CallTable(OneMin)
'
Convert 0-360 WD to 0-540:
If WD_0_540 >= 270 and WD_0_360 <180 Then
WD_0_540 = WD_0_360 + 360
Else
WD_0_540
=
WD_0_360
EndIf
'
Scale the measurements for the SDM-AO4A to output 0-1000 mV
WSOut
=
WS_ms*20
'WS: 0-50 m/s = 0-1000 mV
WDOut = WD_0_540 *1.859 'WD: 0-540 deg = 0-1000mV
TempOut=
10*(Temp_C+40)
'Temp: -40-60 deg C = 0-1000 mV
RHOut
=
RH
*10
'RH: 0-100 % RH = 0-1000 mV
'
Send mV outputs to SDM-AO4A at SDM Address 12 (Rotary Switch at C)
SDMAO4A
(AO4AOutput(),AO4AResponse,12,1,4,1)
NextScan
EndProg
7.3.2 CR10X Program Example
Although this program is for a CR10X, programming for other Edlog
dataloggers is similar.
;{CR10X}
*Table 1 Program
01: 1.0000 Execution
Interval
(seconds)
; Code for 03001 wind measurements, WS_ms & WindDir:
1: Pulse (P3)
1: 1
Reps
2: 1
Pulse
Channel
1
3: 21
Low Level AC, Output Hz
4: 1
Loc [ WS_ms ]
5: 0.75
Mult
6: 0.2
Offset
11