The Definitive Guide to BACnet
A long time ago, a really smart guy wrote the definitive guide to BACnet. Unfortunately that guide was lost.
Fortunately, I have taken it upon myself to create a new guide to educate you about the wild and wooly world of BACnet.
When I started off writing this guide I had three key objectives:
- Help owners really understand what BACnet is and what it isn’t
- Help system integrators understand the nuances of BACnet in regards to integration
- Help non-BAS product developers understand how BACnet could work with their product
At the end of this article I will ask you to tell me how well you think I did at meeting these goals.
Why Rewrite now?
I wrote a series about BACnet back when I was starting blogging. The articles were definitely not my best work but there wasn’t much else to compare with when the only other thing out there is a video of some guy talking in a monotone voice and a circa 1990’s PowerPoint. When I originally wrote these articles I figured I only have to suck a bit less than those two folks.
Well, my readers, it’s four years later and I believe I’m a bit better at writing now. Because of this, I figured I would recreate my BACnet guide updated with the latest in BACnetty news so that you can get your BACnet on.
What is the Format of This Guide?
While I recommend you read through the guide in order it is written in such a way that you can start reading any particular section and take immediate value from the guide. I have broken out the guide into the following sections:
- How did BACnet Come About?
- What is BACnet?
- How does BACnet Work?
- BACnet Communications
- BACnet Devices
- What does it mean to be BACnet Compliant
How Did BACnet Come About?
BACnet was created by the American Society of Heating and Air-Conditioning Engineers. BACnet was created to provide a common communication standard for Building Automation Systems. To help set the context, let’s look at what was happening at the time.
Back in the late 1980’s networked systems were starting to come about. Personal computing had begun to spread into the office space and the control system had matured from dials and switches to automated systems. The problem was companies, out of necessity, had created their own communication protocols. These were the days of P-BUS, N2, and IBEX.
Customers and engineers saw a problem and collaborated to develop a standard that would ensure interoperability and would allow systems to communicate with one another. In 1995 the first version of BACnet ANSI/ASHRAE Standard 135 was published. From here the standard has gradually grown to its current standard which is ASHRAE-135 2012.
The standards group meets on a regular basis to discuss BACnet and the hopefully soon to come BACnet Web Services Standard! (and no for all you BACnet geeks, I’m not referencing the 2004 standard)
What is BACnet?
BACnet is not well known outside of our little building automation circle. I was working with a few lighting vendors lately trying to help them be better able to interface with control systems. They started talking about how they are using CoAP as their protocol of choice. When I suggested that they use BACnet they had only a passing familiarity with the standard.
I can understand why, at 1,200+ pages the standard is a doozy. In comparison the CoAP standard is roughly 120 pages. I can understand why without insomina would want to avoid the standard, it’s not exactly the most exciting read in the world. But, hey, that’s why you’ve got this article.
So at a high level, BACnet is a standard that defines the following:
- Data Model
- Communication Protocol
Have you ever tried to talk to a call center in India? I have, and maybe it’s the fact that I’m from the South, but I just can’t understand what they are saying. Well, imagine your building automation system talking to 5 other building automation systems and each of them are saying the same thing but in a different way.
Which way is right?
Who should they listen to?
That my friends is where the data model steps in.
The data model says, hey fools listen to me. When you want to say Crayons you say “Cray On’s” not “Crowns” .
Cause after all, we all want to sound like southerners.
What the data model is doing is defining the semantics of the conversation.
Semantics are a set of rules that define how data is structured and formatted.
There’s a lot more to data models and we will dive deeper into this once we reach the section on BTL and BIBB’s.
BACnet also defines a communications protocol for the standard. Think of a protocol as the rules. Whereas the Data Model displays what color the stop signs must be the protocol defines where the stop signs go.
This article will largely be about the protocol aspects of BACnet. After all, the top two questions I get are how to integrate a BACnet system and how to troubleshoot one.
By the end of this article, you will understand both.
How Does BACnet work?
In this section, I’m going to cover how BACnet communicates, what a BACnet Device is, and what a BACnet message looks like.
The image above shows how the 4 main layers in the BACnet stack align with the 4 layers of the OSI model. The lower layers include the communication media and the communication protocols while the higher levels include the services and applications
BACnet LAN Types
BACnet currently supports five protocols types for communications
• BACnet over IP (Annex J)
• BACnet over Ethernet
• BACnet over Master Slave/Token Passing MS/TP
• BACnet over Point-to-Point (PTP)
• BACnet over ARCNET
The two main protocols we will discuss are BACnet/IP and BACnet over MS/TP.
Through the Looking Glass, A BACnet Message
A BACnet message consists of a few key features:
- Network APDU
- Network NPDU
- BACnet/IP or MS/TP Messages
Network Application Protocol Data Unit (APDU)
This is where the data flows. No, seriously, an APDU is the Protocol Data Unit for exchanging data between BACnet applications. Whether that application is embedded in a device or hosted on a server this PDU is what transfers the data.
Network Network Protocol Data Unit (NPDU)
The NDPU is what contains the version, priority, and other fields (you can think of NPDU as acting similar to several of the HTTP/2 flags, e.g priority).
Now if you recall your IT basics, you went through my IT course right? You should remember that as data flows down from the application layer (Layer 7) towards the physical layer (Layer 1) it gets encapsulated. This means that the data is “wrapped by the layer below it.
Therefore as the BACnet message goes from network to network the BACnet device can look at the NPDU to determine where to send the device.
BACnet Virtual Link Layer
BVLL, provides a way to create virtual links between BACnet devices. The BVLL also indicates whether BACnet messages are uni-cast or broadcast. This layer will become critically important when we discuss BACnet Broadcast Management Devices (BBMD) later in the article.
An example of an encapsulated BACnet/IP Packet is below.
BACnet/IP or MS/TP Messages
So is your head spinning yet?
Ya, I know BACnet is some confusing stuff. How do you think I felt writing this article?
How do you think I felt writing this article?
Don’t worry though, we are more than a quarter of the way through and once we get through the next two sections the rest of the material is easy.
BACnet over IP is a method from which BACnet/ Ethernet packets can use the framework of the UDP/IP protocol to send data to BACnet devices across multiple subnets.
For those who are less IT savvy BACnet/IP allows messages that typically could only communicate on one local area network to communicate across multiple local area networks.
What is TCP/IP and UDP/IP
Before I deep dive into BACnet/IP it will be good to level set on TCP and UDP. The difference between TCP and UDP is important because UDP is the protocol that BACnet and many of the emerging IoT Protocols use.
TCP/IP and UDP/IP are protocols that allows messages to communicate across multiple Subnets.
Internet Protocol (IP):
- Allows for transmission of data
- Applies addresses to devices
- Allows for the creation of logical subnets
- Connection-less protocol
- Allows for small packets that are non-network intensive.
- Verifies data transmission
- Has built in error correction
Why do we use BACnet/IP?
BACnet over Ethernet allowed building automation systems to transfer data via ethernet across a Bus architecture. This worked well initially but with the advent of the internet and the desire to have a single control system across a network of buildings the need for networks larger then 254 nodes was needed.
That is why ASHRAE adopted BACnet/IP in annex j of the 135- 1995 standard.
With the addition of BACnet IP we gained a slew of new capabilities.
Most importantly BACnet IP allows us to:
- Communicate across multiple subnets
- Create multi-campus control systems
- Utilize the benefits of fiber and giga-ethernet.
- Assign IP addresses to our BACnet devices making the web accessible.
How does BACnet/IP communicate?
There are four ways BACnet/IP can communicate:
- BACnet/IP to BACnet/IP (same subnet)
- BACnet/IP to BACnet/IP (different subnet)
- Broadcast (same subnet)
- Broadcast (different subnet)
BACnet/IP to BACnet/IP (same subnet)
In this situation the location of the two devices is already known by the host and the message is routed to the device using a local switch.
BACnet/IP to BACnet/IP (different subnet)
In this situation, the location of the two devices is already known by the host and the message is routed to the device using switches and routers.
Broadcast (same subnet)
This is a standard Who is/ I am message sent across a local subnet for the BBMD to discover what the address are for the BACnet devices on the subnet.
Broadcast (different subnet)
This is a standard Who is/ I am message sent across a local subnet for the BBMD to discover what the address are for the BACnet devices on other subnets.
What does a BACnet/IP Message look like
BACnet/IP uses a packet structure similar to a TCP/UDP Packet to pass messages from one device to another. A detailed description of a BACnet/IP packet is below.
A detailed description of a BACnet/IP packet is below.
Now I don’t expect you to understand all the flags and fields in this message. But you should at least be comfortable with the concepts of addresses and ports. If you aren’t you will be in for a world of hurt when you try to troubleshoot a BACnet installation.
Where is BACnet/IP Practical?
Not many vendors still use solely BACnet/Ethernet as most have adopted the BACnet/IP framework. Thus the ultimate answer is that BACnet/IP is practical for any solely BACnet system. The true choice on BACnet/IP is when you are utilizing a non native platform such as Tridium from which you have multiple protocol choices.
BACnet over MS/TP is a method from which BACnet MS/TP packets can use the Master-Slave Token-Passing (MS/TP) principle to transmit data across a bus network architecture (this will be discussed in further detail in my networking fundamentals posting). MS/TP messaging requires a physical medium (wire) and devices that have (Media Access Control) addresses. MS/TP communications use tokens to pass data. Only master devices can pass the token and only master devices can respond to the who-is request (this is why you cannot auto discover slave devices).
When a controller communicates on a BACnet MS/TP network, it first requests a token. Upon receiving a token, the controller is able to open a application layer message using a APDU. This allows the device to communicate to other controllers or the supervisory device. Only the device that has a token can communicate with other devices. A detailed description of this communication sequence is below.
There are four key best practices when you are designing and implementing a BACnet MS/TP control system:
- Ensure that the devices are set to communicate at the same baud rate. Do not simply rely on auto-baud, when possible manually set the baud rate. For shorter distance trunk runs use the 76.8k for longer distance trunk runs use 38.4k.
- In order to keep the RTT and TRT times low, you should make sure that your controllers are addressed in sequence. This allows the token to pass quickly to each device in sequence rather then randomly moving throughout the network.
- The network instances should be arranged logically and in order. This facilitates effective troubleshooting and will allow the user to quickly find communication issues.
- Utilize the same wire media throughout the installation and do not ground both ends of a trunk bus (this creates a antennae effectively drawing interface to your bus).
BACnet Message Flow WHO-IS, I-AM
Sure there are other pieces to a BACnet message but the above are the key features that you need to look at if you want to troubleshoot BACnet messaging.
Inside a BACnet message you will often find information around:
- The Object
- BIBB- BACnet Interoperability Building Blocks- These blocks allow you to build BACnet capabilities into a device. An example of this would be the “T” block which stands for trends and allows a device to have the ability to receive and communicate trend objects.
- BACnet services- These services are very similar to the “calls” a computer makes when connecting to a website for data. This allows the device to perform the same communication tasks as other devices.
- MAC Address- Media Access Control or MAC, is the method at which a device identifies itself on a specific media. For MS/TP this is typically done in the form of an 8 bit number for Ethernet this is typically a series of Hexadecimal numbers that device a devices Network Interface Card or NIC.
You can see an example of a BACnet message below.
BACnet communicates via different methods utilizing the OSI network layer. The physical layer which consists of the wires and devices will allow the messages to be transported. Messages once transported will then be assigned a specific location to travel to on their local network in the data link layer.
Devices perform services calls for data and receive calls for data repeatedly. This is what causes the device to communicate. Now while the method from which the data is transmitted is different for IP over MS/TP the core services remain the same.
But what are devices?
Let’s take a look at a device and what it means to you.
A simple definition of a BACnet device is a collection of objects that represent the functions present in a real device. This is why virtual devices can be considered a BACnet device as well as physical controllers. The device is defined by the objects inside not its physical architecture.
You see in the programming world we have this concept of objects and properties. Objects are instances of a class, and properties are characteristics of the class.
For example, in the real-world, you may have a class of vehicles called trucks (we won’t get into superclasses here 😀 ). This class can have various properties. For example, it may have a property called doors and that maybe a numeric property. It may also have a property called color and that may be a textual property.
So you could say that the instance of the truck object titled Ford had 2 or 4 doors and can be a variety of colors.
Well, BACnet has a set of objects and we are going to look at those right now.
• An object will provide a set of properties that contain data related to that object.
• BACnet has a set of 23 standard objects.
A deeper dive into objects, properties, and services can be accessed Here.
There are so many properties that I could spend a whole article listing them out. However here’s what you need to know.
Each BACnet object has a list of properties. And the properties are different for each object.
Often times folks will e-mail me asking why their BAS has the same description for each device even though they changed the device name. That’s because they didn’t change the device description property.
You see, understanding the properties that you have will help you to understand the capabilities you have.
What Does it Mean when a Product is BACnet Compliant?
In order to integrate multiple devices, you want to have a way to ensure that these devices can work with one another.
The method that the BACnet folks chose to achieve this was through the BTL or BACnet Testing Laboratory. The BTL created a series of BACnet listings that define the objects, properties, and functionality that a device can support. In the world of BACnet, these are often called BIBB’s (BACnet Interoperability Building Blocks).
The BIBB’s are the set of functionality that when grouped together form a BTL listing.
A picture is worth a thousand words so let’s look at some screen grabs off the Chipkin site. By the way, the folks at Chipkin do a great job of diving deep into BACnet check them out!
As you can see, each BIBB is assigned to a class (in this case AE, the alarm and event class), and each BIBB achieves a specific set of functionality.
Now if we look at the Protocol Information Conformance Statement (PICS) for an Advanced Operator Workstation Listing we can see what BIBBs it conforms to.
So for those of you who are creating standards and specifications what you want to do is to browse through the BIBB’s (once again Chipkins site is a good reference) and list out the BIBB’s you want your BAS to achieve. Then you would identify the BTL listings that achieve this functionality.
So basically the workflow would be:
- Start with the server and identify the BIBB’s you want. Then specify the BTL listing that most closely matches the set of BIBB’s you want to achieve.
- Next, move to the supervisory devices and perform the same.
- Finally, move on to the field controllers and identify the capabilities you want there.
It’s that easy, three steps to specification greatness.
Yes, this will take some time, and yes you will have to make trade-offs as to which BIBB’s your systems implement.
But you will end up with a well-specified system that does what you want.
The alternative is you skip this step and cry to your BAS manufacturer about how their system doesn’t do what you want it to do…
So there you have it. The guide to BACnet.
In this guide, I covered the essentials of BACnet.
At the end of the day you really need to understand:
- BACnet is a set of protocols and a data model that follow a standard. This means that BACnet communications and objects follow predictable rules. If you know these rules you can design and troubleshoot BAS installations.
- The BTL ensures that BACnet devices can integrate with one another through compliance with a set of BIBB’s that form BACnet listings
- You can create a standard of around BACnet for your projects by following the method I described earlier in this post
So what are your thoughts on BACnet?
What questions do you have?
Ask them in the comments below and I will update this article with those answers.