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.

Bacnet Client port Change
#1
Hi we are using bacnet package not bacnet app for bacnet client function.

We need to change bacnet port from 47808 to 47810. There is a bacnet device in 47810 we found via another bacnetscan app. Can you check the script below for scan device. Also can you share bacnet read command for different port please ?

require('bacnet')
bacnet.port = '0xBAC2'

require('bacnet')
devices = bacnet.scandevices()
log(devices)
Reply
#2
Scanning will not work with different port but you can use different port for reading and writing.  Use YABE for scanning.
Example for reading. 
Code:
require('bacnet')
bacnet.port = '0xBAC2'
-- read from 192.168.0.21, device id 21
bacnet.deviceip = '192.168.0.21'
val1 = bacnet.readvalue(21, 'binary value', 2049)
val2 = bacnet.readvalue(21, 'binary value', 2050)
val3 = bacnet.readvalue(21, 'binary value', 2051)
log(val1, val2, val3)
------------------------------
Ctrl+F5
Reply
#3
Hi Daniel,
There are 2 bacnet points. one is bacnet value other is binary input. We read binary value but we can't read binary input. Here is the detailed pictures of the points which are taken from yabe.

Attached Files Thumbnail(s)
           
Reply
#4
What is your script?
------------------------------
Ctrl+F5
Reply
#5
Here is the script and logs :
require('bacnet')
bacnet.port = '0xBAC2'
bacnet.deviceip = '172.22.22.226'

alarm = bacnet.readvalue(500, 'binary input', 600)
point = bacnet.readvalue(500, 'binary value', 0)

log(alarm , point)

log :

* arg: 1
* nil
* arg: 2
* bool: false
Reply
#6
You are changing the port number into a string, use bacnet.port = 0xBAC2 or bacnet.port = 47810
Reply
#7
Check the second returned value:
Code:
alarm, err = bacnet.readvalue(500, 'binary input', 600)
log(alarm, err)
Reply


Forum Jump: