Class AnalogInput
Represents a base class for a Beckhoff IO analog input.
public abstract class AnalogInput : ChannelLisrtModuleBase, ILisrtModule, IHasDeviceLabel, IAnalogInput, IHasKey, IHasDescription, IHasServiceView, IInitializable, INotifyPropertyChangedEx, INotifyPropertyChanged
- Inheritance
-
PropertyChangedBaseAnalogInput
- Implements
-
INotifyPropertyChangedEx
- Derived
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Properties
Adjustment
Gets or sets the adjustment.
public IAdjustment Adjustment { get; set; }
Property Value
AveragingTime
Gets or sets the averaging time in milliseconds. Zero disables averaging.
[Configuration(0, Unit = "ms", Description = "The time window for averaging the input values. 0 disables averaging.")]
public int AveragingTime { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Thrown when the value is negative.
Description
Gets or sets the translatable description.
public ITranslation Description { get; set; }
Property Value
- ITranslation
InitializationState
Gets a value indicating whether the object is initialized.
public InitializationState InitializationState { get; }
Property Value
Sensor
Gets or sets the sensor.
public ISensor Sensor { get; set; }
Property Value
UnadjustedValue
Gets the value, that isn't adjusted by Adjustment.
[DoNotNotify]
public double UnadjustedValue { get; }
Property Value
UnscaledUnit
Gets the unscaled unit.
protected abstract string UnscaledUnit { get; }
Property Value
UnscaledValue
Gets the real value of the analog input, not scaled by Sensor and not adjusted by Adjustment. Usually in V or mA.
[DoNotNotify]
public double UnscaledValue { get; }
Property Value
Value
Gets the scaled and adjusted value.
[DoNotNotify]
public double Value { get; }
Property Value
Methods
AdjustValue(double)
Adjusts a scaled value with the Adjustment, if available.
protected double AdjustValue(double value)
Parameters
valuedoubleA scaled but unadjusted value.
Returns
- double
The adjusted value.
ConvertData(byte[])
Converts raw data to a value.
protected abstract double ConvertData(byte[] data)
Parameters
databyte[]Raw data.
Returns
- double
The floating point value.
Exit()
De initializes the object.
public void Exit()
GetValue()
Gets the value by scaling the latest value with Sensor and then with Adjustment.
public double GetValue()
Returns
- double
The latest value scaled.
Initialize()
Initializes the object.
public void Initialize()
ScaleValue(double)
Scales a value with the Sensor, if available.
protected double ScaleValue(double value)
Parameters
valuedoubleA unadjusted and unscaled value.
Returns
- double
The scaled value.
ShowServiceView()
Shows the service window.
public void ShowServiceView()
UpdateUnscaledValue(double)
Updates the unscaled value.
protected void UpdateUnscaledValue(double newValue)
Parameters
newValuedoubleThe new unscaled value.