![Campbell CS230 Скачать руководство пользователя страница 20](http://html1.mh-extra.com/html/campbell/cs230/cs230_field-maintenance-and-instruction-manual_3745991020.webp)
CS230 Temperature Profiler
11
7.2.2.1 CR1000 Program to Read the Meta Data of 15 Sensors Daily
In this example, a single CS230 is being polled on Control Port 1 of a CR1000
in a slow sequence. The CS230 includes 20 sensors with SDI-12 addresses 1
through 20. Each sensor is polled with the
aR0!
command every 60 seconds,
and stored to a data table on the same interval. Other common station data is
measured every 5 seconds and stored to a daily and hourly data tables.
'CR1000 Series Datalogger
'The following Sample program reads a CS230 probe that has 20 temperature Sensors
'Declare Public Variables
Public PTemp, batt_volt
'Enter the number of temperature sensors that are in the probe (will need to be
'adjusted to fit specific application)
Const NumTempSensors=20
'Uses the control port C1 on the CR1000 (valid port options are 1,3,5,7)
Const CS230_SDI12_Port=1
Public CS230Temp(NumTempSensors) As Float
Dim i As Long
'Define Data Tables
DataTable (Daily,1,-1)
DataInterval (0,1440,Min,10)
Minimum (1,batt_volt,FP2,0,False)
Maximum (1,batt_volt,FP2,0,False)
Average (1,batt_volt,FP2,0)
EndTable
DataTable (Hourly,1,-1)
DataInterval (0,60,Min,10)
Minimum (1,PTemp,FP2,0,False)
Maximum (1,PTemp,FP2,0,False)
Average (1,PTemp,FP2,0)
EndTable
DataTable (One_Minute,1,-1)
DataInterval (0,60,Sec,10)
Sample (NumTempSensors,CS230Temp(),IEEE4)
EndTable
'Define Subroutines
'*****************************************************************************
'* --------------------- ConvertNumToSDI12address() ---------------------- *
'* Convert SDI-12 character address (0->9, A->Z, and a->z) to number value *
'* (0->61). *
'*****************************************************************************
Function ConvertNumToSDI12address(address As Long) As String * 1
Select Case address
Case 0 To 9
'ASCII Code 48->57 = 0->9
Return(CHR(a 48))
Case 10 To 35
'ASCII Code 65->90 = A->Z = 10->35
Return(CHR(a 55))
Case 36 To 61
'ASCII Code 97->122 = a->z = 36->61
Return(CHR(a 61))
EndSelect
Return("")
EndFunction
'ConvertNumToSDI12address()
'EndSub
Содержание CS230
Страница 2: ......
Страница 3: ......
Страница 7: ......
Страница 29: ...CS230 Temperature Profiler 20...
Страница 30: ......