AdsClient.RegisterAdsStateChangedAsync Method

Registers for AdsStateChanged events as an asynchronous operation.

Namespace:  TwinCAT.Ads
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 6.0.328+39e3229

Syntax

C#

public Task<ResultAds> RegisterAdsStateChangedAsync(
    EventHandler<AdsStateChangedEventArgs> handler,
    CancellationToken cancel
)

Parameters

handler

Type: System.EventHandler.AdsStateChangedEventArgs.
The handler function to be registered for AdsStateChanged calls.

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.ResultAds.
A task that represents the asynchronous 'RegisterAdsStateChanged' operation. The ResultAds parameter contains the state the ErrorCode of the ADS communication after execution.

Implements

IAdsStateProvider.RegisterAdsStateChangedAsync(EventHandler.AdsStateChangedEventArgs., CancellationToken)

Exceptions

Exception

Condition

ObjectDisposedException

Reference

AdsClient Class

TwinCAT.Ads Namespace