0% found this document useful (0 votes)
177 views10 pages

BACnet MSTP

The document discusses the BACnet MS/TP protocol for transmitting BACnet data over EIA-485 networks. It covers the MS/TP packet structure, receive frame state machine, master and slave node state machines, timing considerations, and MAC addressing. Key aspects include the use of a preamble, frame type, addresses, length and CRC fields in packets, and state machines for receive processing and controlling the token passing between master and slave nodes.

Uploaded by

Rafael Baqs
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views10 pages

BACnet MSTP

The document discusses the BACnet MS/TP protocol for transmitting BACnet data over EIA-485 networks. It covers the MS/TP packet structure, receive frame state machine, master and slave node state machines, timing considerations, and MAC addressing. Key aspects include the use of a preamble, frame type, addresses, length and CRC fields in packets, and state machines for receive processing and controlling the token passing between master and slave nodes.

Uploaded by

Rafael Baqs
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

BACnet MS/TP

Physical and Electrical considerations Packet structure Receive Frame State Machine Slave and Master Node State Machine Design issues (timing, buffering, MAC address)

BACnet MS/TP EIA-485


+ 120 + + 120

510 +5 Rx Tx RTS

510

47K

47K +5 Rx Tx RTS Rx Tx RTS

Node with network bias resistors

Node with local bias resistors

Node without bias resistors

Baud Rates: 9600, 19200, 38400, 57600, 76800 Parity: no Start Bits: 1 Stop Bits: 1 Least Significant Bit First (same as EIA-232) Uses standard UART
2

This may not be the ideal circuit for EIA-485. There has been much debate in the BACnet MS/TP working group about it.

MS/TP Packet Structure


0x55 Preamble 0xFF Frame Type Destination Address Source Address Length Header CRC Data Data CRC 0xFF pad 1 octet 1 octet 1 octet 2 octets, most significant octet first 1 octet (present if Length is non-zero) Length octets (present if Length is non-zero) 2 octets (optional) at most, 1 octet
3

2 octets

Receive Frame State Machine


EatAnOctet EatAnError Preamble 1 Bad CRC Timeout Repeated Preamble 1

DATA CRC

Good CRC

IDLE

Error

PREAMBLE

NotPreamble
ut eo m ror Ti Er
Ti m eo

FrameTooLong

NotForUs

BadCRC

NoData

ut

Prea

mble

DATA
Da

C2 CR

HeaderCRC

r ro Er

Frame Type

HEADER
ta

Destination

CRC 1

HEADER CRC
Length 2 Source Data Octet Length 1

Master Node State Machine


INITIALIZE
DoneInitializing ReceivedUnwantedFrame ReceivedInvalidFrame ReceivedPFM ReceivedDataNoReply

LostToken

ReceivedDataNeedingReply

NO TOKEN

SawFrame

IDLE

Reply DeferredReply
U ed iv ce Re

ANSWER DATA REQUEST

ram e

ed Un ex pe cte dF

ok en Us er

e xp ne

Sa wT

Fr ed ct

dT eive Rec

Re ce iv

am

Token

Generate

PASS TOKEN
Fin dN ew Do Su ne cce Wit Re sso ceiv hP r FM ed Re p ly To PF M

RetrySendToken

WAIT FOR REPLY


Re p ly Tim eO In ut v Re alid ce F Re ive ram ce dR e ive ep dP ly os tp on e

n oke

s Re

n F ke eP To nc nd ten a Se ain etM


M

S en dA n ait dW

POLL FOR MASTER

SendMaintenancePFM SoleMasterRestartMaintenancePFM
SoleM aster DeclareS oleMas

DONE WITH TOKEN

NothingToSend SendNoWait SendAnotherFrame SoleMaster

USE TOKEN

SendNextPFM

ter

Slave Node State Machine


INITIALIZE

Do

ne

ReceivedUnwantedFrame

In i t

ial izi n

ReceivedDataNoReply

ReceivedDataNeedingReply ReceivedInvalidFrame

IDLE

Reply

ANSWER DATA REQUEST

Cannot Reply

MS/TP Timing
Tframe_abort < 60 bit times

Token

Token

Token

55 FF 00 72 0A 00 00 A9

55 FF 00 03 72 00 00 95

55 FF 00 A0 03 00 00 04

Tusage_timeo ut < 20ms

Tturnaround > 40 bit times

Tpostdrive < 15 bit times

MS/TP Timing
Poll For Master Token

55 FF 01 07 03 00 00 6D

55 FF 00 0A 03 00 00 04

Tusage_timeo ut < 20ms

BACnet Data Expecting Reply

Token

55 FF 05 89 0A 00 12 12 01 04 02 05 53 07 C4 02 80 00 01 0E 31 00 62 FF EF 0F 41 2D

55 FF 00 72 0A 00 00 A9

Treply_timeout < 255ms

BACnet Data Expecting Reply


May use Reply Postponed Practical use only in RTOS or queued data Single buffer, single thread, just reply Buffer, queue - match packet signature

MS/TP MAC Address


Master Node MAC 0-127 (0x00 - 0x7F) Slave Node MAC 0-254 (0x00-0xFE) Broadcast 255 (0xFF) DIP switch, dials, LCD Non-volatile, same after power cycle or reset Proposed Auto Addressing (DHCP, ZeroConfig)

10

You might also like