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.

ESPA 4.4.4
#1
Hi

Im wondering if the LM5 supports ESPA 4.4.4 protocol, since it's a RS232/485 protocol.
https://en.bxo.se/ESPA+4+4+4.html

with some quick searches on the forum i can't seem to find any old posts with this question.
Reply
#2
Here's a short example script that can be used to poll slave nr 2. It does not send ack/nack and does not parse the message but can be used a starting point to check the communication. Change serial port name and parameters as needed.
Code:
EOT = string.char(4)
ENQ = string.char(5)

function poll(addr)
  port:flush()
  port:write(addr .. ENQ)

  local buf = {}

  while true do
    local ch, err = port:read(1, 1)

    if ch then
      if ch == EOT then
        break
      else
        buf[ #buf + 1 ] = ch
      end
    else
      return nil, err
    end
  end

  return table.concat(buf)
end

port = require('serial').open('/dev/RS232', { baudrate = 9600 })
res, err = poll(2)

loghex(res, err)
Reply


Forum Jump: