BYTES_TO_STRING
PROGRAM BYTES_TO_STRING_DEMO
VAR
L:DINT:=4;
BYTE1 ARRAY[0..3] OF BYTE :=[65,64,65,55];
OUTPUT_STRING: STRING;
BYTES: BYTE_PTR;
END_VAR
BYTES:=ADR(BYTE[0]);
OUTPUT_STRING:=BYTES_TO_STRING(BYTES:=BYTES, L:=L);
END_PROGRAM
Function converts an array of numbers representing ASCII characters to an ASCII string.
Input | Type | Description |
---|---|---|
BYTES | BYTE_PTR | Pointer to the first byte where the ASCII-coded characters are stored. |
L | DINT | Number of bytes to be read - string length. |
Output | Type | Description |
---|---|---|
=> | STRING | Output string of ASCII characters. |