BACnet/IP
BACnet (Building Automation and Control Networks) is a data communication protocol for
building automation and control - HVAC, lighting, access control and similar building
services. BACnet/IP carries BACnet traffic over UDP/IP, typically on the well-known port
47808.
The Go driver is the complete implementation: it reads and writes object properties, discovers devices on the network, and subscribes to change-of-value (COV) notifications. The Java driver is a passive listener: it joins the network and reports the COV notifications it observes, but has no working tag address syntax, so a subscription cannot be narrowed to a single object - every registered consumer receives all COV notifications seen on the network and has to filter them itself.
Supported Operations
| Name | Value | Description |
|---|---|---|
|
Go only. Reads one or more object properties via a tag address. |
|
|
Go only. Writes one or more object properties, optionally at a given priority. |
|
|
Go and Java. Go subscribes to COV notifications for an object; Java receives all COV traffic broadcast on the network and cannot narrow it to a single object, since it has no working tag address syntax. |
Neither driver supports browse. The Go driver does support device discovery
(WhoIs/IAm, Discoverer.go) - a separate PLC4X operation, reached through the
discovery API rather than a browse request, that finds devices on the network rather
than enumerating objects on one.
Connection String
BACnet/IP has the following connection string format:
bacnet-ip:{transport}://{ip-address}:{port}?{options}
The only supported transport is udp:
bacnet-ip:udp://192.168.178.101:47808
Connection String Options
Name |
Type |
Default Value |
Required |
Description |
Name |
BACnet/IP |
|||
Code |
|
|||
Maven Dependency |
<dependency> <groupId>org.apache.plc4x</groupId> <artifactId>plc4j-driver-bacnet</artifactId> <version>1.1.0</version> </dependency> |
|||
Default Transport |
|
|||
Supported Transports |
|
|||
Config options: |
||||
|
FILE |
Path to the location of a single EDE file, that contains the descriptor for the target device. |
||
|
FILE |
Path to the directory used for storing multiple EDE files. These files contain the descriptors for the possible target devices. |
||
Transport config options: |
||||
udp |
||||
|
STRING |
Local address to bind to. If not set, binds to all interfaces. |
||
|
INT |
0 |
Local port to bind to. 0 uses ephemeral port. |
|
|
INT |
0 |
Socket read timeout in milliseconds. 0 means no timeout. |
|
|
INT |
65507 |
Maximum UDP packet size in bytes. |
|
|
INT |
0 |
Send buffer size in bytes. 0 uses system default. |
|
|
INT |
0 |
Receive buffer size in bytes. 0 uses system default. |
|
|
BOOLEAN |
false |
Enable SO_BROADCAST for sending broadcast packets. |
|
|
BOOLEAN |
false |
Enable SO_REUSEADDR to allow multiple bindings to the same address/port. |
|
|
BOOLEAN |
false |
Share the underlying UDP socket across multiple transport instances. When true, instances with the same localAddress:localPort will share a socket. This is useful for protocols where multiple logical connections share one UDP port. |
|
|
INT |
1 |
Time-to-live for multicast packets (1-255). |
|
Tag Addresses
Addressing is implemented in Go only. The Java driver receives broadcast traffic as subscriptions and has no working tag address syntax. See the protocol support matrix for what each implementation does.
General Format
<objectType>,<objectInstance>/<propertyIdentifier>[<arrayIndex>]{<writePriority>}[&<propertyIdentifier>[<arrayIndex>]{<writePriority>}]*
objectType-
A BACnet object type, either by name (
ANALOG_INPUT,ANALOG_VALUE,ANALOG_OUTPUT, …) or as a numeric proprietary type identifier. objectInstance-
The object’s numeric instance number.
propertyIdentifier-
One or more property identifiers, joined by
&, each by name (PRESENT_VALUE,OBJECT_NAME,DESCRIPTION,UNITS,PRIORITY_ARRAY, …) or as a numeric proprietary property identifier. [arrayIndex]-
Optional. Selects a single element of an array-valued property. This is not the unified array notation - it addresses one scalar element of a BACnet array property, not a run of consecutive values.
{writePriority}-
Optional, write only. The BACnet priority (1-16) at which the write is issued.
Data Types
BACnet tags carry no :{data-type} suffix. The value’s type is determined from the
object and property being read or written, not selected on the address.
Examples
| Address | Meaning |
|---|---|
|
present value of analog input |
|
proprietary property |
|
element |
|
write the present value of analog output |
|
write element |
|
present value, object name and units of analog input |
|
element |