Archive for the 'BACnet MSTP' Category

Cable Specifications for RS485 Networks - BACnet MSTP

The BACnet spec defined the media for MSTP as follows (2004) ;

“An MS/TP EIA-485 network shall use shielded, twisted-pair cable with characteristic impedance between 100 and 130 ohms. Distributed capacitance between conductors shall be less than 100 pF per meter (30 pF per foot). Distributed capacitance between conductors and shield shall be less that 200 pF per meter (60 pF per foot). Foil or braided shields are acceptable. The maximum recommended length of an MS/TP segment is 1200 meters (4000 feet) with AWG 18 (0.82 mm2 conductor area) cable. The use of greater distances and/or different wire gauges shall comply with the electrical specifications of EIA-485.”

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet MSTP Installation, RS485 and Cables

BACnet MSTP uses RS485 (also known as EIA485) as it physical layer. This is good and bad.

Search the Internet on RS485 you will find Bob Perrins’s article called the “THE ART AND SCIENCE OF RS-485.” It is his reference to Art that makes RS485 bad. What he means is that RS485 is often non-trivial and getting a network working can rely more on experience and experimentation.

Here is our simplified advice:

1. RS485 is a 3 conductor network. You take a huge risk by not installing the 3rd conductor. You risk blowing 485 ports, you risk unstable operation (works sometimes and doesn’t work other times) and finally you risk re-installation. For a more detailed discussion read this article. The more power sources used to power devices, the greater the physical separation of devices, the less well grounded devices and power sources are the greater the risk. Remember this statement : The so called Ground Terminal on a RS485 interface is not a connection to ground. It is a common reference signal. The voltage level on the Tx/Rx conductors are measured relative to this voltage level.

You can (if you must) use a shield drain wire as the 3rd conductor (ground reference conductor)

2. Always connect the ground reference conductor first if you are connecting a device that is powered up or you are connecting your laptop an operating network.

OR

Always choose devices that have optical isolation - this almost always will protect the RS485 transmitter/receivers.

3. You can get away without the shield. The twisted pair used for Tx and Rx is more effective at noise cancellation than the shield.

4. Take care where you run your cables. It seems obvious not to wind your cable around other cables or sources of electricity/magnetism. People are often surprised to find that the worst source of induced noise are switching DC loads. Another big culprit are Variable Frequency drives.

5. Cable selection does make a difference.

All cables offer impedance (resistance). Some cables are designed so that the impedance is relatively independent of distance. You want one of these cables. A clue to knowing if you selected one is to look at the cable’s Nominal Impedance. If they quote a number such a 100Ohms you have a good cable. If they quote an impedance per meter/foot you have chosen the wrong kind. Wrong in the sense – to determine the value of terminating resistors now requires measurements and calculations. Choose low capacitance cables.

Can you use Cat5 cable ? Yes. Use one pair for Tx,Rx and a conductor from another pair for the ground reference signal.

We recommend these two cables.

Belden 3106A

Multi-Conductor - EIA Industrial RS-485 PLTC/CM
22 AWG stranded (7×30) tinned copper conductors, Datalene® insulation, twisted pairs, overall Beldfoil® shield (100% coverage) plus a tinned copper braid (90% coverage), drain wire, UV resistant PVC jacket.

Belden 3107A

Multi-Conductor - EIA Industrial RS-485 PLTC/CM
22 AWG stranded (7×30) tinned copper conductors, Datalene® insulation, twisted pairs, overall Beldfoil® shield (100% coverage) plus a tinned copper braid (90% coverage), drain wire, UV resistant PVC jacket.

6. How do you put more than 32 devices on a single RS485 trunk ?

The simple answer is use a repeater but in practice one isn’t always necessary.

The RS485 stardard is based on 32 devices. Since the standard was developed most RS485 chips present less than the full unit load originally specified. Today you get half and quarter load devices. Thus to see how many devices you can install you simply get the data sheets and add the loads. Look for “UL” on the data sheet. It stands for Unit Load.

7. Cable Lengths and Baud Rates

Practically speaking you can go up to 4000 feet at baud rates up to 76800 baud. Above that you need to do a little math and reduce the length. For example, at 115k baud your cable should not be much longer than 2500 feet.

However, the higher the baud rate the more sensitive the cable is to the quality of installation – issues like how much twisted pair is unwound at each termination start to become very very important.

Our advise: For longer networks with lots of devices, choose 38k400 baud over 76k800 baud and optimize using COV, separate networks and by setting the Max Master to a lower number.


Source: Ten Ways to Bulletproof RS-485 Interfaces National Semiconductor
Application Note 1057 John Goldie October 1996

8. How many devices to install on a single RS485 Trunk (Bandwidth Issues)

How many devices to install on a single RS485 Trunk (Bandwidth Issues)

There are non electrical considerations to determine how many devices you put on an MSTP network.

The chart below illustrates (from one installation) how little of the bandwidth is used to transfer data. The APDU’s are application layer message that poll and respond with property values – they do work for us as data consumers. The rest is used to maintain the network – passing the token around and looking for new devices.

It’s not possible to provide a calculator to work out how many devices to install on a single network but the following list provides some help in assessing bandwidth considerations.

  • How many of the devices will be BACnet slaves.

    Token passing and looking for new devices on the MSTP trunk consumes a fair amount of bandwidth.

    A BACnet slave can be read/written but never gets the token. So it can’t initiate any messages because it never gets the token. The more slaves the fewer token passes. Typically you are not able to put a device in slave mode. Most vendors implement their devices as masters (ie token passing devices).

  • How many Objects in each device are you interested in monitoring?

    The more you read and the greater the frequency the more bandwidth that will be consumed.

    It takes approx 30 bytes to poll for a single property. It takes about 40 bytes to reply. A token is 8 bytes as is a Poll for master.
    Assume that 50% of your bandwidth will be used by overhead (token, poll for master).
    Divide the baud rate by 10 to get bytes per seconds.
    Using a number like 30+40=70 as a best case and 100 as a worst case (obviously reading descriptions will take more) multiply by the number of objects and properties you are going to poll on a regular basis.

    Here are some typical numbers assuming the device doesn’t support the ‘multiple’ services (see below).

    Baud 38400
    Bytes per sec (divide Baud by 10) 3840
    Overhead use (token and poll for master) 50%
    Byte per sec for payload (a) 1920
    Typical Poll and response for a single property (b) 70
    Number of properties that can be polled per sec (=a/b) 27.42857
    Typical number of props that will polled per object 4
    (pres value, status_flags, reliability, out of service)
    Number of objects per sec 6.857143
  • How many properties from each of these objects?
  • What is the baud rate?
  • What is Max Master Set to?

    Every few cycles each (master) token passing device on the network must look to see if there are new devices. Max Master determines the biggest address that must be searched for. Each search involves sending a message and waiting for a response or a timeout (if the devices isn’t there). Timeouts cost time. The higher the number of Max Master (default is 127) the more potential devices must be searched for. If you use Max master to improve bandwidth then you must adjust it in each device.

  • Do the devices support the “Read/Write Property Multiple” services or must each property be read in a separate message.

    Find the answer to this question by reading the BIBs statement for each device or you could explore the device object of the device, find the property called BACnetServicesSupported and then look at the 14th item in the array to see if Read Property Multiple is supported and the 16th for Write Property Multiple. However, we have found that a large number of devices don’t display this information.

    Obviously, if you can read a chunk of properties in one message you will be better off than if you can only read a single one.

  • Can you use BACNet’s COV mechanism.

    COV stands for Change of Value. When a device supports COV another device / application can subscribe to receive notifications when an object property changes. This means the data client doesn’t have to poll for data continuously but can wait passively to be notified of the change. This reduces the number of messages on a network dramatically.

  • Some devices are slower than others.

    BACnet allows up to 15 msec for a device to use the token. Since most messages on a MSTP network are token passes a device that uses the token in 5 msec will consume much less bandwidth than one that takes 15msec. (A number of vendors relax this requirement to allow for other vendors implementations. The more relaxed the more bandwidth is consumed doing nothing.)

9. What can go wrong with 485 ?

Lets say you adopted all the best practices for installation of the network but you get intermittent or unacceptable performance because of packet loss, noise, collisions … Then you should consider hiring an expert to resolve your problems because now you are in the ‘Art’ part of RS485. These are some of the things they will look at.

  • Reflections

    Without a scope and expertise you wont know this is a factor. Its easy and cheap to eliminate. Look at the cable spec. Find the nominal impedance. Buy two resistors of the same value. At each end of the trunk install the resistors between the Tx and Rx terminals. If you don’t have obvious ends of the trunk (because you created a star) then we recommend re-cabling to form a linear trunk or we wish you luck.

    Some devices have terminating resistors built into them. If the vendor did a poor job, the default is to have the resistor active and they must be disabled unless they are the terminating devices on the network. Read vendor docs.

  • Biasing, Idle State Biasing, Fail Safe Biasing, Anti Aliasing

    There are a whole string of terms uses as synonyms to describe this phenomenon.

    To use two wires ( as opposed to full duplex 4 wire) for RS485 each devices transmitter and receiver must be set to an idle state to release the line for others use. Releasing the line means allowing it to ‘float’. It must not be allowed to float at any voltage level so devices have pull up/down resistors to pull the line to an allowable ‘floating’ voltage. (the floating state is also known as the tri-state. ) The load presented by other devices on the network affects this floating so the resistor values may need to be changed depending on the number of devices installed and the values of the pull up/down resistors they are using. (You can imagine how tricky its going to be to resolve this). If a device floats out of the specified range then to other devices it will look like the floating devices isn’t floating at all. The other devices will think that it is transmitting or receiving and thus blocking the line.

    The simplest way of knowing if this is a factor – Does the device work properly when it is the only device on the network ?. When you install it in the full network other devices or this device stops working properly. This device and/or the pull up/down resistors of other devices are candidates for investigation.

    A number of vendors have a range of pull up/down resistors installed and allow you to change the selection using software or jumpers.

  • Line Drive On / Off

    To use two wires for RS485 each devices transmitter and receiver must be set to an idle state to release the line for others use. When a device wants to send it must grab the line. When it has finished sending it must release the line. You can see there are potential problems here. What happens if one device waits too long after sending its last bit before releasing the line – its possible that the other devices will miss some bits of data.

10. Take care with the topology. The best topology is a single trunk that in-outs on the terminal blocks of each device it connects. What do we mean by best ? We mean the choice which is least likely to cause problems.

Best arrangement. (Showing TX conductor for reference only)

Getting worse. Making the connections to the RS485 terminals, drops instead of connections starts to give the electrical signals all kinds of complicated paths for reflections and harmonics. Its obvious that if the drops are long and are not twisted then you also have more chance to induce noise. (Showing TX conductor for reference only)

Worst. Avoid Star configurations. They are so much harder to debug when it gets tricky. (Showing TX conductor for reference only)

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet MSTP – An Introduction

The MS stands for Master - Slave although in practice there are not many slaves out there.
The TP stands for Token Passing.

This flavor of BAcnet is most commonly used to connect field devices to controllers / routers / control applications.

The physical layer uses RS485 which allows up to 128 devices to be installed on a single network with a max physical length of 4000ft and speeds up to 115k baud. Using repeaters allows the length to be increased. Compare to Ethernet where the spec allows a max of 100 meters (330ft) on a single unrepeated segment.

Common baud rates are 19200, 38400 and 76800. All devices must operate at the same baud rate. More and more devices can auto sense the baud rate and configure themselves correctly.

We divide the messages on a MSTP network into two categories:
1. Overhead (token, poll for master…)
2. Application. These carry payloads that we have an interest in.

Only a device with the token can initiate an application layer message. It can send the message to any device on the network. Some messages demand an instantaneous reply, some don’t. The receiving device doesn’t need the token to respond. There is a limit to how many application layer messages a device can send before it must pass the token on.

The benefits of token passing networks are the following:
1. They are self healing
2. They can discover new devices
3. They ensure each device gets its chance
4. They avoid collisions making network performance (somewhat) deterministic

A disadvantage of the token system is that any one device gets a limited use of the bandwidth. Thus a device may need to keep an internal queue of application layer messages it wants to send, waiting to use the token. We have encountered some vendor systems which fill there queue and then drop subsequent messages without notifying the user of the problem. Limited access combined with the overhead makes it easy to use up all the bandwidth on the network if there are many devices with many objects and many properties of interest.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet MSTP Topology

Take care with the topology. The best topology is a single trunk that in-outs on the terminal blocks of each device it connects. What do we mean by best ? We mean the choice which is least likely to cause problems.

Best arrangement. (Showing TX conductor for reference only)

Getting worse. Making the connections to the RS485 terminals, drops instead of connections starts to give the electrical signals all kinds of complicated paths for reflections and harmonics. Its obvious that if the drops are long and are not twisted then you also have more chance to induce noise. (Showing TX conductor for reference only)

Worst. Avoid Star configurations. They are so much harder to debug when it gets tricky. (Showing TX conductor for reference only)

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet MSTP Passive Slave Node Description

The BACnet Master Slave Token Passing (MSTP) LAN works on a token passing principle. A master node has to gain access to a token to be able to use the transport medium. Only master nodes are allowed to send and receive tokens on the MSTP network. Passive slave nodes on the other hand may only transmit a data frames on the network in response to a request from a master nodes. Passing the token represents overhead in the sense that the messages used for managing the token do not carry data that is useful to automation or monitoring.

On the BACnet MSTP network frame types are used as a mechanism to allow passive slaves node’s, that never holds the token, a means to return replies.

A valid MAC address for a passive slave node on the BACnet MSTP network may range between MAC addresses 0 to 254. The MAC addresses range 0 to 127 is a shared address range between both master and passive slave nodes.

Practical Implications of the differences between using Masters and Passive Slaves.

Many vendors do not provide a choice between Master and Slave configuration of their field devices. They are masters and there is nothing you can do about it.

Slaves cannot be discovered

Because slave’s cant reply to the who-is message they cannot be discovered. A consequence of this is that you have to know their Mac address in advance and you have to configure your client to poll that specific address.

Practically speaking this is less of a problem than you would think. Some client software suites allow you to discover devices objects and properties and then drag and drop these onto animation objects on the Scada/HMIS screens. A few of these are intelligent enough to discover objects and properties of a passive slave provided you provide the Mac Address. Some Scada/HMI applications require you to type in the object and property manually so there is no disadvantage to use passive slave nodes.

Masters burn bandwidth

So you must weigh this small one time engineering cost against the huge bandwidth burden using many masters on a network imposes. The charts below give you an idea of how big the burden is.

Based on traffic on a simple network with a single master and a single field device. In test 1 we configured the field device as a Master. In test 2 we configured the field device as a slave.

Chart 1 : Typical ratio of payload (APDU) to overhead (Token) when using Masters.

APDU = 5% (Useful)

Token = 95% (Overhead)

Chart 2 : Typical ratio of payload (APDU) to overhead (Token) when using a Slave device.

APDU = 31% (Useful)

Token = 69% (Overhead)

Additional Information

The frames and frame types that will be ignored by a passive slave node are as follows:

  • Frames with a destination address not equal to this station address (TS)
  • Frame with destination address equal to 255 (broadcast address) and frame type equal to BACnet_Data_Expecting_Reply, Test_Request or a proprietary type known to the node that expects a reply. (such frames may not be broadcasted)
  • Frame types Token, Poll_For_Master, Reply_To_Poll_For_Master, Reply_Postponed or a standard or proprietary frame type not known to this station.

The frames and frame types excepted by a passive slave node are as follows:

  • Frames with destination address equal to this station address (TS) and with frame type Receive_data_no_reply, Test_Response or proprietary type known to the node that does not expect a reply.
  • Frames with destination address equal to this station address (TS) and with frame type Receive_Data_Expecting_Reply, Test_Request or proprietary type known to this station that expects a reply.

The passive slave node needs to respond, to a frame expecting a reply, within a specified time frame (Not exceed Treply_delay) from when receiving the last octet of the requesting frame. If this time period has expired the slave will not respond to the frame and will return to its Idle mode.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

How do you put more than 32 devices on a single RS485 trunk ?

The simple answer is use a repeater but in practice one isn’t always necessary.

The RS485 standard is based on 32 devices. Since the standard was developed most RS485 chips present less than the full unit load originally specified. Today you get half and quarter load devices. Thus to see how many devices you can install you simply get the data sheets and add the loads. Look for “UL” on the data sheet. It stands for Unit Load.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

What can go wrong with 485 and BACnet MSTP ?

Lets say you adopted all the best practices for installation of the network but you get intermittent or unacceptable performance because of packet loss, noise, collisions … Then you should consider hiring an expert to resolve your problems because now you are in the ‘Art’ part of RS485. These are some of the things they will look at.

Reflections

Without a scope and expertise you wont know this is a factor. Its easy and cheap to eliminate. Look at the cable spec. Find the nominal impedance. Buy two resistors of the same value. At each end of the trunk install the resistors between the Tx and Rx terminals. If you don’t have obvious ends of the trunk (because you created a star) then we recommend re-cabling to form a linear trunk or we wish you luck.

Some devices have terminating resistors built into them. If the vendor did a poor job, the default is to have the resistor active and they must be disabled unless they are the terminating devices on the network. Read vendor docs.

Biasing , Idle State Biasing, Fail Safe Biasing, Anti Aliasing

 There are a whole string of terms uses as synonyms to describe this phenomenon.

To use two wires ( as opposed to full duplex 4 wire) for RS485 each devices transmitter and receiver must be set to an idle state to release the line for others use. Releasing the line means allowing it to ‘float’. It must not be allowed to float at any voltage level so devices have pull up/down resistors to pull the line to an allowable ‘floating’ voltage. (the floating state is also known as the tri-state. )  The load presented by other devices on the network affects this floating so the resistor values may need to be changed depending on the number of devices installed and the values of the pull up/down resistors they are using. (You can imagine how tricky its going to be to resolve this). If a device floats out of the specified range then to other devices it will look like the floating devices isn’t floating at all. The other devices will think that it is transmitting or receiving and thus blocking the line.

The simplest way of knowing if this is a factor - Does the device work properly when it is the only device on the network ?. When you install it in the full network other devices or this device stops working properly. This device and/or the pull up/down resistors of other devices are candidates for investigation.

A number of vendors have a range of pull up/down resistors installed and allow you to change the selection using software or jumpers.
 

Line Drive On / Off

To use two wires for RS485 each devices transmitter and receiver must be set to an idle state to release the line for others use. When a device wants to send it must grab the line. When it has finished sending it must release the line. You can see there are potential problems here. What happens if one device waits too long after sending its last bit before releasing the line - its possible that the other devices will miss some bits of data.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet MSTP (RS485), Cable selection does make a difference.

All cables offer impedance (resistance). Some cables are designed so that the impedance is relatively independent of distance. You want one of these cables. A clue to knowing if you selected one is to look at the cable’s Nominal Impedance. If they quote a number such a 100Ohms you have a good cable. If they quote an impedance per meter/foot you have chosen the wrong kind. Wrong in the sense – to determine the value of terminating resistors now requires measurements and calculations. Choose low capacitance cables.

Can you use Cat5 cable ? Yes. Use one pair for Tx,Rx and a conductor from another pair for the ground reference signal.

We recommend these two cables.

Belden 3106A

Belden 3106A - RS485 Cable 

Multi-Conductor - EIA Industrial RS-485 PLTC/CM
22 AWG stranded (7×30) tinned copper conductors, Datalene® insulation, twisted pairs, overall Beldfoil® shield (100% coverage) plus a tinned copper braid (90% coverage), drain wire, UV resistant PVC jacket. 
 

Belden 3107A

Belden 3107A - RS485 Cable 

Multi-Conductor - EIA Industrial RS-485 PLTC/CM
22 AWG stranded (7×30) tinned copper conductors, Datalene® insulation, twisted pairs, overall Beldfoil® shield (100% coverage) plus a tinned copper braid (90% coverage), drain wire, UV resistant PVC jacket.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

Cable Lengths and Baud Rates for RS485 or BACnet MSTP

Practically speaking you can go up to 4000 feet (1200m) at baud rates up to 76800 baud. Above that you need to do a little math and reduce the length. For example, at 115k baud your cable should not be much longer than 2500 feet.

However, the higher the baud rate the more sensitive the cable is to the quality of installation – issues like how much twisted pair is unwound at each termination start to become very very important.

Our advise: For longer networks with lots of devices, choose 38k400 baud over 76k800 baud and optimize using COV, separate networks and by setting the Max Master to a lower number.
RS485 Cable Length Vs Distance

Image Source: Ten Ways to Bulletproof RS-485 Interfaces National Semiconductor
Application Note 1057 John Goldie October 1996

What about BACnet MSTP ?

This is how the 2004 version of the spec defines the MSTP medium:

“An MS/TP EIA-485 network shall use shielded, twisted-pair cable with characteristic impedance between 100 and 130 ohms. Distributed capacitance between conductors shall be less than 100 pF per meter (30 pF per foot). Distributed capacitance between conductors and shield shall be less that 200 pF per meter (60 pF per foot). Foil or braided shields are acceptable. The maximum recommended length of an MS/TP segment is 1200 meters (4000 feet) with AWG 18 (0.82 mm2 conductor area) cable. The use of greater distances and/or different wire gauges shall comply with the electrical specifications of EIA-485.”

 In other words, if it complies with the RS485 spec it meets the BACnet spec.

The cable gauge only changes the cables impedance. You should already be selecting a cable whose nominal impedence is relativly independent of length such as Belden 3106a. If you are using the correct cable then the gauge should have little effect on the carrying capacity except at very high frequencies.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have

BACnet Objects and Properties

Data inside a BACnet device is organized as a series of objects. Each object has a type and a set of properties. There is always at least one object in a device – it is used to represent the device itself . The other objects represent the device’s data.

In practical terms think of a simple thermostat. Our example is a simple device that has a temperature sensor, allows the set point to be changed locally or remotely, has a local remote selection and reports there is an internal fault by reporting its status as normal/abnormal.

Commonly used properties
Object Type:  Popular Object Types: Analog Input, Analog Output, Binary Input, Binary Output.

Instance Number:  A number that must be not be repeated for any other object of the same type.
Name: The optional property called ‘Description’ is usually used to describe the object. This porperty is often no more than a tag.
Present Value: The current value of the object. BACnet has ways of telling you if the present value is valid – it uses a property called ‘Reliability’.

Did you like this post?

Subscribe To The RSS Feed!
To catch many more articles like this in the future, make it easy on yourself and subscribe to me via RSS. You will not regret it!

Do you have a question?
We will do our best to try and solve any building automation, protocol, integration problem you may have