AdsClientTryReadState 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(
    out StateInfo stateInfo
)

Parameters

stateInfo  StateInfo

The ADS statue and device status.

Return Value

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

Implements

IAdsStateProviderTryReadState(StateInfo)
ITcAdsRawTryReadState(StateInfo)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Remarks

Not all ADS Servers support the State ADS Request

Reference

AdsClient Class TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026