AdsConnection.TryWrite Method (UInt32, UInt32, ReadOnlyMemory.Byte.)

Writes data synchronously to an ADS device.

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

Syntax

C#

public AdsErrorCode TryWrite(
    uint indexGroup,
    uint indexOffset,
    ReadOnlyMemory<byte> writeBuffer
)

Parameters

indexGroup

Type: System.UInt32
Contains the index group number of the requested ADS service.

indexOffset

Type: System.UInt32
Contains the index offset number of the requested ADS service.

writeBuffer

Type: System.ReadOnlyMemory.Byte.
The data buffer to be written.

Return Value

Type: AdsErrorCode
The ADS error code.

Implements

IAdsReadWrite.TryWrite(UInt32, UInt32, ReadOnlyMemory.Byte.)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Reference

AdsConnection Class

TryWrite Overload

TwinCAT.Ads Namespace