AdsConnection.TryReadWrite Method (UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

Namespace:  TwinCAT.Ads
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 4.3.0.0

Syntax

C#

public AdsErrorCode TryReadWrite(
    uint indexGroup,
    uint indexOffset,
    byte[] readBuffer,
    int rdOffset,
    int rdLength,
    byte[] writeBuffer,
    int wrOffset,
    int wrLength,
    int timeout,
    out int readBytes
)

VB

Public Function TryReadWrite ( 
    indexGroup As UInteger,
    indexOffset As UInteger,
    readBuffer As Byte(),
    rdOffset As Integer,
    rdLength As Integer,
    writeBuffer As Byte(),
    wrOffset As Integer,
    wrLength As Integer,
    timeout As Integer,
    <OutAttribute> ByRef readBytes As Integer
) As AdsErrorCode

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.

readBuffer

Type: .System.Byte.
The read buffer.

rdOffset

Type: System.Int32
Offset of the data in rdDataStream.

rdLength

Type: System.Int32
Length of the data in rdDataStream.

writeBuffer

Type: .System.Byte.
The write buffer.

wrOffset

Type: System.Int32
Offset of the data in wrDataStream.

wrLength

Type: System.Int32
Length of the data in wrDataStream.

timeout

Type: System.Int32
The timeout.

readBytes

Type: System.Int32.
The read bytes.

Return Value

Type: AdsErrorCode
AdsErrorCode.

Reference

AdsConnection Class

TryReadWrite Overload

TwinCAT.Ads Namespace