View Full Version : Auto off air compressior code
Dark element
24-01-2010, 18:15
Hello I was just wondering where to find the code that automatically. turns off the air compressor. Thank you
WPIlib in LabVIEW has a set of blocks to open, start, stop, and close the Compressor. When you open a compressor, you set the slot and port of the compressor AND the pressure switch. The set of blocks for the compressor will automatically handle the pressure switch for you. If you aren't using LabVIEW, the code associated for the compressor will automatically handle the pressure switch.
wireties
24-01-2010, 18:21
Is there a C++ lib for this also?
ehochstein
24-01-2010, 18:23
If you aren't using LabVIEW, the code associated for the compressor will automatically handle the pressure switch.
It should automatically handle the switch I guess.
Michael DiRamio
24-01-2010, 18:31
In C++ and Java, after you create a compressor object and call its start method it will automatically turn the compressor on and off as needed.
You need to make sure you have the pressure switch wired up to a digital input correctly and that you specify the correct spike relay and digital input for the pressure switch when you create the object.
Dark element
24-01-2010, 18:38
Thank you for your post and I found it is the 2005 code
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;
Thank you for your support
Mark McLeod
24-01-2010, 19:04
In 2005 the code needed a single line of code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
The pressure switch connects to Digital Input 18
The Spike for the compressor is controlled by Relay 8
Dark element
24-01-2010, 19:24
In 2005 the code needed a single line of code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
The pressure switch connects to Digital Input 18
The Spike for the compressor is controlled by Relay 8
Ok now how can I change when the pump turns on and off
Mark McLeod
24-01-2010, 20:10
Whatever you want to do:
relay8_rev = 0; /* stays this way and doesn't change */
relay8_fwd = 1 /* Turns the compressor on */
relay8_fwd = 0 /* Turns the compressor off */
luc.bettaieb
26-01-2010, 12:49
This is all very useful stuff. Thanks!
word of warning: 2005 code WONT work on your cRIOs. it was written under a MUCH different system, with completely different interfacing to the relays (Spikes) and motor controllers (jaguar/victor)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.