SessionConnectAndWaitAsync Method

Connects the session.


Namespace: TwinCAT
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470

Syntax

C#

public Task<IConnection> ConnectAndWaitAsync(
    CancellationToken cancel
)

Parameters

cancel  CancellationToken

The cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value

Task IConnection
A Task<IConnection> representing the asynchronous operation.

Exceptions

Exception

Condition

ObjectDisposedException

AdsException

Connection to '{this.AddressSpecifier}' couldn't be established!

Remarks

The IConnection will be valid until the ISession is disconnected via the Disconnect method or the Dispose method is called. Any possible resurrections after communication losses will be done transparently within the IConnection so that the IConnection instance and ISession instance remains.

Reference

Session Class TwinCAT Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026