AdsClientConnectAndWaitAsync Method

Connects/Reconnects to the target address and waits until the IAdsConnection is disconnected asynchronously.


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

Syntax

C#

public Task ConnectAndWaitAsync(
    AmsAddress address,
    CancellationToken cancel
)

Parameters

address  AmsAddress

The target address.

cancel  CancellationToken

Cancellation Token.

Return Value

Task
A Task representing the asynchronous operation.

Implements

IAdsConnectAddressConnectAndWaitAsync(AmsAddress, CancellationToken)

Exceptions

Exception

Condition

ObjectDisposedException

AdsException

AdsClient is already connected!

Remarks

This method is used for scenarios, where the ADSClient disconnects from other code asynchronously. When this method returns, the connection is already terminated and only additional cleanup code should be processed.

Reference

AdsClient Class TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026