Does Select case not allow and's in one line?
Here is a snippet.
Even when all is true it ignores the first 2 lines.
Background:
pv = current photovoltaic voltage (varies 0-34v)
pvhigh = voltage to turn on both grid tie inverter and battery charger (13.5v)
pvmin = minimum pv voltage to shut down system (12.0v)
batt = current battery voltage
battmax = maximum battery voltage (13.2v)
Now if I delete the ands it will jump to the subs.Code:Select Case pv Case is >= pvmin and pv >= batt and pv <= battmax gosub ChargeBatt 'Turns on batt relay Case is >= battmax and batt >= battmax gosub gridtie 'Turns on inverter relay case is >=pvhigh gosub AllSystems 'Turns on both relays Case else ' < pvmin. Turns off both relays gosub standby end Select ' Resume here after case is executed
Code:Select Case pv Case is >= pvmin gosub ChargeBatt 'Turns on batt relay Case is >= battmax gosub gridtie 'Turns on inverter relay case is >=pvhigh gosub AllSystems 'Turns on both relays Case else gosub standby ' < pvmin. Turns off both relays end Select ' Resume here after case is executed




Bookmarks