
Appendix B. Example Programs
B.2 Differential Measurement Example
Below is an example CR1000 program that uses the differential voltage
instruction to measure the sensor and uses the datalogger’s SW12V terminal to
power the sensor only when it is being measured. The differential instruction
is recommended for long lead lengths. TABLE B-2 shows the wiring used for
these examples.
Other CRBasic dataloggers are programmed similarly.
Differential Measurement Examples
Color Description CR1000
Yellow Temperature 2H
Jumper to 1L 2L
Blue Relative Humidity 1H
White Signal Reference 1L
Red Power SW12 V
Black Power Ground G
Clear Shield
'CR1000 program to measure HMP155A with differential measurements
Public AirTC
Public RH
DataTable(Temp_RH,True,-1)
DataInterval(0,60,Min,0)
Average(1,AirTC,IEEE4,0)
Sample(1,RH,IEEE4)
EndTable
BeginProg
Scan(5,Sec,1,0)
'HMP155A Temperature & Relative Humidity Sensor measurements AirTC and RH:
PortSet (9,1)
Delay(0,2,Sec)
VoltDiff (AirTC,1,mV2500,2,True,0,_60Hz,.14,-80)
VoltDiff (RH,1,mV2500,1,True,0,_60Hz,0.1,0)
PortSet (9,0)
If RH>100 And RH<108 Then RH=100
CallTable(Temp_RH)
NextScan
EndProg
B-2
Commentaires sur ces manuels