B-1
Appendix B. Example Programs
B.1 Pulse Channels Examples
B.1.1 CR1000 Pulse Channel Example
CRBasic Example B-1. CR1000 Pulse Channel Example
'CR1000
'CR1000 Program for TB4
'Declare Variables and Units
Public
Rain_mm
Units
Rain_mm=mm
'Define Data Tables
DataTable
(TB4_mm,True,-1)
DataInterval
(0,60,Min,0)
Totalize
(1,Rain_mm,IEEE4,0)
EndTable
'Main Program
BeginProg
Scan
(1,Sec,1,0)
'TB4 Rain Gage measurement Rain_mm:
PulseCount
(Rain_mm,1,1,2,0,0.254,0)
'Call Data Tables and Store Data
CallTable
(TB4_mm)
NextScan
EndProg
B.1.2 CR200(X) Series Pulse Channel Example
CRBasic Example B-2. CR200(X) Series Pulse Channel Example
'CR200 Series
'TB4 program
'Declare Variables and Units
Public
Rain_mm
Units
Rain_mm=mm
'Define Data Tables
DataTable
(TB4_mm,True,-1)
DataInterval
(0,60,Min)
Totalize
(1,Rain_mm,0)
EndTable
'Main Program
BeginProg
Scan
(10,Sec)
'TB4 Rain Gage measurement Rain_mm:
PulseCount
(Rain_mm,P_SW,2,0,0.254,0)
'Call Data Tables and Store Data
CallTable
(TB4_mm)
NextScan
EndProg