beautypg.com

A.5 station power usage, A.5.1 – Campbell Scientific PS200/CH200 12 V Charging Regulators User Manual

Page 93

background image

Appendix A. Advanced Programming Techniques

SerialIn (CH200string,COMPRT,50,&H00,140)
Check_sum = CheckSum (CH200string,5,0 )

'For the string to be correct the check sum must be zero.
If Check_sum = 0 Then
'Split up the main string from PS/CH200 into separate components.

SplitStr (CH200_MX(),CH200string,COMMA,4,4)
'Sort out the components to specific variables.
BattTargV = CH200_MX(1)

DgtlPotSet = CH200_MX(2)
BattCap = CH200_MX(3)
Qloss = CH200_MX(4)

EndIf
NextScan
EndProg

A.5 Station Power Usage

Station power usage can be a very serious question if batteries at a site are
frequently dying or if the system is known to use a lot of power and the mix of
battery and solar panel size are still being ascertained.

Having the station calculating a power budget on an hourly basis will help to
identify when higher than normal load conditions occur and separate out
whether the load is due to the battery or the datalogger and
sensors/communication options connected to it.

A.5.1 Station Power Usage SDI12 Programming Example

'CR1000 Series Datalogger
'Program: SDI12_Amp-Hr_Test.CR1

'Programmer: Bart Nef - CSI
'Date: 12.November.2010
'Ver: A

'
'Notes: This program measures and records current usage by the station

'in amp-hours. Data is stored for hourly and daily values as well as
'PS/CH200 status variables.
'In order to calculate amp-hour capacity the measured currents coming

'from the PS/CH200 must be modified to include the scan rate and then
'totalled over the data table interval.
'PS200/CH100 configured with SDI-12 address 0 (zero).

'Use CSI cable part # 20769. The black and clear wires connect to the CR1000
'ground, and the white wire connects to the CR1000 control port C3.
'

'Public Variables
PipeLineMode
'Constants & Public Variables

Const SlowScan = 30

'scan rate used with the slow scan section.

'I like to use the words "On" and "Off" vs. True and False.

Const On = True
Const Off = False
Public PanelTempC

'Datalogger panel temperature: Celsius

Public Batt_Volt
'Array holding all the three Amp-hour calculations
Public Amp_Hour(3)

'Amp-hours used by the entire system.
Alias Amp_Hour(1) = Sys_Amp_hr
'Amp-hours used by the datalogger, sensors and any communication options.

Alias Amp_Hour(2) = Load_Amp_hr
'Amp-hours going into the battery. Current coming out of the battery is
'part of the Load_Amp_hr value.

Alias Amp_Hour(3) = Batt_Amp_hr
Dim n

'Used as a counter.

A-31