TcAdsClient.WriteSymbol Method (ITcAdsSymbol, Object)

Writes a value to the symbol. Strings and all primitive data types(UInt32, Int32, Bool etc.) are supported. Array and structures are not 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 (in TwinCAT.Ads.dll) Version: 4.3.0.0

Syntax

C#

public void WriteSymbol(
    ITcAdsSymbol symbol,
    Object val
)

VB

Public Sub WriteSymbol ( 
    symbol As ITcAdsSymbol,
    val As Object
)

Parameters

symbol

Type: TwinCAT.Ads.ITcAdsSymbol
The symbol the value is written to.

val

Type: System.Object
The value to write.

Exceptions

Exception

Condition

AdsDatatypeNotSupportedException

Thrown when a ADS data type is not supported.

AdsErrorException

Thrown when the ADS call fails.

Reference

TcAdsClient Class

WriteSymbol Overload

TwinCAT.Ads Namespace