View Full Version : Error found in programming for the pump and pressure switch
02-01-2002, 09:22 PM
In programming the pump to be controlled by the pressure switch from the sample that we got from Chief Delphi about wiring and programming information for the pump and pressure switch, the program was not working because the two variables that control the relay were being written over in subsequent sections of the default code. These are relay5_fwd and relay5_rev. After entering the given code into the section for that in the default code, these variables were reinitialized in the section right below it. To solve the problem, just comment those two variables in the "Buttons to Relays" section.
I've seen quite a few examples of code posted. All of which we have had problems getting to run. We are a rookie team and this so far has been are greatest challenge.
Would it be possible for you to paste a copy of the code you are referring too? It would be a great help. Thanks in advance.
02-02-2002, 12:59 PM
This is the program: :eek:
' Test the state of the pressure switch
if rc_sw1 = 1then pump_on 'jump if under the pressure limit
' 110 psi pressure limit has been reached
' turn pump off
relay5_fwd = 0
relay5_rev = 0
'turn pump on
relay5_fwd = 1
relay5_rev = 0
you need to comment the lines containing these right below it
Hope this helps :eek:
Thanks for the help. Our programmer actually figured out his own code, works in a similar fashion:
'In Varibles section
'====== Compressor hold command variable====
HOLD VAR byte
'in "---------- Initialize Inputs & Outputs ---"
'====== COMPRESSOR RUN CODE============
HOLD = 1
'====== COMPRESSOR LIMIT RUN CODE========
if rc_sw1 =0 then relayoff:
if rc_sw2 =1 then relayON:
if HOLD =1 then relayON:
relay7_fwd = 1
relay7_fwd = 0
It may be a bit lengthy, but he figured it out :-) Logic tables and all. :-)
02-06-2002, 04:46 PM
If you are using two sensors for your pump, the following is the easiest code.
pump = alias to relayX_fwd
highsen = alias to rc_swY (the higher of two pressure sensors)
lowsen = alias to rc_swZ (lower of two pressure sensors)
the pressure sensors read 0 when full
If highsen <> lowsen Then end_pump
pump = 1 - (1 - highsen)
Basically when the two sensor values are equal (both are full or empty), the pump will engage depending on whether the high pressure sensor is tripped. Unless you clear your pump output variable every loop, this code should work.
vBulletin® v3.6.4, Copyright ©2000-2018, Jelsoft Enterprises Ltd.