This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

RS232 - DAYTON AMP
#5
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
Reply


Messages In This Thread
RS232 - DAYTON AMP - by fahd-bnh - 15.09.2021, 13:28
RE: RS232 - DAYTON AMP - by admin - 16.09.2021, 07:33
RE: RS232 - DAYTON AMP - by fahd-bnh - 16.09.2021, 08:05
RE: RS232 - DAYTON AMP - by fahd-bnh - 22.09.2021, 08:01
RE: RS232 - DAYTON AMP - by admin - 22.09.2021, 12:52

Forum Jump: