MS/TP Explained: The Serial Backbone of BACnet
Imagine a classroom where students can only speak one at a time. A teacher passes a “talking token” around the room—only the student with the token can ask questions or share ideas. When they’re finished, they pass the token to the next student. This is exactly how Master-Slave/Token-Passing (MS/TP) works. It’s BACnet’s “classroom protocol”—a serial data link layer that ensures order and fairness in device communication.
In this article, we’ll provide a comprehensive guide to MS/TP, covering its token-passing mechanism, MAC addressing, frame structure, proper RS-485 wiring, ideal use cases, and limitations. Whether you’re installing a small sensor network or troubleshooting an existing MS/TP system, this guide will give you the knowledge you need.
What Is MS/TP?
MS/TP is a data link layer protocol for BACnet that enables multiple devices to communicate over a single RS-485 serial bus. It uses a master-slave architecture with token passing to ensure only one device communicates at a time.
Key Characteristics
- Half-Duplex: Devices can’t transmit and receive at the same time
The Token-Passing Mechanism: The Classroom Analogy
Let’s deepen the classroom analogy to explain how token passing works:
1. Token Initialization: The teacher (system) assigns the first token to a student (device) with the lowest MAC address
2. Token Holding: The student with the token can speak (transmit data) for a limited time
3. Token Passing: When finished, the student passes the token to the next student with the higher MAC address
4. Token Wrapping: When the token reaches the student with the highest MAC address, it wraps around to the lowest address
5. Slave Devices: Students without the token can only respond when called upon (slave devices)
Technical Details of Token Passing
1. Token Frame: A special frame (with Function Code 0x81) that grants transmission rights
2. Token Rotation: Ensures all master devices get a turn to communicate
3. Token Timeout: If a device holds the token too long, it’s assumed lost, and a new token is generated
4. Token Generation: If no token is detected, the device with the lowest MAC address generates a new token
5. Slave Response: Slaves only respond to master requests; they can’t initiate communication
MAC Addressing: Student ID Numbers
In our classroom analogy, each student has a unique ID number. In MS/TP, each device has a unique MAC address that identifies it on the network.
What Is a MAC Address in MS/TP?
- Address Conflict: Two devices with the same MAC address cause communication failures
How to Set MAC Addresses
MAC addresses can be set in several ways:
- Automatic Addressing: Some devices support auto-addressing during commissioning
MS/TP Frame Structure: The Conversation Format
Just as classroom conversations have a structure (greeting, message, closing), MS/TP frames have a standard format that all devices understand.
MS/TP Frame Format
| Field | Size (bytes) | Description | Classroom Analogy |
|———–|—————–|—————–|———————–|
| Start Delimiter | 1 | Marks the beginning of a frame | Raising a hand to speak |
| Frame Control | 1 | Defines frame type (token, data, poll for master) | Saying “Question” or “Comment” |
| Destination MAC | 1 | Address of the intended recipient | Calling a student by name |
| Source MAC | 1 | Address of the sender | Identifying yourself |
| Data Length | 1 | Number of data bytes | Estimating how much you’ll say |
| Data | 0-127 | The actual message content | The question or comment itself |
| Frame Check Sequence | 2 | CRC for error detection | The teacher verifying you spoke clearly |
| End Delimiter | 1 | Marks the end of a frame | Saying “Thank you” |
Frame Types
1. Token Frame: Grants transmission rights to a device
– Frame Control: 0x81
– No data field
– Like the teacher passing the token
2. Data Frame: Carries BACnet messages
– Frame Control: 0x41 (for master-to-slave)
– Contains BACnet service data
– Like a student asking a question
3. Poll for Master Frame: Used to discover new devices
– Frame Control: 0x21
– Sent by a master to check for new devices
– Like the teacher calling roll
RS-485 Wiring: Building the Classroom Connection
MS/TP runs over RS-485, a balanced serial communication standard. Proper wiring is critical for reliable communication.
RS-485 Basics
- Distance: Up to 1,200 meters (3,937 feet) at 9.6 kbps
Proper MS/TP Wiring Guidelines
#### 1. Topology: Daisy Chain Only
- Why?: Stubs cause signal reflections and communication errors
“`
Correct: Device1 ←→ Device2 ←→ Device3 ←→ Device4
Incorrect: Device1 ←→ Device2
←→ Device3
←→ Device4
“`
#### 2. Termination Resistors
- Note: Some devices have built-in termination resistors (check device manuals)
#### 3. Cable Requirements
- Shield Grounding: Ground the shield at only one end to prevent ground loops
#### 4. Power Considerations
- Surge Protection: Consider surge protectors for outdoor or industrial environments
#### 5. Device Count
- Extending: Use repeaters to extend beyond 32 devices (each repeater adds a new segment)
Ideal Use Cases for MS/TP
MS/TP excels in specific building automation scenarios, particularly for connecting field controllers and sensor networks.
1. Field Controllers and Sensors
- Access Control Readers: Door access sensors and controllers
2. Small to Medium Building Systems
- Hospitals: Patient room monitoring systems
3. Cost-Sensitive Installations
- Easy Commissioning: Simple address configuration
4. Noise-Prone Environments
- Harsh Environments: RS-485 is more rugged than Ethernet
Limitations of MS/TP
While MS/TP is reliable, it has several limitations that must be considered:
1. Speed Limitations
- Slow Response Times: Not suitable for real-time applications
2. Topology Restrictions
- Physical Limitations: Requires devices to be in a line
3. Device Count Limitations
- Token Rotation Time: More devices mean longer time between token passes
4. Half-Duplex Communication
- Token Waiting Time: Devices must wait for the token to communicate
5. Limited Diagnostics
- No Remote Configuration: Typically requires physical access to set MAC addresses
Troubleshooting MS/TP Networks
When MS/TP communication fails, follow this systematic troubleshooting process:
1. Check Physical Connections
- Verify Grounding: Shield grounded at only one end
2. Check MAC Addresses
- Check Default Addresses: Ensure devices don’t all use address 0
3. Check Configuration
- Token Timeout: Ensure timeout settings are appropriate for the network size
4. Test Individual Devices
- Check Power: Ensure all devices have proper power
MS/TP vs. Modern Alternatives
| Feature | MS/TP | BACnet/IP | BACnet Ethernet |
|————-|———–|—————|———————|
| Data Rate | 9.6-76.8 kbps | 10-10,000 Mbps | 10-100 Mbps |
| Topology | Daisy chain only | Any IP topology | Star/bus |
| Device Limit | 32 per segment | Unlimited | Limited by switches |
| Cost | Low | Medium | High |
| Reliability | High | High | High |
| Ease of Troubleshooting | Moderate | Easy | Moderate |
| Future-Proofing | Low | High | Medium |
Future of MS/TP
While MS/TP is being replaced by BACnet/IP in many modern installations, it still has a place in building automation:
- Simplicity: Easy to understand and maintain
Conclusion: The Reliable Workhorse of BACnet
MS/TP is like a reliable old teacher who has been in the classroom for decades. It may not be the fastest or most modern, but it’s fair, predictable, and gets the job done. For small to medium building systems with field controllers and sensors, it’s still an excellent choice.
Understanding MS/TP’s token-passing mechanism, MAC addressing, frame structure, and proper RS-485 wiring is essential for anyone working with BACnet systems. By following the guidelines in this article, you can design, install, and troubleshoot MS/TP networks that are reliable, efficient, and cost-effective.
So, the next time you see a field controller connected with two wires, remember the classroom analogy—each device patiently waiting for its turn to speak, passing the token around the network, ensuring order and fairness in building communication.