TcAdsClient.ReadWrite Method (Int32, AdsStream, Int32, Int32, AdsStream, 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(
    int variableHandle,
    AdsStream rdDataStream,
    int rdOffset,
    int rdLength,
    AdsStream wrDataStream,
    int wrOffset,
    int wrLength
)

VB

Public Function ReadWrite ( 
    variableHandle As Integer,
    rdDataStream As AdsStream,
    rdOffset As Integer,
    rdLength As Integer,
    wrDataStream As AdsStream,
    wrOffset As Integer,
    wrLength As Integer
) As Integer

Parameters

variableHandle

Type: System.Int32
Variable handle.

rdDataStream

Type: TwinCAT.Ads.AdsStream
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: TwinCAT.Ads.AdsStream
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.

Implements

IAdsHandleAccess.ReadWrite(Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32)

Exceptions

Exception

Condition

AdsErrorException

Thrown when the ADS call fails.

Reference

TcAdsClient Class

ReadWrite Overload

TwinCAT.Ads Namespace