BACnet(Building Automation and Control networks)

Hemantkumar
7 min readJan 3, 2021

--

What is BACnet?

BACnet is “a data communication protocol for building automation and control networks.” A data communication protocol is a set of rules governing the exchange of data over a computer network that covers everything from what kind of cable to use to how to form a particular request or command in a standard way. What makes BACnet special is that the rules relate specifically to the needs of building automation and control (BAC) equipment, i.e., they cover things like how to ask for the value of a temperature, define a fan operating schedule, or send a pump status alarm.

BACnet was developed by a committee formed by the American Society of Heating, Refrigerating and Air-Conditioning Engineers (ASHRAE). The committee’s main objective was to create a protocol that would allow building systems from different manufacturers to interoperate, that is to work together in a harmonious way. Prior to the advent of BACnet there was simply no practical way to achieve this goal.

To achieve interoperability across a wide spectrum of equipment, the BACnet specification consists of three major parts. The first part describes a method for representing any type of building automation equipment in a standard way. The second part defines messages that can be sent across a computer network to monitor and control such equipment. And the third part defines a set of acceptable LANs that can be used to convey BACnet communications. Let’s look at each of these components of the BACnet spec in a bit more detail

BACnet Physical Layer

BACnet upper layers do not depend on physical layer. BACnet Physical layer makes it possible for BACnet to be implemented on different networks. BACnet physical layers have been specified for following:
• ARCNET
• Ethernet
• IP tunnels
• BACnet/IP
• RS-232
• RS485
Lonworks/LonTalk

RS232 is for point to point communication. RS485 supports upto 32 nodes with distance of 1200 m at 76Kbps.

BACnet Protocol Link Layer

BACnet can be implemented directly using LonTalk / IEEE802.2 link layers. It specifies PTP (Point To Point) data link layer for RS232 connections. It specifies MS/TP data link layer for RS-485 connections.

The standard specifies BVLL ( BACnet Virtual Link Layer) which mentions all the services (e.g. broadcast) needed by BACnet device at this link layer.

IP BVLL encapsulates needed control information in a header of BACnet virtual link control information. Due to IP BVLL BACnet devices can communicate directly over IP networks without the need of any router device.

BACnet uses BBMD concept which implements the needed broadcast requirements of the desired link layer. BBMD stands for BACnet broadcast management device. As per this, BACnet broadcast message is converted to IP based multicast/broadcast messages.

BACnet Network Layer

The BACnet network layer specifies the network addresses needed for routing. BACnet network composed of one or more segments. These BACnet segments are connected using bridges when they use same LAN technologies. If they use different LAN protocols they are connected/interfaced using routers.

BACnet Application Layer

BACnet does not segregate presentation and application layers. It takes care of reliability and segmentation/sequencing mechanisms usually associated with transport and session layers.

BACnet features devices as objects which exchange service primitives. These service primitives are described using ASN.1 syntax and are serialized using ASN.1 BER.

BACnet Security Layer

Let us understand the BACnet security concept. BACnet device-A can request a session key from key server in order to establish secure communication with device-B. This key is delivered to device-A and device-B by key server. The key is referred as ‘SKab’. BACnet protocol uses 56-bit DES encryption.

The device-A and device-B authenticate each other by way of exchanging challenges (i.e. random number encryption with session key). The challenge message includes identifier (i.e. InvokeID). This is used for all the future transactions which are to be authenticated.

General BACnet Background

BACnet devices are defined on the network as a collection of “objects”. Typical objects include Analog Inputs, Analog Outputs, Binary Inputs, Binary Outputs, and more complex objects such as Scheduler. Messages on the network deal with reading and writing Object Properties. The most frequently referenced property for an analog input is “present value”, which typically means data derived from a sensor or physical device. Other properties associated with an analog input object, for example, include fault status, reliability, object name, minimum and maximum limits, etc. BACnet protocol standards define required and optional properties for each object type. The manufacturer’s documentation for the BACnet device will list which object types are included in the device, along with which optional properties are included in each object.

