Class StatusSignal<T>
Represents a status signal with data of type T, and operations available to retrieve information about the signal.
public class StatusSignal<T> : BaseStatusSignal, ICloneable
Type Parameters
TUnderlying type of signal to get
- Inheritance
-
StatusSignal<T>
- Implements
- Inherited Members
Properties
Supplier
Returns a lambda that calls Refresh and gets the value on this object.
public Func<T> Supplier { get; }
Property Value
- Func<T>
Lambda that refreshes this signal and returns it
Value
Gets the cached value from this status signal.
To make sure the value is up-to-date, call Refresh(bool) or WaitForUpdate(double, bool).public T Value { get; }
Property Value
- T
Methods
Clone()
Clone this object to get a copy of itself
public StatusSignal<T> Clone()
Returns
- StatusSignal<T>
Copy of this object
GetDataCopy()
Get a basic data-only container with a copy of the current signal data.
Note if looking for Phoenix 6 logging features, see the SignalLogger class instead.public SignalMeasurement<T> GetDataCopy()
Returns
- SignalMeasurement<T>
Basic structure with all relevant information
Refresh(bool)
Refreshes the value of this status signal.
If the user application caches this StatusSignal object instead of periodically fetching it from the hardware device, this function must be called to fetch fresh data. This performs a non-blocking refresh operation. If you want to wait until you receive the signal, call WaitForUpdate(double, bool) instead.public StatusSignal<T> Refresh(bool reportError = true)
Parameters
reportErrorboolWhether to report any errors to the console. Defaults true
Returns
- StatusSignal<T>
Reference to itself
ToString()
Gets the string representation of this object.
Includes the value of the signal and the units associated with this signal.public override string ToString()
Returns
WaitForUpdate(double, bool)
Waits up to timeoutSec to get the up-to-date status signal value.
This performs a blocking refresh operation. If you want to non-blocking refresh the signal, call Refresh(bool) instead.public StatusSignal<T> WaitForUpdate(double timeoutSec, bool reportError = true)
Parameters
timeoutSecdoubleMaximum time to wait for the signal to update
reportErrorboolWhether to report any errors to the console. Defaults true
Returns
- StatusSignal<T>
Reference to itself