![Campbell 61302V Скачать руководство пользователя страница 12](http://html1.mh-extra.com/html/campbell/61302v/61302v_instruction-manual_3773104012.webp)
61302V Barometric Pressure Sensor
'Green - CR1000 G
'Shield - CR1000 G
'Declare Public Variables
Public BP_Poll As String, CR As String
Public BP_raw As String
Public BP_string As String
Public Elevation_Correction
Public BP_61302V As Float 'Default units are hPa
'Declare Constants
Const Elevation = 0 'This value must be added in order to correct for elevation (meters).
'Define Data Tables
DataTable (Hourly,1,-1)
DataInterval (0,1,Hr,10)
Sample (1,BP_61302V,IEEE4)
EndTable
'Main Program
BeginProg
'*** 61302V Sensor Polling Variables ***
BP_Poll = "M0!"
CR = CHR(13)
'Configure ComPort 1 for use with the 61302V
SerialOpen (Com1,9600,0,0,1000)
Scan (5,Sec,0,0)
' Switch 61302V Sensor On 1 minute before the top of the hour
If TimeIntoInterval (59,60,Min) Then SW12 (1)
' Poll 61302V Sensor at the top of the hour
If TimeIntoInterval (0,60,Min) Then
SerialFlush (Com1) 'Clear buffer before polling for a new measurement
SerialOut (Com1,BP_Poll,"",0,100) 'Send sensor poll command
SerialIn (BP_raw,Com1,100,CR,100) 'Receive sensor response
SplitStr (BP_string,BP_raw,"",1,0) 'Parse out BP value
BP_61302V = BP_string 'Convert ASCII to numeric value
' Switch 61302V Sensor Off after polling
SW12 (0)
' Correct Barometric Pressure value for elevation above sea level (elevation must be in
meters)
Elevation_Correction = 1013.25 * (1 - (1 - Elevation/44307.69231)^5.253283)
BP_61302V = BP_ Elevation_Correction
EndIf
CallTable Hourly
NextScan
EndProg
10
Содержание 61302V
Страница 15: ...61302V Barometric Pressure Sensor 13...