Appendix B. Example programs
The following examples are for the CR6 data logger. Other data loggers are programmed
similarly.
CRBasic Example 1: CR6 program measuring the EE181
'Program measures EE181 with single-ended inputs once every 5 seconds
'and stores the average temperature and a sample of the relative
'humidity every 60 minutes.
'Wiring Diagram
'==============
'EE181
'Wire CR6
'Color: Function - Terminal
'------ -------- --------
'Red: Power - SW12-1
'Yellow: Temperature signal - U1
'Blue: Relative Humidity signal - U2
'Black: Power Ground - Ground Symbo
l
'Clear: Shield - Ground Symbol
Public
AirTC :
Units
AirTC = °C
Public
RH :
Units
RH = %
DataTable
(Temp_RH,True,-1)
DataInterval
(0,60,Min,0)
Average
(1,AirTC,FP2,0)
Sample
(1,RH,FP2)
EndTable
BeginProg
Scan
(5,Sec,1,0)
SW12
(1,1 )
'Turn on switched 12V
Delay(0,2,Sec)
'2-second delay
'EE181 Temperature & Relative Humidity Sensor measurements AirTC and RH:
VoltSe
(AirTC,1,mV1000,U1,0,0,60,0.1,-40)
VoltSe
(RH,1,mV1000,U2,0,0,60,0.1,0)
SW12
(1,0 )
'Turn off switched 12V
CallTable
(Temp_RH)
NextScan
EndProg
EE181 Temperature and Relative Humidity Probe
18