B-1
Appendix B. Example Programs
These example programs measure the 03002 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
TABLE B-1. Wiring for Example Programs
Color
Wire Label
CR1000X
CR6
CR200X
Red
WS Signal
P1
U4
P_LL
Black
WS Reference
⏚
⏚
⏚
Clear
Shield
⏚
⏚
⏚
Green
WD Signal
SE 1
U2
SE 1
Blue
WD Volt Excit
VX 1
U1
VX1
White
WD Reference
⏚
⏚
⏚
CRBasic Example B-1. CR1000X Program Measuring the 03002
'CR1000X
'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
(Hour,True,-1)
DataInterval
(0,60,Min,10)
WindVector
(1,WS_ms,WindDir,FP2,False,0,0,0)
FieldNames
("WS_ms_S_WVT,WindDir_D1_WVT,WindDir_SD1_WVT")
EndTable
'Main Program
BeginProg
Scan
(5,Sec,1,0)
'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery
(Batt_Volt)
'03002 or 03101 RM Young Wind Sentry Wind Speed Sensor measurement
'WS_ms:
PulseCount
(WS_ms,1,P1,5,1,0.75,0.2)
If
WS_ms<0.21
Then
WS_ms=0
'03002 or 03301 RM Young Wind Sentry Wind Direction Sensor
'measurement - WindDir:
BrHalf
(WindDir,1,mV1000,1,Vx1,1,1000,True,20000,_60Hz,352,0)
'Use mV5000 range and 5000 mV excitation for CR3000 and CR5000
'dataloggers.
If
WindDir>=360
OR
WindDir<0
Then
WindDir=0
'Call Data Tables and Store Data
CallTable
(Hour)
NextScan
EndProg
Содержание 03002
Страница 2: ......
Страница 3: ......
Страница 7: ......
Страница 27: ......
Страница 31: ...Appendix B Example Programs B 4 ...
Страница 35: ...Appendix C Wind Direction Sensor Orientation C 4 ...
Страница 37: ......
Страница 38: ......