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
#7
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/gen...0_imx6.ipk
https://dl.openrb.com/lm-23-imx6/pkg/gen...0_imx6.sig
Reply


Messages In This Thread
RE: LM as BACNET CLient slow connection - by rw_echo - 28.03.2023, 05:00

Forum Jump: