Warning

The CANdle Phoenix 5 API is deprecated and will be removed in 2027. Additionally, Talon FX, CANcoder, and Pigeon 2 now require Phoenix 6. Users are encouraged to migrate to the Phoenix 6 library for deprecated devices.

# Bring Up: PCM

At this point PCM will have firmware 1.62 or 1.65 (latest). Open Phoenix Tuner to confirm.

## Phoenix Tuner Self-test Snapshot

Press Self-test Snapshot to confirm solenoid states, compressor state ,and battery/current measurements. Since device is not enabled, no outputs should assert.

Note

In this view, the Self-test Snapshot was docked to the right. If CAN Devices width is shrunk small enough, the field-upgrade and Device ID options are hidden and the list view becomes collapsed. This way you can still use the device list as an alternative to the center-top dropdown.

The next step is to get the compressor and solenoids operational.

Create a Solenoid object in LabVIEW/C++/Java and set channel 0 to true.

    import edu.wpi.first.wpilibj.Solenoid;
    public class Robot extends TimedRobot {
        Solenoid _solenoid = new Solenoid(0, 0); // first number is the PCM ID (usually zero), second number is the solenoid channel

        public void teleopPeriodic() {
            _solenoid.set(true);
        }

Tip

Image below can be dragged/dropped into LabVIEW editor.

Then confirm using the Solenoid LED on the PCM and Self-test Snapshot in Tuner.

Tip

There is a modernized version called Tuner X that is available for Windows and Android devices (works with Phoenix 5 and Phoenix 6).

Generally creating a solenoid object is sufficient for the compressor features to function. In order for the compressor output to activate, all of the following conditions must be met:

- The robot is enabled via the Driver Station

- Robot application has created a solenoid (or compressor object) with the correct PCM device ID.

- PCM must be powered/wired to CAN Bus.

- Pressure-switch reads too-low (can be confirmed in Self-test Snapshot).

- No compressor related faults occur (can be confirmed in Self-test Snapshot)

Tip

Creating a compressor object is not necessary, but can be useful to force the compressor off despite pressure reading too-low with the setClosedLoopControl routine/VI. This can be useful for robot power management during critical operations.

    import edu.wpi.first.wpilibj.Compressor;
    public class Robot extends TimedRobot {
        Compressor _compressor = new Compressor();

        public void teleopPeriodic() {
            _compressor.setClosedLoopControl(false); //This will force the compressor off
        }

Tip

Image below can be dragged/dropped into LabVIEW editor.