beautypg.com

Campbell Scientific 0871LH1 Freezing Rain Sensor User Manual

Page 19

background image

16

ElseIf (LH1_Byte(5) AND &B011000000) = &B01000000 Then
LH1_ERR_PROBE_HEATER = "Always On"
ElseIf (LH1_Byte(5) AND &B011000000) = &B10000000 Then
LH1_ERR_PROBE_HEATER = "Always Off"
ElseIf (LH1_Byte(5) AND &B011000000) = &B11000000 Then
LH1_ERR_PROBE_HEATER = "On"
EndIf

If (LH1_Byte(5) AND &B001000000) <> 0 Then
LH1_ERR_DE_ICING = "FAIL"
Else
LH1_ERR_DE_ICING = "OK"
EndIf

'0871LH1 output ON time in 10 Minute Increments
LH1_ON_Time_Days = ((LH1_Byte(6) << 16) + (LH1_Byte(7) << 8) +LH1_Byte(8))/144
LH1_Cold_Start_Count = (LH1_Byte(9) << 8) +LH1_Byte(10)
LH1_ICE_Count = (LH1_Byte(11) << 8) +LH1_Byte(12)
LH1_FAIL_Count = LH1_Byte(13)
LH1_MSO_FAIL_Count = LH1_Byte(14)>>4
LH1_Heater_FAIL_Count = LH1_Byte(14) AND &B00001111
LH1_Software_Version = LH1_Byte(22)
LH1_ICE_Count_From_PWR_ON = LH1_Byte(23)

EndIf
EndSub

'Main Program
BeginProg

'Ensure that the proper Com port is defined for the Constant LH1_comport
SerialOpen (LH1_comport,9600,3,0,50)

Scan (15,Sec,0,0)
PanelTemp (PTemp,250)
Battery (batt_volt)
'Enter other measurement instructions

'Inteval Time for Reading the Ice Detector
If TimeIntoInterval(0,1,Min) Then Read_LH1 = True
Read_LH1 = True

If Read_LH1 = True Then
Call LH1_GetData
Read_LH1 = False
EndIf

'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'NOTE: The use of the Ice thickness calculation is discretionary and dependant on the
' application. The maximum allowable ice is 0.02" before the heater turns on.

'Formula used to convert the Frequency into Ice Thickness (inches).
Ice = -0.00015*LH1_MSO_Frequency + 6
'Convert ice accumulation from inches to millimeters
Ice_mm = Ice * 25.4
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CallTable LH1_output
NextScan
EndProg