Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Out of bounds


arctictech65 Feb 7, 2011 11:32 PM

Using a CR3000 and a AM16/32 Multiplexer to measure (among other things) the mV values of voltage shunts on the solar system powering the datalogger. The program compiles and runs (pipeline mode), but receive an 'out of bounds' warning. The datatable contains the mV values but not the calculated amps. However it's not clear from the documentation how to fix. Thanks in advance for your help!

'Power Control and Temperature Monitoring

Const PV_shunt_ohms = 0.001
Const batt_shunt_ohms = 0.002
Const load_shunt_ohms = 0.005
Const mux_chan = 1

Public shunt_mv (7)
Units shunt_mv = mV

Public shunt_amps (7)
Alias shunt_amps (1) = Tower
Alias shunt_amps (2) = PV1
Alias shunt_amps (3) = PV2
Alias shunt_amps (4) = Batt_bank1
Alias shunt_amps (5) = Batt_bank2
Alias shunt_amps (6) = Batt_bank3
Alias shunt_amps (7) = Batt_bank4

Units Tower = amps
Units PV1 = amps
Units PV2 = amps
Units Batt_bank1 = amps
Units Batt_bank2 = amps
Units Batt_bank3 = amps
Units Batt_bank4 = amps

'*** Beginning of slow sequence scan output data ***
'other parts of datatable
Average (1,batt_volt,IEEE4,slowsequence_disable_f)
Average (7,shunt_mv(1),FP2,FALSE)
Average (7,shunt_amps(1),FP2,FALSE)
Minimum (7,shunt_amps(1),FP2,FALSE,False)

BeginProgram
' etc etc other measurement instructions

SlowSequence
i = 1

Scan (1,Sec,3,0)
'Measure battery voltage.
Battery (batt_volt)

'Find the power load in the solar system

'Measure the voltage shunts at the power panel using AM16/32 Multiplexer
MuxSelect (6,5,5,mux_chan,1) 'turn on mux to channel 1 in B mode
SubScan (0,0,7)
VoltDiff(shunt_mv(i),1,mV200,1,False,200, 250, 1, 0)
PulsePort (6,5000) 'advance the mux
i = i+1
NextSubScan
PortSet (5,0) 'turn off mux
i = 1


'Calculate amps from mV measurements of shunts
Tower = (shunt_mV(1)/load_shunt_ohms)/1000
PV1 = (shunt_mV(2)/PV_shunt_ohms)/1000
PV2 = (shunt_mV(3)/PV_shunt_ohms)/1000
Batt_bank1 = (shunt_mV(4)/batt_shunt_ohms)/1000
Batt_bank2 = (shunt_mV(5)/batt_shunt_ohms)/1000
Batt_bank3 = (shunt_mV(6)/batt_shunt_ohms)/1000
Batt_bank4 = (shunt_mV(7)/batt_shunt_ohms)/1000


Dana Feb 8, 2011 12:14 AM

If you are receiving a Variable out of bounds error, you can insert the InstructionTimes instruction in the program and it will return the variable name that is the problem.

Refer to the CRBasic help.

Regards,

Dana W.


jra Feb 8, 2011 03:04 PM

Also, take a look at the Common CRBasic Programming Errors tutorial: http://www.campbellsci.com/19_1_9999_158

Log in or register to post/reply in the forum.