« August 2009 | Main | June 2009 »
Monday, July 20, 2009
Using the BACnet® Discovery Tool – BDT
When applying BACnet routers in the field is there a quick way to determine if the router is successfully communicating to attached devices? We think there is with the BACnet Discovery Tool (BDT). Although limited to very simple tasks, it is easy to use — and it is FREE!
The BACnet Discovery Tool (bdt.exe) is a BACnet/IP application for Windows® that is easy to install and use. It is an excellent means for verifying communication with MS/TP devices that are being accessed through BACnet/IP routers such as those available from Contemporary Controls: the BASRT-B DIN-rail mounted BACnet/IP-to-MS/TP router — or its portable counterpart, the BASRTP-B.
The tool is based on an open source BACnet protocol stack developed by Steve Karg. His project is described at:
At just over 520 kB, bdt.exe is small — making it a snap to download. When you download the tool, you can save and run it from anywhere on your computer's hard drive.
We use BDT with our BACnet Interoperability Board. On this board we mount equipment from different BACnet vendors to prove our routers operate with different equipment configurations. In the photo at the end of this article you will notice mostly Alerton devices being tested, but we can change out equipment as needed. Although we have more elaborate BACnet tools, BDT is a vendor-neutral tool that can quickly discover BACnet devices. To give you an idea on how this works, we configured our board with three MS/TP segments each tied to a dedicated BAS Router. Each BAS Router has its BACnet/IP side tied to a common network through one of our Ethernet switches. Attached to the network is a workstation running BDT.
We launch bdt.exe by double-clicking its filename or icon. As soon as the application starts, it opens in its own window. It immediately activates its Who-Is service and transmits one Who-Is query. If we do not see any response within a few seconds, we can try pinging the IP address of the router to confirm that its IP channel is functional. NOTE: Because bdt.exe sends a BACnet/IP Who-Is (not a BACnet/Ethernet Who-Is) it will not discover any devices which only support BACnet/Ethernet.
Each I-Am response is reported on screen as soon as received. As shown in the screen below, each response also identifies the associated Device Instance number and Vendor identifier. The first three responses are from Contemporary Controls whose vendor number is 245. The remaining devices are identified as manufactured by Alerton whose vendor number is 18.
NOTE: For ease of illustration, the screen capture has been altered so that two lists that actually appear one-after-the-other , are here displayed side-by-side. Also, both lists (the responses on the left and the device information on the right) are abbreviated.
After all of the I-Am responses have been received, bdt.exe summarizes the information it has received as illustrated in the right portion of the sample screen. In this example, you see a list of many respondents on the left. The associated summary list on the right reports each Device Instance, the device’s maximum Application Protocol Data Unit (MaxAPDU) value and the number of the network ( Net) on which it resides. A Net value of 0 represents the network to which the BACnet Discovery Tool is attached — and so it must be an IP network. (This identification is reinforced by a MaxAPDU value of 1476 — typical of an Ethernet network.) Since the first three responses in the device summary on the right show that devices 202162, 202161 and 202160 have Net values of 0, the originators of the first three I-Am messages must be BACnet/IP devices — in this case, they are the three BAS routers.
The second column (MAC) of the summary report on the right, requires detailed explanation. The MAC value is a composite of two pieces of hexadecimal information obtained from the BACnet/IP device involved in each I-Am response. The first eight digits represent the IP address of the BACnet/IP equipment that has delivered the I-Am response. The last four digits report that device’s BACnet/IP UDP port number.
NOTE regarding the MAC value: there is a significant difference between the BACnet/IP protocol (used by bdt.exe) and the BACnet Ethernet protocol. The bdt.exe MAC value is not the Ethernet MAC address as you might expect. This is because BACnet/IP protocol uses the device IP address as the MAC value. Only BACnet Ethernet protocol uses the actual Ethernet MAC address as the MAC value.
The equipment delivering the I-Am response could itself be simply a BACnet/IP device (as is the case with the first three respondents) — or it could a router that is acting as an intermediary for devices on the far side of the router (which is the case with the remaining respondents in our example).
If the response Device Instance is that of an MS/TP device, then the associated MAC information pertains only to the router that delivered the response.
The first response shows device 202162. Its information tells us it is a BACnet/IP device (Net value 0) whose MAC value reported an IP address of 0A0000D9 and a BACnet standard UDP port number of BAC0.
Responses 4 and 5 are for devices 3015 and 3002, respectively. Because these two lines have identical MAC values, their I-Am responses must have passed through the same BACnet/IP router — a fact also indicated by the matching network numbers of 100. In this case the router’s IP address is seen to be C0A85C64 — and the router used UDP port BAC0. NOTE: If you wish to convert the foregoing hexadecimal values into their decimal equivalents, the UDP port is simply 47808. The displayed hexadecimal IP address value converts to a dotted decimal IP address by converting two digits at a time to decimal. In this example, segment C0A85C64 into its quad address hex values: C0-A8-5C-64 — then these four hex pairs convert to 192.168.92.100.
Note that response 6 (for device 3044) passed through a different router that is identified by a MAC value of C0A85C65BAC0, and operating on network number 101. And also see that the final response (for device 3043) passed through yet another router identified by a MAC value of C0A85C66BAC0 and residing on network 102.
Finally, the last line in the sample screen indicates that once you have finished examining its display you can end the application by pressing any key. When you terminate the application, its window closes automatically.
You can download this handy, free application by pointing your browser to:
http://www.ccontrols.com/exe/bdt.exe
Friday, July 03, 2009
BACnet MS/TP MAC Addresses — Any Significance to the Addresses?
There are 256 possible BACnet MS/TP addresses ranging from 0–255, however, you cannot assign a device to 255 since it is reserved as a broadcast address. No device is allowed to have a source address of 255. There is another restriction on addressing. Master devices, those who participate in the token-passing protocol, must be addressed from 0 to 127. Addresses from 128 to 254 are reserved for slaves who do not participate in the token passing — however, they can occupy lower addresses as well. Each MS/TP master must be assigned a unique address in the valid range, but is there any significance to the value of the address? Actually, there is.
If you study Johnson Controls’ (JCI) MS/TP Communications Bus Technical Bulletin, JCI states that MAC address 0 is reserved for bus controllers and cannot be changed. Addresses 13 are also reserved. Therefore, field controllers should begin being addressed from 4 on up with no gaps in the sequence. This allows the best possible performance since no time is wasted passing tokens to non-existent devices. Another parameter comes into play and that is Max. Master. This parameter does not mean the maximum number of devices but the highest address used by any master in the network. We know you can only address up to 127 masters — so this is the default value for almost all devices. However, this is not the most efficient setting since the device with the highest address will periodically poll-for-master (PFM) up to the Max Master limit. This is a waste of time if you only have 20 devices addressed from 0–19. Ideally, you would like all devices to have their Max Master set to the address of the highest master address on the network. However, seldom do you see this parameter changed.
There is significance to being the MAC 0 “guy”. By having the lowest possible address, you are the first in line to begin PFM in case there is a network disruption. If you have Max Info Frames set high, and you receive the token, you can quickly flush your queue before the other devices get the token and begin polling for nonexistent devices. So if you are a bus controller or a BACnet/IP to MS/TP router like the BASRT-B, assign yourself MAC 0 for the best performance.