Appendix b. example program, In appendix b, Appendix b – Campbell Scientific 034B-L Met One Windset User Manual
Page 25
Appendix B. Example Program
The following CR1000 program measures the 034B every 5 seconds, and store
mean wind speed, unit vector mean direction, and standard deviation of the
direction every 60 minutes. Wiring for the examples is given in TABLE B-1.
TABLE B-1. Wiring for Example Program
Color
Description
CR1000
Red
Wind Spd. Signal
P1
Black
Wind Spd. Reference
Green
Wind Dir. Signal
SE 1
Blue
Wind Dir. Excitation
EX 1
White
Wind Dir. Reference
Clear
Wind Dir. Shield
'CR1000
'Declare Variables and Units
Public Batt_Volt
Public WS_ms
Public WindDir
Units Batt_Volt=Volts
Units WS_ms=meters/second
Units WindDir=degrees
'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,60,Min,10)
WindVector (1,WS_ms,WindDir,FP2,False,0,0,0)
FieldNames("WS_ms_Avg,WindDir_Avg,WindDir_StDev")
EndTable
'Main Program
BeginProg
Scan(5,Sec,1,0)
'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery(Batt_Volt)
'034A/034B Wind Speed & Direction Sensor measurements WS_ms and WindDir:
PulseCount(WS_ms,1,1,2,1,0.7989,0.28)
If WS_ms=0.2811 Then WS_ms=0
BrHalf(WindDir,1,mV2500,1,1,1,2500,True,0,_60Hz,720.0,0) 'Use 5000 mV
If WindDir>=360 OR WindDir < 0 Then WindDir=0
'excitation for
'Call Data Tables and Store Data
'the CR3000 and
CallTable(Table1)
'CR5000 dataloggers
NextScan
EndProg
B-1