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.

eibdgm - description and tips
#1
Could you explain eibdgm? How to use it?

Based on codes from forum I've prepared such simple script:

Code:
if not client then
 require('genohm-scada.eibdgm')

 objects = grp.all()
 datatypes = {}

 for _, object in ipairs(objects) do
   datatypes[ object.id ] = object.datatype
 end

 function writehandler(event)
   local dpt, dst = datatypes[ event.dstraw ], event.dst
   if dpt then
     local value = knxdatatype.decode(event.datahex, dpt)
     log(dst, value)
   end
 end
    
 client = eibdgm:new({ timeout = 0.5 })
 client:sethandler('groupwrite', writehandler)
end

-- handle knx
client:step()


So every time when resident script is running clientConfusedtep() is executed.

1) But should I set some os.sleep() between next clientConfusedtep()?
2) How client works internally? Does it has some table with telegrams which appeared but that aren't handled and when they are handled then they are dropped from that table? 3) Could I declare 1 handler to a few events by typing 'groupwrite groupread' etc.?
4) Could I check telegrams not so often like 1s or less but e.g. 1 minute?

PS. This post is also for creating some documentation for forum users, because unfortunately currently there is no such doc.

When I've logged:

Code:
log(client)


Then the result is:

Code:
* table:
[sendpacket]
 * function: 0xb73bd4d8
[sock]
 * udp{unconnected}: 0xb73bd4b8
[handlers]
 * table:
  [1]
   * function: 0xb75e3638


So e.g. I am not see I don't see method clientConfusedtep().

Also I see that when I've set Resident interval to 5s and eibdgm timeout to 5 seconds then telegrams appeared more sooner in Objects than by handler with eibdgm (more sooner than 5 seconds, e.g. 30s).

Is there a possibility that eibdgm could not log all telegrams but only e.g. 1 from 3 which appeared on bus? What is optimum configuration. I know that minimum duration of 1 telegram on TP is 0.05s so how eibdgm works on timeout 0.5s?
Done is better than perfect
Reply


Messages In This Thread
eibdgm - description and tips - by buuuudzik - 15.09.2018, 06:52

Forum Jump: