B-1
Appendix B. Example Program
The following CR1000 program measures the sensor and includes an offset
correction for the vane being installed at 270 degrees.
CRBasic Example B-1. CR1000 Example Program
'CR1000
'Declare Variables and Units
Public
BattV
Public
PTemp_C
Public
WindDir
Units
BattV=Volts
Units
PTemp_C=Deg C
Units
WindDir=degrees
'Define Data Tables
DataTable
(Table1,True,-1)
DataInterval
(0,10,Min,10)
Sample
(1,WindDir,FP2)
EndTable
DataTable
(Table2,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
EndTable
'Main Program
BeginProg
'Main Scan
Scan
(1,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery
(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,_60Hz)
'020C Wind Direction Sensor measurement 'WindDir'
VoltSe
(WindDir,1,mV5000,1,1,0,_60Hz,0.072,0)
'Offset correction for vane installed with 270 degree
'installation orientation
WindDir = (W 90 + 360)
MOD
360
'Call Data Tables and Store Data
CallTable
(Table1)
CallTable
(Table2)
NextScan
Summary of Contents for 020C
Page 2: ......
Page 6: ......
Page 20: ...020C Wind Direction Sensor 12 ...
Page 22: ......
Page 24: ......
Page 28: ...Appendix C Wind Direction Sensor Orientation C 4 ...
Page 29: ......