diff -r d311880b9d15 -r a95b5ee1a0ea runtime/typemapping.py --- a/runtime/typemapping.py Tue Jun 20 15:05:21 2023 +0200 +++ b/runtime/typemapping.py Thu Jul 20 16:16:05 2023 +0200 @@ -43,7 +43,7 @@ "BYTE": _t(c_uint8), "STRING": (IEC_STRING, lambda x: x.body[:x.len], - lambda t, x: t(len(x), x)), + lambda t, x: t(len(x), x.encode() if type(x)==str else x)), "INT": _t(c_int16), "UINT": _t(c_uint16), "WORD": _t(c_uint16),