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

Reads data synchronously from an ADS device and writes it to the given stream.

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

Syntax

C#

public int Read(
    uint indexGroup,
    uint indexOffset,
    byte[] readBuffer,
    int offset,
    int length
)

VB

Public Function Read ( 
    indexGroup As UInteger,
    indexOffset As UInteger,
    readBuffer As Byte(),
    offset As Integer,
    length 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.

readBuffer

Type: .System.Byte.
The read buffer.

offset

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

length

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

Return Value

Type: Int32
Number of successfully returned data bytes.

Exceptions

Exception

Condition

ObjectDisposedException

Reference

AdsConnection Class

Read Overload

TwinCAT.Ads Namespace