Logic Machine Forum
LM as BACNET CLient slow connection - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: LM as BACNET CLient slow connection (/showthread.php?tid=3476)



LM as BACNET CLient slow connection - andrepneves@gmail.com - 16.07.2021

Hi!

We're having trouble with the Bacnet Client APP. We have 5 Fancoil controllers communicating via Bacnet. The mapping of the variables was rather slow but we get all of them to work.

But now the variables take too long to update the values (our customer says 20 minutes) and its impossible to control the fancoils this way. Is there some configuration that we're missing? Is it possible to confirm the COV funcionality?

Any ideia towards some solution will be appreciated.

The LM's firmware is Version: 20200116.


BR,
André Neves


RE: LM as BACNET CLient slow connection - Daniel - 16.07.2021

The bacnet client was designed for very small integrations. No there is no COV only pooling. I assume you do it via the app. First recommendation would be to limit the amount of objects to absolute minimum. If this won't help then probably control via script would be better here.


RE: LM as BACNET CLient slow connection - andrepneves@gmail.com - 16.07.2021

Daniel, thanks for the quick reply.

We have 105 objects in total (21 for each fancoil). is it too much for the app?

What is the pooling rate? is it possible to change the rate?

Can you point me to an example how to do this via script? It would be great if I could keep the mapping already done.

Thnak you.


RE: LM as BACNET CLient slow connection - Daniel - 16.07.2021

I would say you should not go over 50, No we can't modify the pooling of the app.
https://openrb.com/logicmachine-as-bacnet-client/


RE: LM as BACNET CLient slow connection - andrepneves@gmail.com - 16.07.2021

(16.07.2021, 14:15)Daniel. Wrote: I would say you should not go over 50, No we can't modify the pooling of the app.
https://openrb.com/logicmachine-as-bacnet-client/
OK...

Can you tell me the pooling rate?

If I change to the bacnet "via tab" will be able to have a good performance for the 100+ points?

Can I schedule the poolings so it doesn't strain too much the bus?

Thanks.


RE: LM as BACNET CLient slow connection - Daniel - 16.07.2021

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.


RE: LM as BACNET CLient slow connection - rw_echo - 28.03.2023

Function: There was an error in the data type conversion processing for bacnet objects' binary value ',' binary output ', and' binary input 'by tonumber (object ["present value"]).
Take the object 'binary value' as an example: its object ["present value"] is "active" or "inactive", but the value obtained by tonumber (object ["present value"]) is "nil"

1.My script is as follows:
require('bacnet')
device, objects = bacnet.scandevice(3536)
--log(device, objects)
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, 'binary value', 4104)

read_value1, read_value2 = object["present-value"], tonumber(object["present-value"])

log(object,read_value1, read_value2)

2.log:
Event for Bacnet read test (33/0/8) 28.03.2023 12:54:28
* arg: 1
* table:
["present-value"]
* string: inactive
["id"]
* number: 12
["description"]
* string: .................. #395 (2/0/8)
["priority-array"]
* string: Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,0
["overridden"]
* bool: false
["identifier"]
* number: 4104
["in-alarm"]
* bool: false
["type"]
* string: binary value
["name"]
* string: .................. #395 (2.0.8)
["fault"]
* bool: false
["out-of-service"]
* bool: false
* arg: 2
* string: inactive
* arg: 3
* nil
-------------------------------------------
attach:I am not sure if it is related to my installation of the following package.
https://dl.openrb.com/lm-23-imx6/pkg/genohm-scada-bacnet_20230120_imx6.ipk
https://dl.openrb.com/lm-23-imx6/pkg/genohm-scada-bacnet_20230120_imx6.sig


RE: LM as BACNET CLient slow connection - admin - 28.03.2023

Use this conversion function instead of tonumber:
Code:
function tovalue(val)
  if type(val) ~= 'string' then
    return nil
  elseif val == 'active' then
    return true
  elseif val == 'inactive' then
    return false
  else
    return tonumber(val) or val
  end
end