IAdsConnectAddressConnectAsync(AmsNetId, Int32, CancellationToken) Method

Connects/Reconnects to the specified target address asynchronously.


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

Syntax

C#

Task ConnectAsync(
    AmsNetId netId,
    int port,
    CancellationToken cancel
)

Parameters

netId  AmsNetId

The AmsNetId of the target.

port  Int32

The AMS port.

cancel  CancellationToken

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

Return Value

Task
Task.

Remarks

If the IConnection is already connected (IsConnected), this connection will be reestablished/reconnected.

Reference

IAdsConnectAddress Interface ConnectAsync Overload TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026