The Definitive Guide to BACnet

bacnet-tutorial

BACnet confuses a lot of folks and if you feel confused that's ok. We created this guide to solve that problem.

This guide will:

Table of Contents

While we recommend you read through the guide in the order it is written in such a way that you can start reading any particular section and take immediate value from the guide. We have broken out the guide into the following sections:

How did It Come About?

What it is

How it works

Communications

BACnet/IP or MS/TP Messages
TCP/IP and UDP/IP
Why do we use BACnet/IP?
How does BACnet/IP communicate?

Devices

Objects

What does it mean to be BACnet compliant?

Next steps to grow your knowledge

How Did It Come About?

BACnet was created by the American Society of Heating and Air-Conditioning Engineers 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 2016.

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 the geeks, I'm not referencing the 2004 standard.)

What is BACnet?

At a high level, BACnet is a standard that defines the data model and the communications protocol for building automation systems.

It 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.

Data Model

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.

Communications Protocol

Think of a protocol as the rules. Whereas the data model displays what color the stop signs must be, the BACnet protocol defines where the stop signs go.

This guide will largely be about BACnet protocol aspects. 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.

Like audio instruction? Enhance your learning from this article:

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.

BACnet Communications

how-bacnet-layers-align-with-osi-layers

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

There are currently five supported BACnet protocol types for communications.

• Over IP (Annex J)

• Over Master Slave/Token Passing MS/TP

• Over Point-to-Point (PTP)

The two main protocols we will discuss are BACnet/IP and BACnet over MS/TP.

Through the Looking Glass, A BACnet Message

wireshark_bacnet_stack_services.png

A BACnet message consists of a few key features:

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 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 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 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.

WIB2

BACnet/IP or MS/TP Messages

So is your head spinning yet?

Ya, I know this can be some confusing stuff. 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/IP

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):

UDP: