AdsServer.OnReadDeviceStateConfirmationAsync Method

Called when an ADS Read State confirmation is received.

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

Syntax

C#

protected virtual Task<AdsErrorCode> OnReadDeviceStateConfirmationAsync(
    AmsAddress sender,
    uint invokeId,
    AdsErrorCode result,
    AdsState adsState,
    ushort deviceState,
    CancellationToken cancel
)

Parameters

sender

Type: TwinCAT.Ads.AmsAddress
The sender's AMS address

invokeId

Type: System.UInt32
The invoke id provided by this server during the corresponding request

result

Type: TwinCAT.Ads.AdsErrorCode
The ADS error code provided by the sender

adsState

Type: TwinCAT.Ads.AdsState
The ADS state of the sender

deviceState

Type: System.UInt16
The device state of the sender

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.AdsErrorCode.
A task that represents the asynchronous OnReadDeviceStateConfirmationAsync(AmsAddress, UInt32, AdsErrorCode, AdsState, UInt16, CancellationToken) operation. The Task.TResult. parameter contains the AdsErrorCode as Result.

Remarks

Overwrite this method in derived classes to react on ADS Read State confirmations. The Default implementaton just returns NoError. Because the Confirmation is the last step in the ADS communication an Error will just be logged, but not processed any further. For a functional AdsServer, this confirmation handler doesn't need to be overloaded!

Reference

AdsServer Class

TwinCAT.Ads.Server Namespace