Table of Contents

Class CANcoder

Namespace
CTRE.Phoenix6.Hardware
Assembly
Phoenix6.Hardware.dll

Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along with filtered velocity.

public class CANcoder : CoreCANcoder, CommonDevice
Inheritance
CANcoder
Implements
Inherited Members

Constructors

CANcoder(int)

Constructs a new CANcoder object.

Constructs the device using the default CAN bus for the system (see CANBus(string)).
public CANcoder(int deviceId)

Parameters

deviceId int

ID of the device, as configured in Phoenix Tuner

CANcoder(int, CANBus)

Constructs a new CANcoder object.

public CANcoder(int deviceId, CANBus canbus)

Parameters

deviceId int

ID of the device, as configured in Phoenix Tuner

canbus CANBus

The CAN bus this device is on

CANcoder(int, string)

Constructs a new CANcoder object.

[Obsolete("Constructing devices with a CAN bus string is deprecated for removal in the 2027 season. Construct devices using a CANBus instance instead.")]
public CANcoder(int deviceId, string canbus)

Parameters

deviceId int

ID of the device, as configured in Phoenix Tuner

canbus string

Name of the CAN bus. Possible CAN bus strings are:

  • CANivore name or serial number
  • SocketCAN interface (non-FRC Linux only)
  • "" for any CANivore seen by the program
  • empty string (default) to select the default for the system:
    • "can0" on Linux
    • "" on Windows