Pneumatic LabView Programming Help

We are having trouble getting our double solenoid and compressor to activate. I have uploaded some pictures of our, and


General suggestions:

  1. Download “The secret book of FRC Labview”. Chapter 6 discusses I/O, including compressor and solenoids, with pictures of code. Link here.
    Secret Book of FRC LabVIEW (and control logic) version 2.07

  2. Team 358 also has some nice samples on their web site. (search for FRC team 358 in google or your favorite search tool.)

  3. All “open” VIs need to be in BEGIN.VI. This is only done once, when the robot is powered on.

Suggestions for compressor:

  1. Look at BEGIN.VI first. It should have a compressor open connected to a “set registry” VI.
    Nothing else is really needed for the compressor to work. When the robot is enabled, the compressor should run if the pressure is low.
  2. If you want, you can read the status of the compressor and write entries to the network tables so you can see this on the dashboard. This would go into a loop in “Periodic tasks”. I’d suggest the slower loop (100 milliseconds). Again - This isn’t necessary, just nice for debugging. Here is a picture.

For a double solenoid:

  1. You need to open the solenoid and set a “registry” entry so you can use it in other VIs. This goes in BEGIN.VI. This is also in chapter 6 of the book. I didn’t see this in your screen shots. Here is a sample.

  2. To command the solenoid to do something, such as in TELEOP.VI, get the “registry” entry for the specific solenoid. The name set in BEGIN much exactly match what is used in TELEOP. Also only use the get registry VI once for any one solenoid. (It is a little inefficient.) If you use two solenoids, you would need two “get registry” VI, one for each. Then set the value using a SET VI. Here is a sample. You can use the SELECT function wired to a button to select FORWARD or REVERSE then wire this to the SET VI.
    Another slightly more complicated sample that would go in teleop VI.

You don’t really need the code in FINISH.VI. (It likely doesn’t get called.)

1 Like

Literally everything he said! Plus the fact that current LabView doesn’t require you to even initialize a Compressor in if you initialize even one solenoid, the software automatically does compressor initialization.

Correct. The only reason to open the compressor itself is if, for some reason, you wanted to, with code, stop and start the compressor itself.

We moved the radio, and now the compressor works. However, we are still having trouble with the double solenoid. The cylinder will not activate and deactivate using our joystick buttons.

A couple of suggestions of things to look at

  1. are the lights on the pneumatics control module (pcm) for outputs 0 and 1 lighting when pressing the buttons? (If they are then check the voltage setting on the PCM and make certain it matches the voltage on your solenoids.)
  2. Ensure you are pushing the joystick buttons for a good second or so…
  3. Are you getting any messages in the driver station message window?
  4. Is the mode set to teleop enabled?

We checked the solenoid and it is a 24v solenoid. However, our PCM is set to 12v. We need to change the voltage, but we can’t figure out how to “move” the jumper.

pull it out with a pair of tweezers, then reinsert it.

We changed the voltage to 24v on the PCM. The cylinder is still only working manually. We can take a small screwdriver and flip the “positive” and “negative” ends of the double solenoid.

Just pushing on the manual buttons, not twisting (which locks them into a fixed position).
I usually tell people to use a pen, not a screwdriver, just because it’s tempting to turn a screwdriver.

You can tell when they are locked when they no longer push and retract. If they are hard and don’t move then they are locked in place.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.