STRING_TO_BYTES
PROGRAM STRING_TO_BYTES_DEMO
VAR
L: dint:=4;
in_string: string := "AA@A";
bytes: bytearray;
in_string_ref : ref_to string;
END_VAR
in_string_ref := REF in_string;
bytes:=string_to_bytes(str:=in_string_ref,l:=L);
END_PROGRAM
The function converts a string to ASCII code values.
Input | Type | Description |
---|---|---|
STR | STRING_REF | Input character string reference |
L | DINT | Number of characters to convert |
Output | Type | Description |
---|---|---|
=> | BYTEARRAY | Array of ASCII values |