Hi I am trying to create a table that illustrates Relative Humidity, and Temperature among other things using the HMP45C probe on a CR3000.
I have used a mixture of the sensor information booklet (which only has CR1000 info in it) and a program that was written for the sensor itself (not by me). Firstly the booklet and the program differ in that the booklet uses VoltSE and the program uses Voltdiff.
I would like to show the RH and Temperature in a table. I have included all the information of the program and highlighted where the error is occurring.
‘5H HMP45C temperature signal (yellow)
'5L HMP45C signal reference (white)
'gnd HMP45C shield (clear)
'6H HMP45C relative humidity signal (blue)
'6L short jumper wire to 5L
'POWER OUT
'G HMP45C power reference (black)
The program I am writing is as follows:
PipeLineMode
'Variables for viewing on the data logger. Using Dim for variables I dont
'want to see on the data logger.
Public Pr_tempy
Public Pressure
Public Panel_Temp
Public Battery_Volt
Units Pressure=mbar
Units Panel_Temp= C
Units Battery_Volt=V
'No delay meteorological variables.
'HMP45C temperature and relative humidity.
Public hmp(2)
Alias hmp (1)= t_hmp
Alias hmp (2)= rh_hmp
Public e_sat_hmp 'HMP45C vapor pressure.
Dim RH_Frac, e_kPa
Units t_hmp = C
Units rh_hmp = percent
Units e_sat_hmp = kPa
DataTable (MyTable, True, -1)
DataInterval (0,2,Min,0)
CardOut (0,-1000)
Sample (1,pressure,IEEE4)
Sample (1,Panel_Temp,IEEE4)
Sample (1,Battery_Volt, IEEE4)
Sample (1,t_hmp, IEEE4)
Sample (1,rh_hmp, IEEE4)
Sample (1,RH_Frac, IEEE4)
Sample (1,e_sat_hmp, IEEE4)
Sample (1,e_kPa, IEEE4)
EndTable
BeginProg
Scan(1,sec,3,0)
PanelTemp (Panel_Temp,250)
Battery (Battery_Volt)
Delay (0,150,msec)
VoltDiff (t_hmp,2,mV1000,5,TRUE,200,250,0.1,0) ‘sensor wire yellow 5H
***VoltDiff (rh_hmp,2,mV1000,6,TRUE,200,250,0.1,0)'sensor wire blue blue 6H
***tells me that it is out of bounds. I would like to have a RH measurement reading.Can someone tell me what is going wrong here?
If rh_hmp >100 AND rh_hmp<108 Then rh_hmp = 100
RH_Frac = rh_hmp*0.01
SatVP(e_sat_hmp,t_hmp)
e_kPa=e_sat_hmp*RH_Frac
'CS100 Barometric Pressure Sensor measurement BP_mmHg:
VoltSe(Pr_tempy,1,mV5000,1,1,0,250,0.2,600.0)
If IfTime(1,2,min) Then WriteIO (&B10,&B10)
If (IfTime(0,2,min)) Then
pressure=Pr_tempy
WriteIO (&b10,&b0)
EndIf
CallTable MyTable
NextScan
EndProg
For the VoltDiff instructions, you have the Reps parameter set at 2 but the variable to hold only 1. Change the reps to 1 and the program will compile.
Regards,
Dana
thank you Dana