IAdsSymbolicAccess.WriteValueAsync Method (ISymbol, Object, CancellationToken)

Writes a value to the symbol. Strings and all primitive data types(UInt32, Int32, Bool etc.) are supported. If a string is passed as parameter, the method attempts to parse the string according to the ADS data type of the symbol.

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

Syntax

C#

Task<ResultWrite> WriteValueAsync(
    ISymbol symbol,
    Object val,
    CancellationToken cancel
)

Parameters

symbol

Type: TwinCAT.TypeSystem.ISymbol
The symbol the value is written to.

val

Type: System.Object
The value to write.

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.ResultWrite.
A task that represents the asynchronous 'WriteSymbol' operation. The ResultWrite parameter contains the ErrorCode after execution.

Reference

IAdsSymbolicAccess Interface

WriteValueAsync Overload

TwinCAT.Ads Namespace

IAdsSymbolicAccess.WriteValue(ISymbol, Object)

IAdsSymbolicAccess.TryWriteValue(ISymbol, Object)