beautypg.com

Appendix b. example programs, B.1 pulse port examples, B.1.1 cr1000 example program – Campbell Scientific 014A Met One Wind Speed Sensor User Manual

Page 25: B.1.1, Appendix b

background image

Appendix B. Example Programs

B.1 Pulse Port Examples

The following CR1000 and CR10X programs use a pulse port to measure the

014A every 5 seconds. The programs store mean wind speed (in m s

–1

) every

60 minutes. Wiring for the examples is given in TABLE B-1.

TABLE B-1. Wiring for Pulse Port Example Programs

Color

Description

CR1000

CR10X

Black

Signal

P1

P1

White

Signal Reference

G

Clear

Shield

G

B.1.1 CR1000 Example Program

'CR1000

'Declare Variables and Units
Public Batt_Volt
Public WS_ms

Units Batt_Volt=Volts
Units WS_ms=meters/second

'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,60,Min,10)
Average(1,WS_ms,FP2,False)
EndTable

'Main Program
BeginProg
Scan(5,Sec,1,0)
'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery(Batt_Volt)
'014A Wind Speed Sensor measurement WS_ms:
PulseCount(WS_ms,1,1,2,1,0.8,0.447)
If WS_ms<0.448 Then WS_ms=0
'Call Data Tables and Store Data
CallTable(Table1)
NextScan
EndProg

B-1