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.

LM as BACNET CLient slow connection
#6
Reading object by object won't help much I think. There is option to read whole device at once and then you will need to extract each objects from the list.  Make sure that all is a single resident script.

Read whole device like this:
Code:
require('bacnet')
device, objects = bacnet.scandevice(ID)
To read single present value form this objects list do this:
Code:
function findobject(objects, objtype, objid)
   for _, object in ipairs(objects) do
     if object.identifier == objid and object.type == objtype then
       return object
     end
   end
end

object = findobject(objects, 'analog value', Object-ID)
log(tonumber(object["present-value"]))
Test this and see if it works better.
------------------------------
Ctrl+F5
Reply


Messages In This Thread
RE: LM as BACNET CLient slow connection - by Daniel - 16.07.2021, 16:07

Forum Jump: