STRING_TO_BYTES

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.

InputType Description
STR STRING_REFInput character string reference
L DINT Number of characters to convert
OutputType Description
BYTEARRAYArray of ASCII values

  • © Energocentrum Plus, s.r.o. 2017 - 2024