AdsConnectionTryRead(UInt32, MemoryByte, Int32) Method

Reads the value synchronously data of the symbol, that is represented by the variable handle into the readBuffer.


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

Syntax

C#

public AdsErrorCode TryRead(
    uint variableHandle,
    Memory<byte> readBuffer,
    out int readBytes
)

Parameters

variableHandle  UInt32

The variable handle.

readBuffer  MemoryByte

The read buffer/data

readBytes  Int32

Number of read bytes.

Return Value

AdsErrorCode
The ADS error code.

Implements

IAdsHandleTryRead(UInt32, MemoryByte, Int32)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Reference

AdsConnection Class TryRead Overload TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026