BACnet MS/TP: frame format, token passing and RS-485 wiring
Part of the BACnet guide
BACnet MS/TP (Master-Slave/Token-Passing, often written BACnet MSTP) is the serial data link of BACnet, defined in Clause 9 of ASHRAE 135. It runs on a shared RS-485 pair. Master nodes take turns by passing a token: only the node holding it may start a conversation, and it hands the token to the next address when it is done. Each frame carries a one-byte source and destination address, a header CRC and, when there is data, a 16-bit data CRC.
This page belongs to the BACnet guide. The Ethernet data link is in BACnet/IP, and the objects carried inside the frames are in BACnet objects and properties.
Masters, slaves and addresses
Every node on an MS/TP trunk has a one-byte MAC address, set on the device with switches or in software.
| Address | Role |
|---|---|
0 to 127 | Master nodes: receive the token and may initiate requests |
128 to 254 | Slave nodes: never hold the token, only answer requests sent to them |
255 | Broadcast |
Most controllers are masters. A slave node cannot announce itself, because it may transmit only in reply to a request, so it does not answer Who-Is with I-Am the way a master does. A client has to know a slave’s address in advance, or rely on a router that answers on its behalf.
The MAC address is local to the trunk. It is not the device instance: the instance identifies the device across the whole BACnet internetwork, and the MAC address only says where it sits on this one cable. Both must be unique in their own scope.
BACnet MS/TP frame format
| Field | Size | Notes |
|---|---|---|
| Preamble | 2 bytes | Always 0x55 0xFF |
| Frame type | 1 byte | See the table below |
| Destination address | 1 byte | MAC address, 0xFF for broadcast |
| Source address | 1 byte | MAC address of the sender |
| Length | 2 bytes | Number of data bytes, high byte first; 0 when there is no data |
| Header CRC | 1 byte | CRC-8 over frame type, addresses and length |
| Data | 0 to 501 bytes | The NPDU and APDU, present only when length is not zero |
| Data CRC | 2 bytes | CRC-16 over the data, low byte first; present only with data |
| Frame type | Name | Purpose |
|---|---|---|
0x00 | Token | Passes the right to transmit to the destination |
0x01 | Poll For Master | Asks whether a master exists at the destination address |
0x02 | Reply To Poll For Master | “Yes, I am here”; the poller will pass the token to it |
0x03 | Test_Request | Link test |
0x04 | Test_Response | Answer to a link test |
0x05 | BACnet Data Expecting Reply | A confirmed request |
0x06 | BACnet Data Not Expecting Reply | A response, or an unconfirmed request such as Who-Is |
0x07 | Reply Postponed | The answer is not ready; it will follow when the node next holds the token |
Each byte is sent as one start bit, eight data bits, no parity and one stop bit. Unlike Modbus RTU, MS/TP does not rely on silence to mark the end of a frame: the preamble marks the start and the length field gives the size.
A token frame is eight bytes. This one passes the token from MAC 5 to MAC 6:
55 FF 00 06 05 00 00 37
55 FF preamble
00 frame type: Token
06 destination: MAC 6
05 source: MAC 5
00 00 length: no data
37 header CRCThe header CRC uses the polynomial x^8 + x^7 + 1, starts at 0xFF, and is sent as the ones complement of the result. The data CRC uses x^16 + x^12 + x^5 + 1, starts at 0xFFFF, and is also complemented before sending. Annex G of the standard gives reference code for both. A node that computes a different CRC discards the frame without a reply, so corruption shows up as timeouts and retries, never as an error message.
How the token moves
One token circulates among the masters in ascending address order, wrapping from the highest back to the lowest.
- A master receives the token.
- It may send up to Max_Info_Frames data frames. For each request that expects a reply, it waits for the answer before going on.
- It passes the token to its next station, the next higher master address it knows of.
- Periodically, before passing the token, it sends Poll For Master to one address in the gap between itself and its next station. If a new master answers, that node becomes the next station. This is how a controller added to a live trunk joins the ring.
Two properties of the Device object shape this loop:
| Property | Default | Effect |
|---|---|---|
| Max_Master | 127 | The highest address this node will poll when looking for new masters |
| Max_Info_Frames | 1 | How many data frames this node may send each time it holds the token |
A request addressed to a master that does not hold the token is answered immediately if the answer is ready within the reply window (the standard gives the responding node 250 ms). Otherwise the node sends Reply Postponed and delivers the answer when the token next reaches it.
If the token is lost, because a node was powered off while holding it, the trunk goes quiet. After 500 ms of silence the nodes begin a recovery in which the lowest-addressed master generates a new token. Frequent recoveries, visible as pauses in traffic, mean a wiring fault or a failing device.
Baud rate and how long a scan takes
The standard baud rates are 9600, 19200, 38400, 57600, 76800 and 115200 bit/s. Every node on a trunk must use the same rate. Some controllers detect the rate automatically from traffic already on the wire; at least one node has to be fixed for that to work.
MS/TP is slow because every value waits for the token. With each byte taking 10 bit times, a character at 38400 baud lasts about 0.26 ms, so the eight-byte token costs about 2 ms per hop before turnaround delays. On a trunk of 30 masters the token takes at least a few tens of milliseconds to go round when nobody has anything to send, and each node’s requests and their replies are added on top. A client polling 200 points one ReadProperty at a time, with Max_Info_Frames at 1, gets one request out per token rotation.
Three settings shorten the cycle:
- Number the masters contiguously from
0and set Max_Master on every node to the highest address in use. Gaps in the addressing are polled, one address at a time, for masters that do not exist. - Raise Max_Info_Frames on the node that does most of the asking, typically the router or the supervisory controller, so it can send several requests per token.
- Use ReadPropertyMultiple where the devices support it. The usual maximum APDU on MS/TP is 480 bytes, which still holds many values.
RS-485 wiring
MS/TP uses two-wire, half-duplex RS-485, and the wiring rules are the ones that apply to any RS-485 bus.
- Run the cable from device to device in one line. No stars, no long stubs.
- Terminate both ends of the trunk with a resistor that matches the cable impedance, typically 120 ohms, and nowhere else.
- Bias the line so that it idles in a defined state. Many routers and supervisory controllers have switchable bias; enable it in one or two places, not on every node.
- Keep polarity consistent. Terminals are labelled
+/-orA/Bdepending on the manufacturer; a device wired backwards never joins the ring. - Use shielded twisted pair, connect the shield through at each device and ground it at one end only.
- Respect the electrical load. An RS-485 segment supports 32 unit loads before a repeater is needed; many transceivers are a fraction of a unit load, so check the device data sheet.
The Modbus RTU page covers RS-485 termination and biasing in more detail; the physics are the same.
Common BACnet MS/TP faults
| Symptom | Likely cause |
|---|---|
| One controller never appears | Its MAC address is higher than the Max_Master of the nodes below it, so nobody polls for it |
| Trunk works until one device is connected | Duplicate MAC address, wrong baud rate, or reversed polarity on that device |
| Everything is slow | Address gaps, low Max_Info_Frames on the busiest node, or a low baud rate |
| Intermittent dropouts across the trunk | Missing or extra termination, no bias, or a ground loop through the shield |
| A device is reachable but not discoverable | It is a slave node, or a second device shares its device instance |
A new client joining an existing trunk needs a free master address at or below the trunk’s Max_Master, and the baud rate in use. Adding it changes the token rotation for every other node, so check with whoever maintains the building management system first.
Reading BACnet MS/TP with ControlCom
The ControlCom Edge Server, the on-site component of ControlCom Connect, has a BACnet MSTP client. Its Connection tab takes the Serial Port path (such as /dev/ttyUSB0) and the Baud Rate (9600 by default). MAC Address is the address the Edge Server claims on the bus, 0 to 127, and Target MAC Address is the controller’s address; set it explicitly, because an empty field falls back to the Edge Server’s own MAC Address. Max Master defaults to 127 and Max Info Frames to 1, with Data Bits, Stop Bits and Parity alongside. The Device Instance, Poll Interval (ms) and Timeout (seconds) fields are the same as for a BACnet/IP client.
The Edge Server runs in a container, so the serial device has to be mounted into it as a volume. The BACnet client documentation lists the fields, and the BACnet tool in the local web interface can send Who-Is on the trunk to all nodes or to one MAC address. The values land in platform variables, described in the platform overview.
The Edge Server joins an MS/TP trunk as one more node and publishes each object it reads as a variable in ControlCom Connect, so the room controllers at the end of the cable show up in trends and alarms.