TcAdsClient.ReadWrite Method (UInt32, UInt32, .Byte., Int32, Int32, .Byte., 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 int ReadWrite(
    uint indexGroup,
    uint indexOffset,
    byte[] rdDataStream,
    int rdOffset,
    int rdLength,
    byte[] wrDataStream,
    int wrOffset,
    int wrLength
)

VB

Public Function ReadWrite ( 
    indexGroup As UInteger,
    indexOffset As UInteger,
    rdDataStream As Byte(),
    rdOffset As Integer,
    rdLength As Integer,
    wrDataStream As Byte(),
    wrOffset As Integer,
    wrLength As Integer
) As Integer

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.

rdDataStream

Type: .System.Byte.
Stream that receives the data that has been read.

rdOffset

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

rdLength

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

wrDataStream

Type: .System.Byte.
Stream that contains the data that should be written.

wrOffset

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

wrLength

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

Return Value

Type: Int32
Number of successfully returned data bytes.

Exceptions

Exception

Condition

AdsErrorException

Thrown when the ADS call fails.

Reference

TcAdsClient Class

ReadWrite Overload

TwinCAT.Ads Namespace