ns=2;s=DEPRAG Smart/Utilities/ByteArrayOperations/GetString
Converts a byte array to the appropriate string representation using the specified character encoding.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bGetString : BOOL;
OutputDataGetString : ST_StringOutputData;
hrGetString : HRESULT;
fbByteArrayOperations : FB_ByteArrayOperations;
END_VAR
VAR_IN_OUT
ByteArrayToConvert : ARRAY[*] OF BYTE;
END_VAR
hrGetString := fbByteArrayOperations.GetString(
bExecute := bGetString,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
ByteArrayToConvert := testArray,
nNumberOfBytesToConvert := 10,
Encoding := Encoding.Utf8,
OutputData => OutputDataGetString);
IF hrGetString <> S_FALSE THEN
bGetString := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".