AX#

Search Results for

    Show / Hide Table of Contents

    Class OnlinerBase<T>

    Base generic class for onliner types. Instance of OnlinerBase<T> is commonly referred to as 'tag' or 'PLC tag'.

    Inheritance
    object
    OnlinerBase
    OnlinerBase<T>
    OnlinerBool
    OnlinerByte
    OnlinerChar
    OnlinerDInt
    OnlinerDWord
    OnlinerDate
    OnlinerDateTime
    OnlinerInt
    OnlinerLDateTime
    OnlinerLInt
    OnlinerLReal
    OnlinerLTime
    OnlinerLTimeOfDay
    OnlinerLWord
    OnlinerReal
    OnlinerSInt
    OnlinerString
    OnlinerTime
    OnlinerTimeOfDay
    OnlinerUDInt
    OnlinerUInt
    OnlinerULInt
    OnlinerUSInt
    OnlinerWChar
    OnlinerWString
    OnlinerWord
    Implements
    ITwinPrimitive
    ITwinElement
    IOnline<T>
    IShadow<T>
    INotifyPropertyChanged
    IValueBoundaries<T>
    Inherited Members
    OnlinerBase.PollingInterval
    OnlinerBase.AttributeFormatString
    OnlinerBase.SymbolTail
    OnlinerBase.Parent
    OnlinerBase.SubscribeForPeriodicReading()
    OnlinerBase.ReadWriteAccess
    OnlinerBase.MakeReadOnly()
    OnlinerBase.ReadOnce
    OnlinerBase.MakeReadOnce()
    OnlinerBase.GetSymbolTail()
    OnlinerBase.GetParent()
    OnlinerBase.Poll()
    OnlinerBase.Interpreter
    OnlinerBase.Subscribe(ValueChangedEventHandlerDelegate)
    OnlinerBase.Subscribe()
    OnlinerBase.UnSubscribe(ValueChangedEventHandlerDelegate)
    OnlinerBase.AccessStatus
    OnlinerBase.Symbol
    OnlinerBase.AttributeName
    OnlinerBase.GetAttributeName(CultureInfo)
    OnlinerBase.HumanReadable
    OnlinerBase.GetHumanReadable(CultureInfo)
    OnlinerBase.CreateSymbol(string, string)
    OnlinerBase.ValueChangeEvent
    OnlinerBase.GetValueChangeEventSubscribers()
    OnlinerBase.OnValueChangeEvent(object)
    OnlinerBase.PropertyChanged
    OnlinerBase.NotifyPropertyChanged(string)
    OnlinerBase.AddToPeriodicQueue()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: AXSharp.Connector.ValueTypes
    Assembly: AXSharp.Connector.dll
    Syntax
    public abstract class OnlinerBase<T> : OnlinerBase, ITwinPrimitive, ITwinElement, IOnline<T>, IShadow<T>, INotifyPropertyChanged, IValueBoundaries<T>
    Type Parameters
    Name Description
    T

    Constructors

    | Edit this page View Source

    OnlinerBase()

    Allows for parameter-less constructor in derived class.

    Declaration
    protected OnlinerBase()
    | Edit this page View Source

    OnlinerBase(ITwinObject, string, string)

    Creates an instance of OnlinerBase<T>.

    Declaration
    protected OnlinerBase(ITwinObject parent, string readableTail, string symbolTail)
    Parameters
    Type Name Description
    ITwinObject parent

    Parent object that creates this instance.

    string readableTail

    HumanReadable tail of this instance.

    string symbolTail

    Symbol tail of this instance.

    Fields

    | Edit this page View Source

    validator

    Holder field for validation rule.

    Declaration
    protected OnlinerValidationRule<T> validator
    Field Value
    Type Description
    OnlinerValidationRule<T>

    Properties

    | Edit this page View Source

    AttributeMaximum

    Gets or sets max. value allowed for this tag. If the value is not set the max. value will be the maximum allowed for this type.

    note

    The value is typically set by attribute in the PLC code

    This example demonstrates how to set value boundaries for a numerical value. AttributeMinimum and AttributeMaximum. Notice that the name of the 'added property' is prefixed with 'Attribute' when trans-piled into .net class.
    {attribute addProperty Minimum 10}
        {attribute addProperty Maximum 50}
        _integerVar : INT;
    Declaration
    public T AttributeMaximum { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    AttributeMinimum

    Gets or sets min. value allowed for this tag. If the value is not set the min. value will be the maximum allowed for this type.

    note

    The value is typically set by attribute in the PLC code

    This example demonstrates how to set value boundaries for a numerical value. AttributeMinimum and AttributeMaximum. Notice that the name of the 'added property' is prefixed with 'Attribute' when trans-piled into .net class.
    {attribute addProperty Minimum 10}
        {attribute addProperty Maximum 50}
        _integerVar : INT;
    Declaration
    public T AttributeMinimum { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    AttributeToolTip

    Gets or sets tool tip message for this tag.

    Declaration
    public string AttributeToolTip { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    AttributeUnits

    Gets or sets the attribute units.

    Declaration
    public string AttributeUnits { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Cyclic

    Gets the value that was read in the last cycle or sets the value to be written in the next cycle.

    Declaration
    public virtual T Cyclic { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    CyclicToWrite

    Gets the value that will be written in the next cycle.

    Declaration
    protected T CyclicToWrite { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    Edit

    Gets the cyclically read value. Setter set the value that will be written in the next cycle. The value is validated prior to performing write operation. The value must fall between InstanceMinValue and InstanceMaxValue, any value outside permissible range will not be written and original value will remain unaltered. Editing of the value invokes EditValue(T, T) which allows for value change logging via EditValueChange delegate.

    Declaration
    public T Edit { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    EditValueChange

    Gets or sets delegate that executes when Edit property is changed.

    Declaration
    public override OnlinerBase.ValueChangeDelegate EditValueChange { get; set; }
    Property Value
    Type Description
    OnlinerBase.ValueChangeDelegate
    Overrides
    OnlinerBase.EditValueChange
    | Edit this page View Source

    InstanceMaxValue

    Gets the maximum value allowed for this tag. The default max. value is maximum of this type if AttributeMaximum is not set. If the AttributeMaximum property is set then InstanceMaxValue will return its value.

    Declaration
    public abstract T InstanceMaxValue { get; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    InstanceMinValue

    Gets the minimal value allowed for this tag. The default min. value is minimum of this type if AttributeMinimum is not set. If the AttributeMinimum property is set then InstanceMinValue will return its value.

    Declaration
    public abstract T InstanceMinValue { get; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    IsSubscribed

    Get whether this primitive is subscribed for periodic reading.

    Declaration
    public bool? IsSubscribed { get; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    LastValue

    Gets the last value retrieved from cyclical or batched reading. Without requesting cyclical read operation on this onliner.

    Declaration
    public virtual T LastValue { get; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    Raw

    Gets the raw value read from the controller. The value is not affected by TranslatorBase or StringInterpolator.

    Declaration
    public virtual T Raw { get; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    ReadFromPlcIsRequested

    Gets or sets a value indicating whether read from plc is requested.

    Declaration
    public bool ReadFromPlcIsRequested { get; protected set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    SetLastValue

    Sets LastValue property value. This property should be used only for testing purposes.

    Declaration
    [Obsolete("Use cyclic instead", false)]
    public T SetLastValue { set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    Shadow

    Gets or sets shadow placeholder for the value of this instance. Shadow is off line placeholder that does not affect the PLC controller's value of this tag. Shadow values can be written to PLC controller via 'FlushShadowToOnline' method of a respective structure. Online values can be written to its Shadow representation via 'FlushOnlineToShadow' method of the respective structure. The value must fall between InstanceMinValue and InstanceMaxValue, any value outside permissible range will not be set and original value will remain unaltered. Change of the shadow value can be observed via ShadowValueChange delegate.

    Declaration
    public T Shadow { get; set; }
    Property Value
    Type Description
    T
    | Edit this page View Source

    ShadowValueChange

    Gets or sets delegate that executed when Shadow property is changed.

    Declaration
    public override OnlinerBase.ValueChangeDelegate ShadowValueChange { get; set; }
    Property Value
    Type Description
    OnlinerBase.ValueChangeDelegate
    Overrides
    OnlinerBase.ShadowValueChange
    | Edit this page View Source

    Validator

    Gets the validation rule for this type. Validation occurs only when property Edit is changed.

    Declaration
    public OnlinerValidationRule<T> Validator { get; }
    Property Value
    Type Description
    OnlinerValidationRule<T>
    | Edit this page View Source

    VariableInfo

    Gets information about this tag's online variable info.

    Declaration
    protected ITwinPrimitiveInfo VariableInfo { get; set; }
    Property Value
    Type Description
    ITwinPrimitiveInfo

    Methods

    | Edit this page View Source

    FromOnlineToShadow()

    Copies the value from the plc to the shadow value holder.

    Declaration
    public override void FromOnlineToShadow()
    Overrides
    OnlinerBase.FromOnlineToShadow()
    | Edit this page View Source

    FromShadowToOnline()

    Copies the value from the shadow value holder to the respective plc variable.

    Declaration
    public override void FromShadowToOnline()
    Overrides
    OnlinerBase.FromShadowToOnline()
    | Edit this page View Source

    GetAsync()

    Gets the value of this variable from the controller asynchronously.

    Declaration
    public virtual Task<T> GetAsync()
    Returns
    Type Description
    Task<T>
    Remarks

    This method accesses the item in a single request over communication layer; accessing multiple items may result in performance degradation over the communication interface with the target system. This method is to be used only when you need the item to be read from the PLC and the return the control of the program. Consider using ITwinObjects ReadAsync(ITwinObject) or WriteAsync(ITwinObject) methods for bulk access to entire structures.

    | Edit this page View Source

    GetAsync(CultureInfo)

    Gets value translated in give CultureInfo

    Declaration
    public virtual Task<T> GetAsync(CultureInfo culture = null)
    Parameters
    Type Name Description
    CultureInfo culture

    Culture into which the value should be translated.

    Returns
    Type Description
    Task<T>

    Translated value.

    | Edit this page View Source

    GetAttributeToolTip(CultureInfo)

    Gets translated tooltip for given CultureInfo

    Declaration
    public string GetAttributeToolTip(CultureInfo culture)
    Parameters
    Type Name Description
    CultureInfo culture

    Culture used to translate this tooltip

    Returns
    Type Description
    string

    Translated tooltip

    | Edit this page View Source

    GetCyclic(CultureInfo)

    Gets Cyclic translated with provided CultureInfo

    Declaration
    public virtual T GetCyclic(CultureInfo culture = null)
    Parameters
    Type Name Description
    CultureInfo culture

    Desired culture.

    Returns
    Type Description
    T

    Translated value

    | Edit this page View Source

    GetDeclaringAssembly()

    Gets the assembly that declares the instance of this tag.

    Declaration
    public Assembly GetDeclaringAssembly()
    Returns
    Type Description
    Assembly
    | Edit this page View Source

    GetLastAvailableValue()

    Gets tha most recent value either LastValue or Cyclic if that is more recent.

    Declaration
    public virtual T GetLastAvailableValue()
    Returns
    Type Description
    T
    | Edit this page View Source

    HasWriteAccess()

    Get true when this tag has write access.

    Declaration
    public bool HasWriteAccess()
    Returns
    Type Description
    bool

    The bool.

    | Edit this page View Source

    InitializeDefaults()

    Initializes default value of this generic OnlinerBase<T>.

    Declaration
    protected static T InitializeDefaults()
    Returns
    Type Description
    T
    | Edit this page View Source

    ReadFromItem()

    NVI should be implemented in derived class. When implemented in derived class provide reading of the Cyclicvalue for this tag from a stream.

    Declaration
    protected virtual void ReadFromItem()
    | Edit this page View Source

    SetAsync(T)

    Sets the value of this variable to the controller asynchronously.

    Declaration
    public virtual Task<T> SetAsync(T value)
    Parameters
    Type Name Description
    T value
    Returns
    Type Description
    Task<T>
    Remarks

    This method accesses the item in a single request over communication layer; accessing multiple items may result in performance degradation over the communication interface with the target system. This method is to be used only when you need the item to be read from the PLC and the return the control of the program. Consider using ITwinObjects ReadAsync(ITwinObject) or WriteAsync(ITwinObject) methods for bulk access to entire structures.

    | Edit this page View Source

    UpdateRead(T)

    Updates cyclically read value and performs notifications.

    Declaration
    protected void UpdateRead(T val)
    Parameters
    Type Name Description
    T val

    Updated value.

    | Edit this page View Source

    WriteItem()

    NVI should be implemented in derived class. When implemented in derived class provide writing of the Cyclicvalue for this tag from a stream.

    Declaration
    protected virtual void WriteItem()

    Events

    | Edit this page View Source

    ShadowValueChangeEvent

    Shadow value changed event.

    Declaration
    public event ValueChangedEventHandlerDelegate ShadowValueChangeEvent
    Event Type
    Type Description
    ValueChangedEventHandlerDelegate

    Implements

    ITwinPrimitive
    ITwinElement
    IOnline<T>
    IShadow<T>
    INotifyPropertyChanged
    IValueBoundaries<T>

    Extension Methods

    TranslatorExtension.Translate(ITwinElement, string, CultureInfo)
    TwinObjectExtensions.HasAttribute<T>(ITwinElement)
    TwinObjectExtensions.StartPolling(ITwinElement, int, object)
    TwinObjectExtensions.StopPolling(ITwinElement, object)
    TwinPrimitiveExtensions.GetAttribute<T>(ITwinElement)
    TwinPrimitiveExtensions.GetPropertyInfoViaSymbol(ITwinElement)
    TwinPrimitiveExtensions.GetCyclicValue<T>(OnlinerBase)
    TwinPrimitiveExtensions.GetLastValue<T>(OnlinerBase)
    TwinPrimitiveExtensions.GetShadowValue<T>(OnlinerBase)
    TwinPrimitiveExtensions.SetCyclicValue<T>(OnlinerBase, T)
    TwinPrimitiveExtensions.SetShadowValue<T>(OnlinerBase, T)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFx. © MTS spol. s r.o., MTS spol. s r.o., and awesome contributors