Logic Machine Forum
Bacnet Client port Change - 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: Bacnet Client port Change (/showthread.php?tid=6046)



Bacnet Client port Change - savaskorkmaz - 07.07.2025

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)


RE: Bacnet Client port Change - Daniel - 07.07.2025

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)



RE: Bacnet Client port Change - savaskorkmaz - 07.07.2025

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.


RE: Bacnet Client port Change - Daniel - 07.07.2025

What is your script?


RE: Bacnet Client port Change - savaskorkmaz - 07.07.2025

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


RE: Bacnet Client port Change - Erwin van der Zwart - 08.07.2025

You are changing the port number into a string, use bacnet.port = 0xBAC2 or bacnet.port = 47810


RE: Bacnet Client port Change - admin - 08.07.2025

Check the second returned value:
Code:
alarm, err = bacnet.readvalue(500, 'binary input', 600)
log(alarm, err)