====== STRING_TO_BYTES ====== {{:en:mervis-ide:35-help:string_to_bytes.png}} ===== Function name ===== STRING_TO_BYTES ===== ST call ===== 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 ===== Description ===== The function converts a string to ASCII code values. ===== Inputs ===== |Input|Type |Description | |STR |STRING_REF|Input character string reference| |L |DINT |Number of characters to convert | ===== Outputs ===== |Output|Type |Description | |=> |BYTEARRAY|Array of ASCII values| ===== Application example ===== {{:en:mervis-ide:35-help:string_to_bytes_example.png}}