B.2 CR6 example program
CRBasic Example 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 Data Logger 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
Wind Monitor Series
20