CAN for Pneumatics in C++

Greetings, all.

My team is opting to use pneumatics in our tote-acquisition part of the robot this year. Pneumatics coding and wiring require a controller area network, or CAN. I have never heard of CAN until this year…would someone be able to assist me in programming a CAN for a pneumatic solenoid and compressor?

There is no need to program CAN for the pneumatics. You only need to use the CAN cables on the PCM, and connect them to the roboRIO or PDP. The code is nearly exactly the same as last year, and the compressor is actually closed-loop this year! Just declare a solenoid, and the compressor should run by itself.
Hope that helped.

That is quite helpful. It bothered my coach a bit (who was convinced that a CAN needed some type of special programming) but this cleared up a lot of inconsistency, and at least to me makes more sense. Thank you for your help.

Some helpful links… You can re-find them by searching “PCM” in the FRC Screensteps search bar.

http://wpilib.screenstepslive.com/s/4485/m/13809/l/219351-pneumatics-control-module

This one has some examples, probably the most useful.
http://wpilib.screenstepslive.com/s/4485/m/13810/l/241866?data-resolve-url=true&data-manual-id=13810

Porting guide if you have code from previous cRIO system you want to use.
http://wpilib.screenstepslive.com/s/4485/m/13810/l/292213-c-java-porting-guide-2014-to-2015

In case this up again in the future: CAN programming is only needed if you’re running a CAN motor controller. Despite my team beta testing, we haven’t used an SRX yet, so I can’t help you there. The built in CAN on the roboRIO, PDP, and PRM require no special programming. They do make wiring a lot simpler though!

It really takes very little special programming to run TalonSRX using CAN. Create a CANTalon class object for each and construct your RobotDrive using those.

You will need to use the roboRio’s web page to locate each Talon and assign it a unique CAN bus ID (used when constructing the CANTalon object).