beautypg.com

3 sdi-12 extended commands, Sdi-12 extended commands – Campbell Scientific PS200/CH200 12 V Charging Regulators User Manual

Page 45

background image

PS200/CH200 12 V Charging Regulators

Dim CheckBatteryArr(2) As String

'Variables to hold the words for charge state, charge source, and check
'battery.
Public ChargeState As String

Public ChargeSource As String
Public CheckBattery As String

'Stored hourly data.
DataTable (Hour,1,-1)
DataInterval (0,1,Hr,10)

Minimum (6,CH200_M0(),FP2,0,False)
Maximum (6,CH200_M0(),FP2,False,False)

Minimum (1,PanelTempC(),FP2,0,False)
Maximum (1,PanelTempC(),FP2,False,False)
EndTable


'Main Program
BeginProg

'Load arrays with words to associate with the charge state, charge source
'and check battery values from the PS/CH200.
ChargeStateArr(1) = "Regulator Fault"

ChargeStateArr(2) = "No Charge"
ChargeStateArr(3) = "Current Limited"
ChargeStateArr(4) = "Cycle Charging"

ChargeStateArr(5) = "Float Charging"
ChargeStateArr(6) = "Battery Test"


ChargeSourceArr(1) = "None"
ChargeSourceArr(2) = "Solar"

ChargeSourceArr(3) = "Continuous"

CheckBatteryArr(1) = "Normal"

CheckBatteryArr(2) = "Check Battery"

Scan (5,Sec,0,0)

PanelTemp(PanelTempC,_60Hz)

'Measure datalogger panel temperature.

CallTable Hour
NextScan


'SlowSequence with SDI-12 measurements

SlowSequence
Scan(30,sec,0,0)
SDI12Recorder (CH200_M0(),3,0,"MC!",1.0,0)

'Array values start with one. Values for charge state start with -1.
'Have to shift the value by two to line it up with the correct words
'in the array.

ChargeState = ChargeStateArr(Chg_State + 2)
'Values for charge source start with zero. Have to shift the value
'by one to line it up with the correct words in the array.

ChargeSource = ChargeSourceArr(Chg_Source + 1)
'Values for check battery start with zero. Have to shift the value

'by one to line it up with the correct words in the array.
CheckBattery = CheckBatteryArr(Ck_Batt + 1)
NextScan
EndProg

6.2.3 SDI-12 Extended Commands

The response to all of the commands in this section is aOK, where ‘a’ is the
SDI-12 address of the PS200/CH200.

See Appendix A, Advanced Programming Techniques, for example programs
using these extended commands.

37