使用函数 MAXSTRING_TO_BYTEARR
VAR
byte_ascii: ARRAY[0..max_string_length] OF byte;
END_VAR
byte_ascii:=maxstring_to_bytearr('abcdefghABCDEFGH');
函数说明见链接:
https://infosys.beckhoff.com/content/1033/tcplclib_tc2_utilities/9007199289886219.html?id=7092413706083685849