Table of Contents

Class SoftwareLimitSwitchConfigs

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

Configs that affect how software-limit switches behave.

Includes enabling software-limit switches and the threshold at which they are tripped.
public class SoftwareLimitSwitchConfigs : IParentConfiguration, ISerializable, ICloneable
Inheritance
SoftwareLimitSwitchConfigs
Implements
Inherited Members

Fields

ForwardSoftLimitEnable

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.

  • Default ValueFalse
public bool ForwardSoftLimitEnable

Field Value

bool

ForwardSoftLimitThreshold

Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value-3.4e+38
  • Maximum Value3.4e+38
  • Default Value0
  • Unitsrotations
public double ForwardSoftLimitThreshold

Field Value

double

ReverseSoftLimitEnable

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.

  • Default ValueFalse
public bool ReverseSoftLimitEnable

Field Value

bool

ReverseSoftLimitThreshold

Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.

  • Minimum Value-3.4e+38
  • Maximum Value3.4e+38
  • Default Value0
  • Unitsrotations
public double ReverseSoftLimitThreshold

Field Value

double

Methods

Clone()

Creates a copy of this config group.

public SoftwareLimitSwitchConfigs Clone()

Returns

SoftwareLimitSwitchConfigs

Deserialize(string)

Deserialize string and put values into this object

public StatusCode Deserialize(string to_deserialize)

Parameters

to_deserialize string

String 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

string

WithForwardSoftLimitEnable(bool)

Modifies this configuration's ForwardSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.

If enabled, the motor output is set to neutral if position exceeds ForwardSoftLimitThreshold and forward output is requested.
  • Default ValueFalse
public SoftwareLimitSwitchConfigs WithForwardSoftLimitEnable(bool newForwardSoftLimitEnable)

Parameters

newForwardSoftLimitEnable bool

Parameter to modify

Returns

SoftwareLimitSwitchConfigs

Itself

WithForwardSoftLimitThreshold(double)

Modifies this configuration's ForwardSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

Position threshold for forward soft limit features. ForwardSoftLimitEnable must be enabled for this to take effect.
  • Minimum Value-3.4e+38
  • Maximum Value3.4e+38
  • Default Value0
  • Unitsrotations
public SoftwareLimitSwitchConfigs WithForwardSoftLimitThreshold(double newForwardSoftLimitThreshold)

Parameters

newForwardSoftLimitThreshold double

Parameter to modify

Returns

SoftwareLimitSwitchConfigs

Itself

WithReverseSoftLimitEnable(bool)

Modifies this configuration's ReverseSoftLimitEnable parameter and returns itself for method-chaining and easier to use config API.

If enabled, the motor output is set to neutral if position exceeds ReverseSoftLimitThreshold and reverse output is requested.
  • Default ValueFalse
public SoftwareLimitSwitchConfigs WithReverseSoftLimitEnable(bool newReverseSoftLimitEnable)

Parameters

newReverseSoftLimitEnable bool

Parameter to modify

Returns

SoftwareLimitSwitchConfigs

Itself

WithReverseSoftLimitThreshold(double)

Modifies this configuration's ReverseSoftLimitThreshold parameter and returns itself for method-chaining and easier to use config API.

Position threshold for reverse soft limit features. ReverseSoftLimitEnable must be enabled for this to take effect.
  • Minimum Value-3.4e+38
  • Maximum Value3.4e+38
  • Default Value0
  • Unitsrotations
public SoftwareLimitSwitchConfigs WithReverseSoftLimitThreshold(double newReverseSoftLimitThreshold)

Parameters

newReverseSoftLimitThreshold double

Parameter to modify

Returns

SoftwareLimitSwitchConfigs

Itself