3 cr10(x) pulse channel example – Campbell Scientific TB4 and TB4MM Hydrological Services Rain Gage User Manual
Page 11

TB4 and TB4MM Rain Gage
'Main Program
BeginProg
Scan(10,Sec)
'TB4 Rain Gauge measurement Rain_mm:
PulseCount(Rain_mm,P_SW,2,0,0.254,0)
'Call Data Tables and Store Data
CallTable(TB4_mm)
NextScan
EndProg
5.1.3 CR10(X) Pulse Channel Example
The following example program uses a pulse channel to read the output from
the rain gage and will work with CR500, CR510, CR10(X), 21X and CR23X;
the CR7 is similar, but has an additional parameter in the Pulse Count
instruction to specify the slot that the Pulse Card is in.
;{CR10X}
;
;CR10X Program for TB4
;Rain (mm)
;
*Table 1 Program
01: 1
Execution
Interval
(seconds)
1: Pulse (P3)
1: 1
Reps
2: 1
Pulse
Channel
1
3: 2
Switch Closure, All Counts
4: 1
Loc [ Rain_mm ]
5: .254
Multiplier
6: 0
Offset
2: If time is (P92)
1: 0
Minutes (Seconds --) into a
2: 60
Interval (same units as above)
3: 10
Set Output Flag High (Flag 0)
3: Set Active Storage Area (P80)
1: 1
Final Storage Area 1
2: 101
Array
ID
4: Real Time (P77)
1: 1220
Year,Day,Hour/Minute (midnight = 2400)
5: Totalize (P72)
1: 1
Reps
2: 1
Loc [ Rain_mm ]
*Table 2 Program
02: 0.0000 Execution
Interval
(seconds)
*Table 3 Subroutines
End Program
7