AdsClient.WriteAnyStringAsync Method (UInt32, 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(
    uint variableHandle,
    string value,
    int length,
    Encoding encoding,
    CancellationToken cancel
)

Parameters

variableHandle

Type: System.UInt32
The variable handle.

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>.

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