View Single Post
  #5   Spotlight this post!  
Unread 06-02-2002, 17:46
zorro zorro is offline
Registered User
#0292 (PantherTech)
 
Join Date: Jan 2002
Location: Kokomo, IN
Posts: 21
zorro is an unknown quantity at this point
Send a message via AIM to zorro
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
.......

pump_code:
If highsen <> lowsen Then end_pump
pump = 1 - (1 - highsen)

end_pump:
........

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.
__________________
Greg Szorc
gregszorc@cwru.edu

Last edited by zorro : 06-02-2002 at 18:01.