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.

Read from the logic machine
#2
Here's the documentation on serial library:
http://openrb.com/docs/serial.htm

Here's a small example that will send back everything that LM reads from RS232 (default serial settings are 115200 8N1):
Code:
-- open port on first call
if not port then
  require('serial')
  port = serial.open('/dev/RS232')
  port:flush()
end

-- port ready
if port then
  -- read one byte
  char = port:read(1, 1)
  -- send back if read succeeded
  if char then
    port:write(char)
  end
end
Reply


Messages In This Thread
Read from the logic machine - by Rodriguez - 16.03.2017, 13:47
RE: Read from the logic machine - by admin - 16.03.2017, 13:51
RE: Read from the logic machine - by admin - 16.03.2017, 14:11

Forum Jump: