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.

luamodbus
#6
You need to access metatable to get function list:
Code:
function getmetafunctions(object)
  local mt = getmetatable(object)
  local res = {}

  if type(mt) == 'table' then
    for k, v in pairs(mt) do
      if type(v) == 'function' then
        res[ #res + 1 ] = k
      end
    end

    table.sort(res)
  end

  return res
end

obj = require('luamodbus').rtu()
fns = getmetafunctions(obj)
log(fns)

For CRC calculation see this post: https://forum.logicmachine.net/showthread.php?tid=808
Reply


Messages In This Thread
luamodbus - by Thomas - 10.04.2019, 13:47
RE: luamodbus - by admin - 10.04.2019, 14:03
RE: luamodbus - by Thomas - 10.04.2019, 14:42
RE: luamodbus - by admin - 10.04.2019, 14:51
RE: luamodbus - by Thomas - 10.04.2019, 15:10
RE: luamodbus - by admin - 11.04.2019, 06:27
RE: luamodbus - by Thomas - 11.04.2019, 07:57

Forum Jump: