BACnet MS/TP is a token passing protocol. It is one of the data links supported by the BACnet standard. MS/TP is a master/slave token-passing protocol which uses standard serial ports on microcontrollers and EIA-485 transceivers. This network offers the lowest possible hardware cost for BACnet integration and is used by many companies for their device level network.
Token passing is a well-known networking access control mechanism. MS/TP uses this "token passing" system to control access to the network. A master node may initiate the transmission of a data frame only when it holds the token. Both master and slave nodes may transmit data frames in response to requests from master nodes. After the master node with the token sends several frames (defined by the Nmax_info_frames setting) the node then passes the token to the next master node.
Token frames are not acknowledged.
So, what are the BACnet MS/TP timing requirements?
There are two "levels" of responses in MS/TP:
When an MS/TP node receives a frame, which contains an application layer Confirmed-Request, it should respond in 250ms. It can either send the frame with the application-layer Confirmed-Response, or notify the sender that the Response will be sent later, by sending Reply-Postponed frame. In documentation this case is referred to as "responses to requests should be sent in 250ms".
Good to know! Though BACnet Standard defines the maximum timeout as 250ms, it is better to keep this timeout smaller. There was even a proposal to limit it to 225ms. By default, uBACstac uses 225ms as the timeout.
There is also a special case of creating a new TOKEN.
If the Token is lost, the node with the smallest MAC generates the new Token. The time slot for a node to start sending the new Token is 10ms. If other devices on the network need a few milliseconds to notice the presence of the new token, the token should better be generated in the first half of the time slot. That is: the transmission should be started with 5-10ms accuracy. This is mentioned in the documentation as a general requirement for the low-level MS/TP code to be capable of starting transmission in 5-10ms. (The wording is probably confusing, however: "requires guaranteed response in 5-10 ms time frame").
Finally, when a node transmits a frame, there should be no gaps in the transmission. The idle time between two octets should not exceed 20 bit times. At 9600 bps this amounts to 20ms, but for 115200 bps this timeout is less than 2ms. This is usually not a problem for an RS-485 software driver, so it is not specifically mentioned in the documentation.
For developing an application using Cimetrics uBACstac keep in mind that the application logic (and timing) in BACnet is completely decoupled from the low-level MS/TP FSM.
Basically, when an MS/TP device gets a Confirmed-Request it has two choices:
In the first case, the Application should encode the Response and pass it on to the Datalink so that the frame transmission starts in 225ms. The shorter this time is the better, because the whole MS/TP network stalls and waits. Formally, BACnet standard allows for 250ms. delay, but uBACstac by default uses a shorter timeout of 225ms.
In the second case, the application should notify the MS/TP Datalink that it is going to send Response later (the application creates a "reply postponed" message with the uBACstac function BACstacCreateReplyPostponed() and SENDs it to the Datalink), and then the device has a few seconds to prepare the Response and send it. In this case, the allowed time is determined by the value of "Apdu_Timeout" property of the Device Object of the device which initiated the Request. Usually it is in the range of 3-10 seconds.
The bottom line:
If an application can prepare the Response in a few milliseconds, then it should answer immediately. If it takes more than 100ms, then it is better postponing the reply in order to not slow down communication on the MS/TP network.
Comments will be approved before showing up.
cimetrics.com Legal Terms and Conditions
June 29, 2016
cimetrics.com (the "Site") is owned by Cimetrics Inc. ("Cimetrics").
PLEASE READ THESE TERMS AND CONDITIONS CAREFULLY BEFORE USING THIS SITE. YOU MAY NOT USE THIS SITE IF YOU DO NOT ACCEPT THE TERMS AND CONDITIONS.
The information herein provided is for general informative purposes only, and no warranties or representations are made with respect thereto. The information may contain inaccuracies or typographical errors. The information provided is subject to change at any time, and without notice. Changed information may include, but is not limited to, technical specifications and pricing. Binding declarations are only given after detailed enquiries.
BECAUSE THE INFORMATION IS NOT WARRANTED, ALL LIABILITY FOR THE ACCURACY OF THE INFORMATION IS EXPRESSLY EXCLUDED.
If you have been given a Password in order to gain access to certain information on this Site, or any other affiliates’ website, then you agree, as a condition of receiving said Password, that you shall keep the Password confidential. You shall only disclose the Password to your employees or agents who have a need to know. You are solely responsible for all activities that occur using your Password.
If you become aware of any unauthorized use of your Password, you agree to notify Cimetrics immediately. Cimetrics reserves the right to revoke your Password access at any time for any reason whatsoever.
Copyrights and Trademarks
All information provided on the web pages of Cimetrics.com is protected by copyright. It is prohibited to copy, process, modify or commercially distribute this information without the express written permission of Cimetrics.
Analytika, Infometrics, Metermetrics, BACstac, BACstac/DN, Secured by Cimetrics™ and BAS-o-matic are trademarks or registered trademarks of Cimetrics. The Analytika, Cimetrics, Infometrics and Metermetrics logos are trademarks or registered trademarks of Cimetrics. All other trademarks are owned by their respective companies.
Links to Other Websites