Table of Contents

Class AnalogInput

Namespace
Loehnert.Lisrt.IO.Beckhoff.Channels
Assembly
Loehnert.Lisrt.IO.Beckhoff.dll

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
PropertyChangedBase
AnalogInput
Implements
INotifyPropertyChangedEx
Derived
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged

Properties

Adjustment

Gets or sets the adjustment.

public IAdjustment Adjustment { get; set; }

Property Value

IAdjustment

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

int

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

InitializationState

Sensor

Gets or sets the sensor.

public ISensor Sensor { get; set; }

Property Value

ISensor

UnadjustedValue

Gets the value, that isn't adjusted by Adjustment.

[DoNotNotify]
public double UnadjustedValue { get; }

Property Value

double

UnscaledUnit

Gets the unscaled unit.

protected abstract string UnscaledUnit { get; }

Property Value

string

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

double

Value

Gets the scaled and adjusted value.

[DoNotNotify]
public double Value { get; }

Property Value

double

Methods

AdjustValue(double)

Adjusts a scaled value with the Adjustment, if available.

protected double AdjustValue(double value)

Parameters

value double

A scaled but unadjusted value.

Returns

double

The adjusted value.

ConvertData(byte[])

Converts raw data to a value.

protected abstract double ConvertData(byte[] data)

Parameters

data byte[]

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

value double

A 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

newValue double

The new unscaled value.