BaseStatusSignal Class

Common parent type for the StatusSignalT object.

This can be used for a collection of StatusSignalT objects, but we recommend using the derived class instead when possible.

Definition

Namespace: CTRE.Phoenix6
Assembly: Phoenix6 (in Phoenix6.dll) Version: 1.0.0
C#
public abstract class BaseStatusSignal
Inheritance
Object    BaseStatusSignal
Derived

Constructors

BaseStatusSignal(StatusCode) Constructor for an invalid BaseStatusSignal
BaseStatusSignal(DeviceIdentifier, UInt16, String) Normal constructor for a BaseStatusSignal.

Properties

AllTimestamps All the timestamps associated with this signal.
HasUpdated Check whether the signal has been updated since the last check.

Note that the signal must be refreshed before calling this routine.

Identifier Identifier for the device this signal is associated to. Users may use it for access to the device's ID, network name, or a unique-per-canbus device hash.
Name The name of this signal.
Status The status of the last time this signal was updated.
Timestamp The most accurate timestamp associated with this signal.
Units The units associated with this signal. These units are encoded as UTF-8, so some applications may not render them properly.
ValueAsDouble Gets the value as a double instead of the generic type. This may be helpful when working with the base class.

Methods

CopyFrom Copies the contents of the other signal into this signal
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetAppliedUpdateFrequency Gets the rate at which the device will publish this signal.

This is typically the last value passed into SetUpdateFrequency(Double, Double). The returned value may be higher if another StatusSignalT in the same status frame has been set to a higher update frequency.

GetHashCodeServes as the default hash function.
(Inherited from Object)
GetLatencyCompensatedValue Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation.The caller must refresh these StatusSignals beforehand; this function only does the math required for latency compensation.

Important: The signalSlope must be the rate of change of the signal. If it is not, the latency compensation may not perform as expected.

Example

For example:
C#
double compensatedTurns = BaseStatusSignal.GetLatencyCompensatedValue(fx.GetPosition(), fx.GetVelocity());
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsAllGood Checks if all signals have an OK error code.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
RefreshAll Performs a non-blocking refresh on all provided signals.

This provides a performance improvement over separately calling Refresh(Boolean) on each signal.

SetUpdateFrequency Sets the rate at which the device will publish this signal.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to the frame.

SetUpdateFrequencyForAll Sets the update frequency of all specified status signals to the provided common frequency.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to each frame.

ToStringReturns a string that represents the current object.
(Inherited from Object)
WaitForAll Waits for new data on all provided signals up to timeout. This API is typically used with CANivore Bus signals as they will be synced using the CANivore Timesync feature and arrive simultaneously.Signals on a roboRIO bus cannot be synced and may require a significantly longer blocking call to receive all signals.

Note that CANivore Timesync requires Phoenix Pro.

This can also be used with a timeout of zero to refresh many signals at once, which is faster than calling Refresh(Boolean)on every signal. This is equivalent to calling RefreshAll(BaseStatusSignal).

Fields

localRef Local reference to a StatusSignalNativeStatusSignalInfo object for use with the native interface.
spn SPN index for this signal.

See Also