FIRST Robotics Competition Discussions

Showing results for 
Search instead for 
Did you mean: 

Pneumatic Compressor LabVIEW programming

Go to solution

For the pneumatic compressor; what are the Begin.VI, Teleop.VI and Finish.VI code?

For Begin; I did to a WPI_CompressorRefNum Registry Set.VI

And for Finish; I did WPI_CompressorRefNum Registry to a

Assuming the above are correct, what goes in the


0 Kudos
Message 1 of 8

Hi I would open the "Solenoid With" example found under the Help -> Find Examples.. Menu

Compressor PM.png

I would recomend placing the compressor vis in the following locations.

Begin: Open and Start

Finish: Stop and Close

Timed Tasks: CompressorControlLoop (By itself not inside a loop)(Context help states that the control loop vi is not to be placed in the Teleop vi


Teleop: Enable(Only for monitoring if the compressor is on or off not for control)

Also the Start and Stop vis can be used in Teleop if you want to enable or disable the compressor durring the match.


Message 2 of 8

The response really helped. Thank You so much.

I am from team 3515. I just have one more question. Below is the code i have from team 358 for a double solenoid control.

In the the, "Joystick 1/Button 1" is a boolean value that determines forward or reverse. Is there any way

for me to be able to use my axis or control the solenoid so that it just isn't a simple boolean. Basically, I need a way to control the output from the solenoid,

to be able to control the speed.

Screen Shot 2014-02-15 at 7.13.01 PM.png

Thank You

0 Kudos
Message 3 of 8

Please help!!!!^^^^^^^

0 Kudos
Message 4 of 8

Are you trying to control speed of the solenoid opening and closing or open and close the solenoid based on axis value?

1) if based on axis value:

I think what you need is a comparison function block like a greater than or equal to function block.

With say y valve from the axis signal and x set for 0.4 the output could be a digital valve on or off.

2) speed of solenoid would be a variable orifice speed valve on the air line to or from the solenoid ports.


0 Kudos
Message 5 of 8


Works! Thanks!

For the periodic tasks, I used a get function connected to the control loop function block.

0 Kudos
Message 6 of 8

This is Efrain from Southwest, my students are currently working on the programming for this FRC season. The only question I have regarding your code is, what data type or variable in labview are you using to create that button boolean variable you have? And how did you create it? Basically just where does it lie in the drop downs with the existing functions and VIs currently available. Hopefully this isn't too old and you get some sort of notification, thanks!

0 Kudos
Message 7 of 8

Hello PSJASouthwest,


It seems this forum is indeed somewhat old, and I wouldn't like you to be waiting for an answer that perhaps is not updated anymore. the FRC WPI library is changed from year to year, so the previous code you see in older documents might not look similar to the way the VIs are used now.


In any case, to answer your question: it seems to me it is an Enum type saved as a Type Definition.


That being said, I suggest you and your students check the next resources to program your compressor and solenoids:



All the best for this season! Feel free to create a new forum post with the questions you have regarding these solutions.

0 Kudos
Message 8 of 8