
Appendix B. Example Programs
The following example programs use a pulse channel to read the output from
the rain gage. The CR1000 example will also work with the CR800, CR850,
CR3000, and CR5000. CR9000(X) programming is similar to the CR1000
except for having an additional parameter in the PulseCount() instruction to
specify the pulse module’s slot.
B.1 CR1000 Pulse Channel Example Program
'Program records precipitation from one TE525 or TE525WS Rain Gage once a
'second and stores the total every 60 minutes
'Wiring Diagram
'==============
'TE525 or TE525WS
' Wire
' Color Function CR1000
' ----- -------- ------
' Black Pulse Output P1
' White Ground AG*
' Clear Shield AG*
'*AG = Analog Ground (represented by ground symbol on CR1000 wiring panel
'Declare the variables and units for the rain measurement
Public Rain_mm
Units Rain_mm=mm
DataTable(Table1,True,-1)
DataInterval(0,60,Min,0)
Totalize(1,Rain_mm,FP2,0)
EndTable
BeginProg
Scan(1,Sec,1,0)
PulseCount(Rain_mm,1,1,2,0,0.254,0)
'For TE525MM Rain Gage, use multiplier of 0.1 in PulseCount instruction
‘Call Data Table
CallTable(Rain)
NextScan
EndProg
B-1
Commentaires sur ces manuels