AdsConnection.ReadWriteAsync Method (UInt32, Memory.Byte., ReadOnlyMemory.Byte., CancellationToken)

ReadWrites value data asynchronously to/from the symbol represented by the variableHandle.

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

Syntax

C#

public Task<ResultReadWrite> ReadWriteAsync(
    uint variableHandle,
    Memory<byte> readBuffer,
    ReadOnlyMemory<byte> writeBuffer,
    CancellationToken cancel
)

Parameters

variableHandle

Type: System.UInt32
Variable handle.

readBuffer

Type: System.Memory.Byte.
The read data / value

writeBuffer

Type: System.ReadOnlyMemory.Byte.
The write data / value.

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.ResultReadWrite.
A task that represents the asynchronous 'ReadWrite' operation. The ResultReadWrite parameter contains the total number of bytes read into the buffer (ReadBytes) and the ErrorCode after execution.

Implements

IAdsHandle.ReadWriteAsync(UInt32, Memory.Byte., ReadOnlyMemory.Byte., CancellationToken)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Reference

AdsConnection Class

ReadWriteAsync Overload

TwinCAT.Ads Namespace