Along with the definition of objects, BACnet protocol defines “services”. These include object access services, alarm and event services, file access services, and a few more. Object access services are the most commonly used since these provide the fundamental “read/write” access to object properties.

Accessing object properties requires specifying these parameters:
— device instance (i.e., which device on the network)
— object type (analog input, binary intput, etc.)
— object instance (i.e., which analog input)
— property (present value, object name, status flags, etc.)

Input objects are simple, they just have a “present value” associated with them. Output objects are known as “commandable” and these get a bit more interesting. Because there is the possibility that more than one control algorithm might want control over an object, the command requests are prioritized and only the highest priority command will take effect. When the higher priority command is relinquished, the next lower command will take effect. All of the commands are maintained by the object in its command priority array (containing 16 priority levels).

Writing to an output object requires specifying all of the parameters shown above for accessing object properties, plus two additional parameters:
— command priority
— command level for given priority

The present value obtained when a commandable object is read will be the command level having the highest level that has not been relinquished. To pass command to some other process, you simply write a “relinquish” to the commandable object.

BACnet Physical Layer

The protocol defines rules for electrical signaling, addressing, network access, error checking, flow control, presentation, and message format. The protocol focuses on building automation applications.

BACnet IP

BACnet IP uses a standard UDP/IP stack to send and receive messages (see definition of UDP/IP below). For the most part, the same packet that would be found on an MS/TP link is encapsulated in a UDP/IP packet and called BACnet IP. Devices use IP addresses and Ethernet MAC addresses just like other UDP/IP network devices. There is no concept of master/slave token passing since Ethernet is automatically peer to peer in nature. Devices simply transmit to their intended recipient at will, and let Ethernet deal with packet collisions and retries as needed.

BACnet MS/TP

MS/TP stands for Master Slave Token Passing. Each device on the link is considered the “master” when it has the token. If it does not have immediate need to use the token, it is required to pass the token along to the next device. This is the “token passing” part. All devices on the link which do not currently have the token are regarded as slaves, and are expected to listen to any messages the current master may have for it. Because all devices take turns being master, the link is effectively peer to peer.

BACnet Application Layer

This is where the real fun takes place. All message processing is handled at the application layer, including device addressing. The IP address will get a BACnet packet through all layers of the UDP/IP stack. Then the application layer decides what to do with the BACnet message. There is an entire list of possible message types, but the most frequently used is simply “read present value property”. Another strong contender for “most used” would be the COV notification (Change of Value).

.Net Source code and help application for BACnet

BACnet devices are defined on the network as a collection of “objects”. Typical objects include Analog Inputs, Analog Outputs, Binary Inputs, Binary Outputs, and more complex objects such as Scheduler. Messages on the network deal with reading and writing Object Properties. The most frequently referenced property for an analog input is “present value”, which typically means data derived from a sensor or physical device. Other properties associated with an analog input object, for example, include fault status, reliability, object name, minimum and maximum limits, etc. BACnet protocol standards define required and optional properties for each object type. The manufacturer’s documentation for the BACnet device will list which object types are included in the device, along with which optional properties are included in each object.

Along with the definition of objects, BACnet protocol defines “services”. These include object access services, alarm and event services, file access services, and a few more. Object access services are the most commonly used since these provide the fundamental “read/write” access to object properties.

Accessing object properties requires specifying these parameters:
— device instance (i.e., which device on the network)
— object type (analog input, binary intput, etc.)
— object instance (i.e., which analog input)
— property (present value, object name, status flags, etc.)

Input objects are simple, they just have a “present value” associated with them. Output objects are known as “commandable” and these get a bit more interesting. Because there is the possibility that more than one control algorithm might want control over an object, the command requests are prioritized and only the highest priority command will take effect. When the higher priority command is relinquished, the next lower command will take effect. All of the commands are maintained by the object in its command priority array (containing 16 priority levels).

Writing to an output object requires specifying all of the parameters shown above for accessing object properties, plus two additional parameters:
— command priority
— command level for given priority

The present value obtained when a commandable object is read will be the command level having the highest level that has not been relinquished. To pass command to some other process, you simply write a “relinquish” to the commandable object.

References

http://www.bacnet.org/

--

--