BACnet
Connect BACnet/IP building-automation devices - device instance, object type and instance addressing, Who-Is discovery and presentValue.
The BACnet driver talks to building-automation equipment over BACnet/IP. Every tag reads one BACnet object's present value: the live reading of an analog input, the state of a binary output, the position of a multi-state value. Add a device under the BACnet driver in the Connector; the panel shows only the fields this protocol uses.
Connection
| Field | Meaning | Default |
|---|---|---|
| Host | IP address or host name of the BACnet device (or of the router answering for it). A name is resolved to its IPv4 address when the device connects; a name this computer cannot resolve leaves the device not connected, and the reason says so. | empty |
| Port | UDP port of the device, 1 to 65535. An empty box shows 47808, the BACnet/IP standard, in grey and the device is reached on it, which is also how a device saved with 0 reads. | 47808 |
| Device Id | The device's instance number: the number of its Device object, unique on the BACnet network. | 0 |
The device header shows the assembled endpoint, for example
bacnet://192.168.0.30:47808/1234. Connecting sends one request for the size
of the device's object list to confirm the equipment answers; the object list
itself is not walked. That answer is the connection: a device that does not reply
stays offline instead of showing as connected, and the reason (the UDP port
already taken, an address that is not an address) is written to the Events page
and the day's log file. There are no poll-interval fields for this driver: its
tags are read once per second.
Addressing
A BACnet tag is addressed by two typed fields in the tag's Source card, with no free-text address:
| Field | Meaning | Accepted values | Default |
|---|---|---|---|
| Object type | Which kind of BACnet object to read. | the nine types below | AnalogInput |
| Instance | The object's instance number within its type. | 0 and up | 0 |
The offered object types and their standard BACnet type codes:
| Object type | Code | Present value holds |
|---|---|---|
AnalogInput |
0 | a measured number |
AnalogOutput |
1 | a commanded number |
AnalogValue |
2 | a stored number |
BinaryInput |
3 | inactive/active |
BinaryOutput |
4 | inactive/active |
BinaryValue |
5 | inactive/active |
MultiStateInput |
13 | a state number from 1 up |
MultiStateOutput |
14 | a state number from 1 up |
MultiStateValue |
19 | a state number from 1 up |
AnalogInput 5 on device 1234 means "the present value of analog input 5 of
that device". Every read asks for the object's presentValue property; other
properties are not addressable. The Source card's read-only Source address
(wire) line shows the assembled type,instance pair as you edit.
Data types
The Data type picker offers four types. Pick the one matching the object:
| Data type | Fits | Notes |
|---|---|---|
| Float | analog objects | a Real present value; doubles are narrowed to Float |
| Boolean | binary objects | a Boolean present value, or the enumerated 0 and 1 a binary object answers with |
| Int32 | multi-state and other integer values | signed, unsigned and enumerated answers all arrive here |
| String | character-string values | text as the device sends it |
The picked type has to match what the object holds. A device that answers with something else fails that tag's read: the tag goes to bad quality and the reason names what arrived ("The device answered a Single value for a point declared Integer."), instead of a converted number entering the trend, the history and the alarms. Reading an analog object as Boolean, or a Real as Int32, is exactly that case. The rest of the device keeps reading; nothing is reconnected over a tag whose type is wrong.
A tag whose object the device does not have fails its read with the device's
own answer: the reason says the device has no object at that address and names
the error it sent (ERROR_CODE_UNKNOWN_OBJECT), so a wrong address reads
differently from a device that stopped answering. The device stays connected.
Writes
Tags whose Access is Read and write or Write only can be written. A write
sets the object's presentValue in the datatype the BACnet standard gives that
kind of object, whatever the tag's data type:
| Object | Written as | Takes |
|---|---|---|
| Binary input, output or value | Enumerated | inactive (0) or active (1), from a Boolean tag or an Int32 of 0 or 1 |
| Multi-state input, output or value | Unsigned | a state number from 1 up |
| Analog input, output or value | Real | a number from a Float or Int32 tag |
| Any other object type | the tag's data type | Float a Real, Boolean a Boolean, Int32 a signed integer, String a character string |
No command priority is sent with the write. A value the object cannot hold, such as 0 for a multi-state object or 2 for a binary one, is refused before anything is sent, and the refusal says why. When the device answers the write with an error, the tag reports the error class and code the device sent instead of faking success, and the device stays connected. A new tag starts as Read only.
Discovery
The Connector's Discover button broadcasts a BACnet Who-Is and listens for I-Am answers for 10 seconds. Every device that answers becomes a candidate carrying its address, port and device instance, ready to add with the connection fields filled in, and it appears in the list the moment it answers rather than at the end of the ten seconds: a scan you cancel halfway keeps everything that had already replied. The scan does not browse objects, so candidates arrive with zero tags; add the object type and instance pairs yourself.
The Who-Is goes out on the network the Scan scope card names. Its box takes an
IPv4 address on that network, a device's or this computer's own address there (for
example 192.168.1.20), and the scan then broadcasts on that network only. Left
empty, the Who-Is goes out on every network of this computer, so a computer with two
network cards, a VPN or Docker finds the devices on each of them. Anything that is
not an IPv4 address written out in full is refused under the box, and Discover stays
greyed until it is corrected.
A device that answers through a BACnet router is added the same way. Its candidate carries the router's address and, alongside it, the device's own network and address on that network; both are kept when you add it, and every read is sent to the router naming the device inside. A device found this way therefore reads like any other, and its endpoint reads "device via router". A device added by hand has no route and is reached directly at its host.
Good to know
- BACnet/IP only: MS/TP or BACnet/SC equipment is reachable only through a router that presents it on BACnet/IP, and the scan is what finds it: the route a device answers on is kept from the scan, so add it from the discovered list rather than typing its fields by hand.
- On a computer with several network interfaces (two network cards, a VPN, Docker), each device is reached through the interface this computer routes its address to, the same one any other program here would use; there is nothing to choose.
- Only the socket that listens for the devices' messages sits on the standard BACnet UDP port 47808 of this station, so another BACnet application holding that port exclusively on the same computer can conflict with it. Requests to a device leave from a port the system picks for each client.
- Polling is fixed at one second for every tag on this driver; the usual poll interval fields are not shown.