AdsConnection.DeleteVariableHandleAsync Method

Releases the handle of a ADS variable again (asynchronously)

Namespace:  TwinCAT.Ads
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 6.0.328+39e3229

Syntax

C#

public Task<ResultAds> DeleteVariableHandleAsync(
    uint variableHandle,
    CancellationToken cancel
)

Parameters

variableHandle

Type: System.UInt32
Handle of the ADS variable

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.ResultAds.
A task that represents the asynchronous 'ReadState' operation. The ResultAds parameter contains the ErrorCode of the ADS communication after execution.

Implements

IAdsHandle.DeleteVariableHandleAsync(UInt32, CancellationToken)

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Remarks

It is a good practice to release all variable handles after use to regain internal resources in the TwinCAT subsystem. The composite method to this DeleteVariableHandleAsync(UInt32, CancellationToken) is the CreateVariableHandleAsync(String, CancellationToken)

Reference

AdsConnection Class

TwinCAT.Ads Namespace

AdsConnection.CreateVariableHandleAsync(String, CancellationToken)

AdsConnection.TryDeleteVariableHandle(UInt32)

AdsConnection.DeleteVariableHandle(UInt32)