SolenoidBase

class wpilib.SolenoidBase(self: wpilib.SolenoidBase, pcmID: int) → None

Bases: wpilib.ErrorBase

SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.

Constructor.

Parameters

moduleNumber – The CAN PCM ID.

clearAllPCMStickyFaults(self: wpilib.SolenoidBase) → None

Clear ALL sticky faults inside PCM that Compressor is wired to.

If a sticky fault is set, then it will be persistently cleared. Compressor drive maybe momentarily disable while flags are being cleared. Care should be taken to not call this too frequently, otherwise normal compressor functionality may be prevented.

If no sticky faults are set then this call will have no effect.

static clearAllPCMStickyFaultsByModule(module: int) → None

Clear ALL sticky faults inside PCM that Compressor is wired to.

If a sticky fault is set, then it will be persistently cleared. Compressor drive maybe momentarily disable while flags are being cleared. Care should be taken to not call this too frequently, otherwise normal compressor functionality may be prevented.

If no sticky faults are set then this call will have no effect.

Parameters

module – the module to read from

getAll(self: wpilib.SolenoidBase) → int

Read all 8 solenoids as a single byte

Returns

The current value of all 8 solenoids on the module.

static getAllByModule(module: int) → int

Read all 8 solenoids as a single byte

Parameters

module – the module to read from

Returns

The current value of all 8 solenoids on the module.

getPCMSolenoidBlackList(self: wpilib.SolenoidBase) → int

Reads complete solenoid blacklist for all 8 solenoids as a single byte.

If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared. @see ClearAllPCMStickyFaults()

Returns

The solenoid blacklist of all 8 solenoids on the module.

static getPCMSolenoidBlackListByModule(module: int) → int

Reads complete solenoid blacklist for all 8 solenoids as a single byte.

If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared. @see ClearAllPCMStickyFaults()

Parameters

module – the module to read from

Returns

The solenoid blacklist of all 8 solenoids on the module.

getPCMSolenoidVoltageFault(self: wpilib.SolenoidBase) → bool
Returns

true if PCM is in fault state : The common highside solenoid voltage rail is too low, most likely a solenoid channel is shorted.

static getPCMSolenoidVoltageFaultByModule(module: int) → bool
Parameters

module – the module to read from

Returns

true if PCM is in fault state : The common highside solenoid voltage rail is too low, most likely a solenoid channel is shorted.

getPCMSolenoidVoltageStickyFault(self: wpilib.SolenoidBase) → bool
Returns

true if PCM sticky fault is set : The common highside solenoid voltage rail is too low, most likely a solenoid channel is shorted.

static getPCMSolenoidVoltageStickyFaultByModule(module: int) → bool
Parameters

module – the module to read from

Returns

true if PCM sticky fault is set : The common highside solenoid voltage rail is too low, most likely a solenoid channel is shorted.