beautypg.com

Appendix b. example programs, B.1 single-ended voltage measurement examples, B.1.1 crbasic single-ended measurement program – Campbell Scientific HMP155A Temperature and Relative Humidity Probe User Manual

Page 29: B.1.1

background image

Appendix B. Example Programs

B.1 Single-Ended Voltage Measurement Examples

These examples use the single-ended voltage instruction to measure the sensor

and use the datalogger’s SW12V terminal to power the sensor only when it is

being measured. TABLE B-1 shows the wiring used for these examples.

TABLE B-1. Wiring for Single-ended

Measurement Examples

Color

Description

CR1000

CR10(X)

Yellow

Temperature

SE 2 (1L) SE 3 (2H)

Blue

Relative Humidity SE 1 (1H) SE 4 (2L)

White

Signal Reference

AG

Jumper from

SW12V Control

C1

Red

Power

SW12V

SW12 V

Black

Power Ground

AG

Clear

Shield

G

B.1.1 CRBasic Single-Ended Measurement Program

Below is an example CR1000 program. Other CRBasic dataloggers are

programmed similarly.

'CR1000 program to measure HMP155A with single-ended 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)
VoltSE(AirTC,1,mV2500,2,0,0,_60Hz,.14,-80)
VoltSE(RH,1,mV2500,1,0,0,_60Hz,0.1,0)
PortSet (9,0)
If RH>100 And RH<108 Then RH=100
CallTable(Temp_RH)
NextScan
EndProg

B-1