SolenoidBase

class wpilib.SolenoidBase(moduleNumber)[source]

Bases: wpilib.SendableBase

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

Constructor.

Parameters:moduleNumber – The PCM CAN ID
clearAllPCMStickyFaults(moduleNumber)[source]

Clear ALL sticky faults inside the PCM that Solenoid is wired to.

If a sticky fault is set, then it will be persistently cleared. Compressor drive
maybe momentarily disable while flages 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:moduleNumber – in a static context, the module number to read. otherwise don’t provide it.
getAll(moduleNumber)[source]

Read all 8 solenoids from the specified module as a single byte.

Parameters:moduleNumber – in a static context, the module number to read. otherwise don’t provide it.
Returns:The current value of all 8 solenoids on the module.
getPCMSolenoidBlackList(moduleNumber)[source]
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:moduleNumber – in a static context, the module number to read. otherwise don’t provide it.
Returns:The solenoid blacklist of all 8 solenoids on the module.
getPCMSolenoidVoltageFault(moduleNumber)[source]
Parameters:moduleNumber – in a static context, the module number to read. otherwise don’t provide it.
Returns:True if PCM is in fault state : The common highside solenoid voltage rail is too low, most likely a solenoid channel has been shorted.
getPCMSolenoidVoltageStickyFault(moduleNumber)[source]
Parameters:moduleNumber – in a static context, the module number to read. otherwise don’t provide it.
Returns:True if PCM Sticky fault is set : The common highside solenoid voltage rail is too low, most likely a solenoid channel has been shorted.