AdsConnectionTryReadState(Int32, StateInfo) Method

Reads the ADS status and the device status from an ADS server. Unlike the ReadState method this method does not call an exception on failure. Instead an AdsErrorCode is returned. If the return value is equal to AdsErrorCode.NoError the call was successful.


Namespace: TwinCAT.Ads
Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470

Syntax

C#

public AdsErrorCode TryReadState(
    int timeout,
    out StateInfo stateInfo
)

Parameters

timeout  Int32

The timeout.

stateInfo  StateInfo

The ADS statue and device status.

Return Value

AdsErrorCode
AdsErrorCode of the ADS read state call. Check for AdsErrorCode.NoError to see if call was successful.

Implements

IAdsStateControlTimeoutTryReadState(Int32, StateInfo)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Reference

AdsConnection Class TryReadState Overload TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026