Class HardwareLimitSwitchConfigs
Configs that change how the motor controller behaves under different limit switch states.
Includes configs such as enabling limit switches, configuring the remote sensor ID, the source, and the position to set on limit.public class HardwareLimitSwitchConfigs : IParentConfiguration, ISerializable, ICloneable
- Inheritance
-
HardwareLimitSwitchConfigs
- Implements
- Inherited Members
Fields
ForwardLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.
- Default ValueFalse
public bool ForwardLimitAutosetPositionEnable
Field Value
ForwardLimitAutosetPositionValue
The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.
- Minimum Value-3.4e+38
- Maximum Value3.4e+38
- Default Value0
- Unitsrotations
public double ForwardLimitAutosetPositionValue
Field Value
ForwardLimitEnable
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.
- Default ValueTrue
public bool ForwardLimitEnable
Field Value
ForwardLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the forward limit switch.
- Minimum Value0
- Maximum Value62
- Default Value0
- Units
public int ForwardLimitRemoteSensorID
Field Value
ForwardLimitSource
Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).public ForwardLimitSourceValue ForwardLimitSource
Field Value
ForwardLimitType
Determines if the forward limit switch is normally-open (default) or normally-closed.
public ForwardLimitTypeValue ForwardLimitType
Field Value
ReverseLimitAutosetPositionEnable
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.
- Default ValueFalse
public bool ReverseLimitAutosetPositionEnable
Field Value
ReverseLimitAutosetPositionValue
The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.
- Minimum Value-3.4e+38
- Maximum Value3.4e+38
- Default Value0
- Unitsrotations
public double ReverseLimitAutosetPositionValue
Field Value
ReverseLimitEnable
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.
- Default ValueTrue
public bool ReverseLimitEnable
Field Value
ReverseLimitRemoteSensorID
Device ID of the remote device if using remote limit switch features for the reverse limit switch.
- Minimum Value0
- Maximum Value62
- Default Value0
- Units
public int ReverseLimitRemoteSensorID
Field Value
ReverseLimitSource
Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector.
Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).public ReverseLimitSourceValue ReverseLimitSource
Field Value
ReverseLimitType
Determines if the reverse limit switch is normally-open (default) or normally-closed.
public ReverseLimitTypeValue ReverseLimitType
Field Value
Methods
Clone()
Creates a copy of this config group.
public HardwareLimitSwitchConfigs Clone()
Returns
Deserialize(string)
Deserialize string and put values into this object
public StatusCode Deserialize(string to_deserialize)
Parameters
to_deserializestringString to deserialize
Returns
- StatusCode
OK if deserialization is OK
Serialize()
Serialize this object into a string
public string Serialize()
Returns
- string
This object's data serialized into a string
ToString()
Provides the string representation of this object
public override string ToString()
Returns
WithForwardLimitAutosetPositionEnable(bool)
Modifies this configuration's ForwardLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.
If enabled, the position is automatically set to a specific value, specified by ForwardLimitAutosetPositionValue, when the forward limit switch is asserted.- Default ValueFalse
public HardwareLimitSwitchConfigs WithForwardLimitAutosetPositionEnable(bool newForwardLimitAutosetPositionEnable)
Parameters
newForwardLimitAutosetPositionEnableboolParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitAutosetPositionValue(double)
Modifies this configuration's ForwardLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.
The value to automatically set the position to when the forward limit switch is asserted. This has no effect if ForwardLimitAutosetPositionEnable is false.- Minimum Value-3.4e+38
- Maximum Value3.4e+38
- Default Value0
- Unitsrotations
public HardwareLimitSwitchConfigs WithForwardLimitAutosetPositionValue(double newForwardLimitAutosetPositionValue)
Parameters
newForwardLimitAutosetPositionValuedoubleParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitEnable(bool)
Modifies this configuration's ForwardLimitEnable parameter and returns itself for method-chaining and easier to use config API.
If enabled, motor output is set to neutral when the forward limit switch is asserted and positive output is requested.- Default ValueTrue
public HardwareLimitSwitchConfigs WithForwardLimitEnable(bool newForwardLimitEnable)
Parameters
newForwardLimitEnableboolParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteCANcoder(CoreCANcoder)
Helper method to configure this feedback group to use RemoteCANcoder forward limit switch by passing in the CANcoder object. When using RemoteCANcoder, the Talon FX will use another CANcoder on the same CAN bus. The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
public HardwareLimitSwitchConfigs WithForwardLimitRemoteCANcoder(CoreCANcoder device)
Parameters
deviceCoreCANcoderCANcoder reference to use for RemoteCANcoder forward limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteCANdiS1(CoreCANdi)
Helper method to configure this feedback group to use RemoteCANdi forward limit switch on Signal 1 Input (S1IN) by passing in the CANdi object. The forward limit will assert when the CANdi™ branded device's Signal 1 Input (S1IN) pin matches the configured closed state.
public HardwareLimitSwitchConfigs WithForwardLimitRemoteCANdiS1(CoreCANdi device)
Parameters
deviceCoreCANdiCANdi reference to use for RemoteCANdi forward limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteCANdiS2(CoreCANdi)
Helper method to configure this feedback group to use RemoteCANdi forward limit switch on Signal 2 Input (S2IN) by passing in the CANdi object. The forward limit will assert when the CANdi™ branded device's Signal 2 Input (S2IN) pin matches the configured closed state.
public HardwareLimitSwitchConfigs WithForwardLimitRemoteCANdiS2(CoreCANdi device)
Parameters
deviceCoreCANdiCANdi reference to use for RemoteCANdi forward limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteCANrange(CoreCANrange)
Helper method to configure this feedback group to use the RemoteCANrange by passing in the CANrange object. The forward limit will assert when the CANrange proximity detect is tripped.
public HardwareLimitSwitchConfigs WithForwardLimitRemoteCANrange(CoreCANrange device)
Parameters
deviceCoreCANrangeCANrange reference to use for RemoteCANrange forward limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteSensorID(int)
Modifies this configuration's ForwardLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.
Device ID of the remote device if using remote limit switch features for the forward limit switch.- Minimum Value0
- Maximum Value62
- Default Value0
- Units
public HardwareLimitSwitchConfigs WithForwardLimitRemoteSensorID(int newForwardLimitRemoteSensorID)
Parameters
newForwardLimitRemoteSensorIDintParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitRemoteTalonFX(CommonTalon)
Helper method to configure this feedback group to use RemoteTalonFX forward limit switch by passing in the CommonTalon object. When using RemoteTalonFX, the Talon FX will use the forward limit switch attached to another Talon FX on the same CAN bus.
public HardwareLimitSwitchConfigs WithForwardLimitRemoteTalonFX(CommonTalon device)
Parameters
deviceCommonTalonCommonTalon reference to use for RemoteTalonFX forward limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitSource(ForwardLimitSourceValue)
Modifies this configuration's ForwardLimitSource parameter and returns itself for method-chaining and easier to use config API.
Determines where to poll the forward limit switch. This defaults to the forward limit switch pin on the limit switch connector. Choose RemoteTalonFX to use the forward limit switch attached to another Talon FX on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). Choose RemoteCANifier to use the forward limit switch attached to another CANifier on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ForwardLimitRemoteSensorID). The forward limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).public HardwareLimitSwitchConfigs WithForwardLimitSource(ForwardLimitSourceValue newForwardLimitSource)
Parameters
newForwardLimitSourceForwardLimitSourceValueParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithForwardLimitType(ForwardLimitTypeValue)
Modifies this configuration's ForwardLimitType parameter and returns itself for method-chaining and easier to use config API.
Determines if the forward limit switch is normally-open (default) or normally-closed.public HardwareLimitSwitchConfigs WithForwardLimitType(ForwardLimitTypeValue newForwardLimitType)
Parameters
newForwardLimitTypeForwardLimitTypeValueParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitAutosetPositionEnable(bool)
Modifies this configuration's ReverseLimitAutosetPositionEnable parameter and returns itself for method-chaining and easier to use config API.
If enabled, the position is automatically set to a specific value, specified by ReverseLimitAutosetPositionValue, when the reverse limit switch is asserted.- Default ValueFalse
public HardwareLimitSwitchConfigs WithReverseLimitAutosetPositionEnable(bool newReverseLimitAutosetPositionEnable)
Parameters
newReverseLimitAutosetPositionEnableboolParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitAutosetPositionValue(double)
Modifies this configuration's ReverseLimitAutosetPositionValue parameter and returns itself for method-chaining and easier to use config API.
The value to automatically set the position to when the reverse limit switch is asserted. This has no effect if ReverseLimitAutosetPositionEnable is false.- Minimum Value-3.4e+38
- Maximum Value3.4e+38
- Default Value0
- Unitsrotations
public HardwareLimitSwitchConfigs WithReverseLimitAutosetPositionValue(double newReverseLimitAutosetPositionValue)
Parameters
newReverseLimitAutosetPositionValuedoubleParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitEnable(bool)
Modifies this configuration's ReverseLimitEnable parameter and returns itself for method-chaining and easier to use config API.
If enabled, motor output is set to neutral when reverse limit switch is asseted and negative output is requested.- Default ValueTrue
public HardwareLimitSwitchConfigs WithReverseLimitEnable(bool newReverseLimitEnable)
Parameters
newReverseLimitEnableboolParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteCANcoder(CoreCANcoder)
Helper method to configure this feedback group to use RemoteCANcoder reverse limit switch by passing in the CANcoder object. When using RemoteCANcoder, the Talon FX will use another CANcoder on the same CAN bus. The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).
public HardwareLimitSwitchConfigs WithReverseLimitRemoteCANcoder(CoreCANcoder device)
Parameters
deviceCoreCANcoderCANcoder reference to use for RemoteCANcoder reverse limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteCANdiS1(CoreCANdi)
Helper method to configure this feedback group to use RemoteCANdi reverse limit switch on Signal 1 Input (S1IN) by passing in the CANdi object. The reverse limit will assert when the CANdi™ branded device's Signal 1 Input (S1IN) pin matches the configured closed state.
public HardwareLimitSwitchConfigs WithReverseLimitRemoteCANdiS1(CoreCANdi device)
Parameters
deviceCoreCANdiCANdi reference to use for RemoteCANdi reverse limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteCANdiS2(CoreCANdi)
Helper method to configure this feedback group to use RemoteCANdi reverse limit switch on Signal 2 Input (S2IN) by passing in the CANdi object. The reverse limit will assert when the CANdi™ branded device's Signal 2 Input (S2IN) pin matches the configured closed state.
public HardwareLimitSwitchConfigs WithReverseLimitRemoteCANdiS2(CoreCANdi device)
Parameters
deviceCoreCANdiCANdi reference to use for RemoteCANdi reverse limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteCANrange(CoreCANrange)
Helper method to configure this feedback group to use the RemoteCANrange by passing in the CANrange object. The reverse limit will assert when the CANrange proximity detect is tripped.
public HardwareLimitSwitchConfigs WithReverseLimitRemoteCANrange(CoreCANrange device)
Parameters
deviceCoreCANrangeCANrange reference to use for RemoteCANrange reverse limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteSensorID(int)
Modifies this configuration's ReverseLimitRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.
Device ID of the remote device if using remote limit switch features for the reverse limit switch.- Minimum Value0
- Maximum Value62
- Default Value0
- Units
public HardwareLimitSwitchConfigs WithReverseLimitRemoteSensorID(int newReverseLimitRemoteSensorID)
Parameters
newReverseLimitRemoteSensorIDintParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitRemoteTalonFX(CommonTalon)
Helper method to configure this feedback group to use RemoteTalonFX reverse limit switch by passing in the CommonTalon object. When using RemoteTalonFX, the Talon FX will use the reverse limit switch attached to another Talon FX on the same CAN bus.
public HardwareLimitSwitchConfigs WithReverseLimitRemoteTalonFX(CommonTalon device)
Parameters
deviceCommonTalonCommonTalon reference to use for RemoteTalonFX reverse limit switch
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitSource(ReverseLimitSourceValue)
Modifies this configuration's ReverseLimitSource parameter and returns itself for method-chaining and easier to use config API.
Determines where to poll the reverse limit switch. This defaults to the reverse limit switch pin on the limit switch connector. Choose RemoteTalonFX to use the reverse limit switch attached to another Talon FX on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). Choose RemoteCANifier to use the reverse limit switch attached to another CANifier on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). Choose RemoteCANcoder to use another CANcoder on the same CAN bus (this also requires setting ReverseLimitRemoteSensorID). The reverse limit will assert when the CANcoder magnet strength changes from BAD (red) to ADEQUATE (orange) or GOOD (green).public HardwareLimitSwitchConfigs WithReverseLimitSource(ReverseLimitSourceValue newReverseLimitSource)
Parameters
newReverseLimitSourceReverseLimitSourceValueParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself
WithReverseLimitType(ReverseLimitTypeValue)
Modifies this configuration's ReverseLimitType parameter and returns itself for method-chaining and easier to use config API.
Determines if the reverse limit switch is normally-open (default) or normally-closed.public HardwareLimitSwitchConfigs WithReverseLimitType(ReverseLimitTypeValue newReverseLimitType)
Parameters
newReverseLimitTypeReverseLimitTypeValueParameter to modify
Returns
- HardwareLimitSwitchConfigs
Itself