Public PTemp, Batt_volt
Public CS655(3)
Alias CS655(1)=vwc
Alias CS655(2)=ec
Alias CS655(3)=T
Units vwc=%
Units ec=dS/m
Units T=deg c
'Declare Private Variables
'Example:
'Dim Counter
'Define Data Tables.
DataTable (Test,1,-1) 'Set table size to # of records, or -1 to autoallocate.
DataInterval (0,1,Sec,10)
Minimum (1,Batt_volt,FP2,False,False)
Sample (1,PTemp,FP2)
Sample (3,CS655(),FP2)
EndTable
'Define Subroutines
'Sub
'EnterSub instructions here
'EndSub
'Main Program
BeginProg
Scan (1,Sec,0,0)
PanelTemp (PTemp,60)
Battery (Batt_volt)
'Enter other measurement instructions
'Call Output Tables
SDI12Recorder (CS655(),C1,1,“M!”,1.0,0)
vwc=vwc*100
'Example:
CallTable Test
NextScan
EndProg
'/上述示例为CR300的C1口接一个CS655土壤水分传感器,接线方式为SDI12,所得的第一个数据为wvc土壤含水量,单位为%;第二个数据为ec电导率,单位为dS/m;第三个数据为T,单位为deg C。
传感器地址为1,所用的指令为M!,即:
SDI12R