IAdsConnectAddressConnectAndWaitAsync(AmsAddress, CancellationToken) Method

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


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

Syntax

C#

Task ConnectAndWaitAsync(
    AmsAddress address,
    CancellationToken cancel
)

Parameters

address  AmsAddress

The target address.

cancel  CancellationToken

Cancellation Token.

Return Value

Task
Returns a task object that represents the ConnectAndWaitAsync(AmsAddress, CancellationToken) operation as result.

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

IAdsConnectAddress Interface ConnectAndWaitAsync Overload TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026