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.

Log
#1
Hi,

Is it possible to log every event to a MS SQL -db? If not, to a mySQL db? 
Is there a sample code for this, I can't find anything ?

BR,
Alexander
Reply
#2
https://forum.logicmachine.net/showthrea...798#pid798
------------------------------
Ctrl+F5
Reply
#3
Okey, mysql can work, good : But MSSQL ?
But to get all write-to-bus-message we need a handle-func?

I have test with:

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)
    log('FUNC:' .. event)

    local dpt = datatypes[ event.dstraw ]
    if dpt then
      local value = knxdatatype.decode(event.datahex, dpt)
    end
  end

  function readhandler(event)
    log('FUNC:' .. event)
  end

  client = eibdgm:new({ timeout = 1 })
  clientConfusedethandler('groupwrite', writehandler)
  clientConfusedethandler('groupresponse', writehandler)
clientConfusedethandler('groupread', readhandler)
end

-- handle knx
clientConfusedtep()

But it will not work ..

When I, from ETS, use write to, my handler cant feel it..
Reply
#4
Native MSSQL is not supported. You can use Web Services API in SQL Server to implement data exchange.

For group monitoring you need a resident script with sleep time set to 0. log('FUNC:' .. event) is incorrect, use log('FUNC', event)
Reply


Forum Jump: