Section 11. Programming Resource Library
111
CRBASIC EXAMPLE 17.
CRBASIC EXAMPLE. Radio Power Minimization Program
Examples
‘Pin Enabled Radio Program Example Program for CR1000
'Pakbus Address = 2
Public Rx(6), Tx, Result
Alias Rx(1)=VWC_1: Alias Rx(2)=VWC_2 ‘Alias used to give meaningful names to
Alias Rx(3)=VWC_3: Alias Rx(4)=VWC_4 ‘data received from remote datalogger
Alias Rx(5)=Tsoil_C: Alias Rx(6)=Batt_206_V
Alias Tx=Batt_CR1K_V
DataTable (Test,1,-1)
DataInterval
(0,60,Min,10)
Average
(6,Rx(),FP2,False)
Minimum
(1,Batt_CR1K_V,FP2,False,False)
EndTable
BeginProg
Scan
(15,Sec,0,0)
Battery
(Batt_CR1K_V)
CallTable
Test
NextScan
'Send Network command every 5 minutes
SlowSequence
Scan
(5,Min,0,0)
Network
(Result,1,3,15,60,0,6,Rx(),1,Tx)
NextScan
EndProg
------------------------------------------------------------------------------------------
'Pin Enabled Radio Example for CR206X
'Pakbus address 3
Public Time, TxData(6)
Public Period_uS(4), Response, Rx
Alias TxData(1)=VWC_1: Alias TxData(2)=VWC_2: Alias TxData(3)=VWC_3
Alias TxData(4)=VWC_4: Alias TxData(5)=T109_C: Alias TxData(6)=Batt_Volt
Alias Rx = CR1K_Batt_Volt
Dim LoopCnt
Units Batt_Volt=Volts
Units Period_uS()=uSec
Units T109_C=Deg C
DataTable(VWC_pin,True,-1)
DataInterval(0,60,Min)
Average(5,TxData(),False)
Minimum (1,Batt_Volt,False,0)
EndTable
BeginProg
SetStatus (RfPwrMode,RFpinEn) 'Configure CR200(X) power mode to pin enabled
Scan(1,sec)
If IfTime (0,15,Min) Then 'Take readings every 15 minutes
Battery(Batt_Volt)
Therm109(T109_C,1,5,1,1.0,0.0)
SWBatt (1 ) 'Power CS625 sensors up
PeriodAvg(Period_uS(1),1,0,100,10,1,1,0)
PeriodAvg(Period_uS(2),2,0,100,10,1,1,0)
PeriodAvg(Period_uS(3),3,0,100,10,2,1,0)
PeriodAvg(Period_uS(4),4,0,100,10,2,1,0)
SWBatt (0) 'Power CS625 sensors down
For LoopCnt = 1 To 4 'convert raw values to volumetric water content
TxData(LoopCnt)=-0.0663-0.0063*Period_uS(L0.0007*Period_uS(
Next LoopCnt
EndIf
Time = TimeUntilTransmit(1) 'copy countdown time to public variable
If Time = 0 Then 'when countdown reaches zero power radio and transmit
SendGetData (Response,Rx,TxData(),1,2,2,00000)
EndIf
CallTable(VWC_Pin)
NextScan
EndProg
Summary of Contents for CR200
Page 32: ...Section 2 Quickstart Tutorial 22 ...
Page 45: ...Section 3 Overview 35 3 3 Specifications ...
Page 46: ...Section 3 Overview 36 ...
Page 58: ...Section 4 Sensor Support 48 ...
Page 62: ...Section 5 Measurement and Control Peripherals 52 ...
Page 78: ...Section 8 CR200 X Configuration 68 ...
Page 102: ...Section 9 Programming 92 ...
Page 138: ...Section 11 Programming Resource Library 128 ...
Page 156: ...Section 16 Support Software 146 ...
Page 160: ...Section 17 Care and Maintenance 150 ...
Page 167: ...Section 18 Troubleshooting 157 18 3 3 2 Charging Circuit Test Solar Panel ...
Page 168: ...Section 18 Troubleshooting 158 18 3 3 3 Charging Circuit Test Transformer ...
Page 169: ...Section 18 Troubleshooting 159 18 3 3 4 Adjusting Charging Circuit Voltage ...
Page 170: ...Section 18 Troubleshooting 160 ...
Page 184: ...Appendix A Glossary 14 ...
Page 190: ...Appendix B Status Table and Settings 20 ...
Page 192: ...Appendix C Serial Port Pin Outs 22 ...
Page 211: ......