AdsConnection.Read Method (Int32, AdsStream, 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(
    int variableHandle,
    AdsStream dataStream,
    int offset,
    int length
)

VB

Public Function Read ( 
    variableHandle As Integer,
    dataStream As AdsStream,
    offset As Integer,
    length As Integer
) As Integer

Parameters

variableHandle

Type: System.Int32
Handle of the ADS variable

dataStream

Type: TwinCAT.Ads.AdsStream
Stream that receives the data.

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.

Implements

IAdsHandleAccess.Read(Int32, AdsStream, Int32, Int32)

Reference

AdsConnection Class

Read Overload

TwinCAT.Ads Namespace