AdsConnection.WriteControlAsync Method (AdsState, UInt16, ReadOnlyMemory.Byte., CancellationToken)

Writes the AdsState and device state to the ADS device.

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

Syntax

C#

public Task<ResultAds> WriteControlAsync(
    AdsState adsState,
    ushort deviceState,
    ReadOnlyMemory<byte> writeBuffer,
    CancellationToken cancel
)

Parameters

adsState

Type: TwinCAT.Ads.AdsState
State of the ads.

deviceState

Type: System.UInt16
State of the device.

writeBuffer

Type: System.ReadOnlyMemory.Byte.
The write buffer.

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

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

Implements

IAdsStateControl.WriteControlAsync(AdsState, UInt16, ReadOnlyMemory.Byte., CancellationToken)

Reference

AdsConnection Class

WriteControlAsync Overload

TwinCAT.Ads Namespace