SolenoidBase

class wpilib.SolenoidBase(moduleNumber)[source]

Bases: wpilib.SensorBase

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

Constructor.

Parameters:moduleNumber – The PCM CAN ID
all_allocated = {}
all_mutex = {}
all_ports = {}
clearAllPCMStickyFaults()[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.

getAll()[source]

Read all 8 solenoids from the module used by this solenoid as a single byte.

Returns:The current value of all 8 solenoids on this module.
getPCMSolenoidBlackList()[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()
Returns:The solenoid blacklist of all 8 solenoids on the module.
getPCMSolenoidVoltageFault()[source]
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()[source]
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.
set(value, mask)[source]

Set the value of a solenoid.

Parameters:
  • value – The value you want to set on the module.
  • mask – The channels you want to be affected.