IAdsStateControlTimeout.TryReadState 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.Abstractions (in TwinCAT.Ads.Abstractions.dll) Version: 6.0.328+39e3229

Syntax

C#

AdsErrorCode TryReadState(
    int timeout,
    out StateInfo stateInfo
)

Parameters

timeout

Type: System.Int32
The timeout.

stateInfo

Type: TwinCAT.Ads.StateInfo.
The ADS statue and device status.

Return Value

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

Reference

IAdsStateControlTimeout Interface

TwinCAT.Ads Namespace