Appendix B. Example Programs
B-2
B.2 CR6 Example Program
CRBasic Example B-2. CR6 Example Program
'CR6 Series
'Declare Variables and Units
Public
BattV
Public
PTemp_C
Public
WS_ms
Public
WindDir
Units
BattV=Volts
Units
PTemp_C=Deg C
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
'Main Scan
Scan
(5,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery
(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,60)
'05103 Wind Speed & Direction Sensor measurements 'WS_ms' and 'WindDir'
'WS_ms
PulseCount
(WS_ms,1,U4,5,1,0.098,0)
'WindDir
BrHalf
(WindDir,1,mV5000,U2,U1,1,2500,True,20000,60,355,0)
If
WindDir>=360 OR WindDir<0
Then
WindDir=0
'Call Data Tables and Store Data
CallTable
Hour
NextScan
EndProg
Summary of Contents for Wind Monitor Series
Page 2: ......
Page 6: ......
Page 24: ...Wind Monitor Series 16...
Page 26: ...Appendix A Importing Short Cut Code Into CRBasic Editor A 2...
Page 30: ...Appendix B Example Programs B 4...
Page 34: ...Appendix C Wind Direction Sensor Orientation C 4...
Page 36: ...Appendix D Wind Direction Measurement Theory D 2...
Page 37: ......