22.09.2021, 12:52
Try this, the status type is not described so it's assumed to be a hexadecimal number which converted from a string via tonumber(). 24 characters are read: 23 data characters + CR.
Code:
port:write('?01\r')
resp = port:read(24, 1)
if resp and #resp == 24 then
data = resp:sub(12, 13)
data = tonumber(data, 16)
grp.update('32/1/1', data)
end