AdsClientTryWriteValue(ISymbol, Object) Method

Tries to write a (boxed) value to the symbol


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

Syntax

C#

public AdsErrorCode TryWriteValue(
    ISymbol symbol,
    Object? val
)

Parameters

symbol  ISymbol

The symbol the value is written to.

val  Object

The value.

Return Value

AdsErrorCode
AdsErrorCode.

Implements

IAdsSymbolicAccessTryWriteValue(ISymbol, Object)

Exceptions

Exception

Condition

ArgumentNullException

symbol

ArgumentNullException

val

ObjectDisposedException

ClientNotConnectedException

CannotResolveDataTypeException

Remarks

This method automatically marshals the value from .NET objects into the TwinCAT representation if possible. The overall behaviour is described here in the interface description.

Reference

AdsClient Class TryWriteValue Overload TwinCAT.Ads Namespace WriteValue(ISymbol, Object) WriteValueAsync(ISymbol, Object, CancellationToken)

Beckhoff Automation GmbH & Co. KG 2001-2026