AX#

Search Results for

    Show / Hide Table of Contents

    Class Connector

    Abstract base class provides implementation contract for the PLC connector and basic common underlying logic.

    Inheritance
    object
    RootTwinObject
    Connector
    DummyConnector
    WebApiConnector
    Implements
    ITwinObject
    ITwinElement
    INotifyPropertyChanged
    Inherited Members
    RootTwinObject.Identity
    RootTwinObject.GetSymbolTail()
    RootTwinObject.Poll()
    RootTwinObject.Interpreter
    RootTwinObject.AttributeName
    RootTwinObject.GetAttributeName(CultureInfo)
    RootTwinObject.GetHumanReadable(CultureInfo)
    RootTwinObject.Symbol
    RootTwinObject.HumanReadable
    RootTwinObject.GetChildren()
    RootTwinObject.GetParent()
    RootTwinObject.AddChild(ITwinObject)
    RootTwinObject.GetValueTags()
    RootTwinObject.AddValueTag(ITwinPrimitive)
    RootTwinObject.GetConnector()
    RootTwinObject.OnlineToPlain<T>()
    RootTwinObject.PlainToOnline<T>(T)
    RootTwinObject.ShadowToPlain<T>()
    RootTwinObject.PlainToShadow<T>(T)
    RootTwinObject.AnyChangeAsync<T>(T)
    RootTwinObject.OnlineToPlain()
    RootTwinObject.PlainToOnline(object)
    RootTwinObject.ShadowToPlain()
    RootTwinObject.PlainToShadow(object)
    RootTwinObject.AddKid(ITwinElement)
    RootTwinObject.GetKids()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: AXSharp.Connector
    Assembly: AXSharp.Connector.dll
    Syntax
    public abstract class Connector : RootTwinObject, ITwinObject, ITwinElement, INotifyPropertyChanged

    Constructors

    | Edit this page View Source

    Connector()

    Creates new instance of Connector class

    Declaration
    protected Connector()
    | Edit this page View Source

    Connector(object[])

    Creates an instance of Connector class

    Declaration
    protected Connector(object[] parameters)
    Parameters
    Type Name Description
    object[] parameters

    Connection parameters

    Examples
    var connector = new IConnector();

    Properties

    | Edit this page View Source

    ConcurrentRequestDelay

    Gets or sets delay between Concurrent Requests. It is applied when ConcurrentRequestMaxCount is reached.

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

    ConcurrentRequestMaxCount

    Gets or sets maximal count of Concurrent Request. Maximum number of simultaneous requests is 4.

    Note

    The property will be capped to this value if higher value is assigned.

    Important

    When setting this value take into account that other devices may communicate with your target system.

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

    ConnectorAdapter

    Gets adapter for onliners.

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

    CyclicRwDuration

    Gets the last duration of Read/Write cycle in milliseconds.

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

    ErrorCount

    Gets or sets error counter of the adapter.

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

    ExceptionBehaviour

    Gets or sets how the connector should handle communication exceptions.

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

    IdentityProvider

    Gets object identity provider.

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

    IsRwLoopSuspended

    Gets or set whether RW loop is suspended.

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

    Logger

    Provides logging capability for this connector.

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

    MonitorConnector

    Gets or sets value indicating whether the performance of the monitor should be active.

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

    OnlineTags

    Gets online value items tags attached to this connector.

    Declaration
    public IEnumerable<ITwinPrimitive> OnlineTags { get; }
    Property Value
    Type Description
    IEnumerable<ITwinPrimitive>
    | Edit this page View Source

    ReadWriteCycleDelay

    Gets or sets delay between Read/Write cycles.

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

    RwCycleCount

    Gets the number of Read Write cycles from the start of the connector.

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

    StartUpTime

    Get the connector's startup timestamp.

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

    SubscriptionMode

    Gets or sets subscription mode for reading data from the controller.

    Declaration
    public ReadSubscriptionMode SubscriptionMode { get; set; }
    Property Value
    Type Description
    ReadSubscriptionMode

    Methods

    | Edit this page View Source

    BuildAndStart()

    Builds and starts this connector.

    Declaration
    public abstract Connector BuildAndStart()
    Returns
    Type Description
    Connector
    | Edit this page View Source

    ClearPeriodicReadSet()

    Declaration
    protected void ClearPeriodicReadSet()
    | Edit this page View Source

    CreateHumanReadable(string, string)

    Return humanized path combining parent's and member's names.

    Declaration
    public static string CreateHumanReadable(string parent, string member)
    Parameters
    Type Name Description
    string parent

    Parent's name.

    string member

    Members name.

    Returns
    Type Description
    string

    Combine symbol of parent and member.

    | Edit this page View Source

    CreateSymbol(string, string)

    Return symbol path combining parent's and member's symbol.

    Declaration
    public static string CreateSymbol(string parent, string member)
    Parameters
    Type Name Description
    string parent

    Parent's path.

    string member

    Members name.

    Returns
    Type Description
    string

    Combine symbol of parent and member.

    | Edit this page View Source

    CyclicRead()

    Reads online variables required to be read.

    Declaration
    protected Task CyclicRead()
    Returns
    Type Description
    Task
    | Edit this page View Source

    CyclicWrite()

    Writes modified online variables.

    Declaration
    protected Task CyclicWrite()
    Returns
    Type Description
    Task
    | Edit this page View Source

    ReadBatchAsync(IEnumerable<ITwinPrimitive>)

    Reads batch of value items from the plc.

    Declaration
    public abstract Task ReadBatchAsync(IEnumerable<ITwinPrimitive> primitives)
    Parameters
    Type Name Description
    IEnumerable<ITwinPrimitive> primitives

    Primitive items to be read.

    Returns
    Type Description
    Task
    | Edit this page View Source

    ReloadConnector()

    Forces the connector to reload symbols.

    Declaration
    public abstract void ReloadConnector()
    | Edit this page View Source

    SetCulture(CultureInfo)

    Sets the culture for this connector.

    Declaration
    public static void SetCulture(CultureInfo culture)
    Parameters
    Type Name Description
    CultureInfo culture

    Desired culture

    | Edit this page View Source

    SetField<T>(ref T, T, string)

    Sets properties backing field value and notifies over INotifyPropertyChanged interface.

    Declaration
    protected bool SetField<T>(ref T field, T value, string propertyName)
    Parameters
    Type Name Description
    T field

    Field.

    T value

    Value to be set.

    string propertyName

    Property name.

    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    Type of backing field.

    | Edit this page View Source

    SetLoggerConfiguration(ILogger)

    Sets logger for this connector.

    ![NOTE] The default logger is implemented. Default implementation will log into console and in simple text file.

    Declaration
    public void SetLoggerConfiguration(ILogger logger)
    Parameters
    Type Name Description
    ILogger logger

    Logger

    | Edit this page View Source

    StartReadWriteOps()

    Starts cyclical read write operation on this connector.

    Declaration
    protected void StartReadWriteOps()
    | Edit this page View Source

    WriteBatchAsync(IEnumerable<ITwinPrimitive>)

    Writes batch of value items to the plc.

    Declaration
    public abstract Task WriteBatchAsync(IEnumerable<ITwinPrimitive> primitives)
    Parameters
    Type Name Description
    IEnumerable<ITwinPrimitive> primitives

    Primitive items to be written.

    Returns
    Type Description
    Task

    Events

    | Edit this page View Source

    PropertyChanged

    Implementation of INotifyPropertyChanged

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    PropertyChangedEventHandler

    Implements

    ITwinObject
    ITwinElement
    INotifyPropertyChanged

    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)
    TwinObjectExtensions.CreatePoco(ITwinObject)
    TwinObjectExtensions.MakeReadOnce(ITwinObject)
    TwinObjectExtensions.MakeReadOnly(ITwinObject)
    TwinObjectExtensions.OnlineToShadowAsync(ITwinObject)
    TwinObjectExtensions.ReadAsync(ITwinObject)
    TwinObjectExtensions.ReadAsync<T>(ITwinObject)
    TwinObjectExtensions.RetrievePrimitives(ITwinObject, List<ITwinPrimitive>)
    TwinObjectExtensions.ShadowToOnlineAsync(ITwinObject)
    TwinObjectExtensions.SubscribeEditValueChange(ITwinObject, OnlinerBase.ValueChangeDelegate)
    TwinObjectExtensions.SubscribeShadowValueChange(ITwinObject, OnlinerBase.ValueChangeDelegate)
    TwinObjectExtensions.UnSubscribeEditValueChange(ITwinObject)
    TwinObjectExtensions.UnSubscribeShadowValueChange(ITwinObject)
    TwinObjectExtensions.WriteAsync(ITwinObject)
    TwinObjectExtensions.WriteAsync<T>(ITwinObject)

    See Also

    RootTwinObject
    INotifyPropertyChanged
    • 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