AdsClient.WriteAnyStringAsync Method (String, String, Int32, Encoding, CancellationToken)

Writes the string (Potentially unsafe!)

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

Syntax

C#

public Task<ResultWrite> WriteAnyStringAsync(
    string symbolPath,
    string value,
    int length,
    Encoding encoding,
    CancellationToken cancel
)

Parameters

symbolPath

Type: System.String
The symbol path.

value

Type: System.String
The value.

length

Type: System.Int32
The length of the string to write

encoding

Type: System.Text.Encoding
The encoding.

cancel

Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: Task.ResultWrite.
Task<ResultWrite>.

Exceptions

Exception

Condition

ObjectDisposedException

ClientNotConnectedException

Remarks

ATTENTION: Potentially this method is unsafe because following data can be overwritten after the string symbol. Please be sure to specify the string length lower than the string size reserved within the process image! The String is written with the specified encoding.

Reference

AdsClient Class

WriteAnyStringAsync Overload

TwinCAT.Ads Namespace