BACnet

As part of the Edge Xpert distribution, IOTech provides a Building Automation and Control Network (BACnet) Device Service. This allows Edge Xpert to read data from BACnet devices and to issue commands.

The BACnet Device Services integrate the BACnet protocol with Edge Xpert. There are two BACnet Device Services:

  • BACnet/IP
  • BACnet/MSTP

For more information, refer to the offical ASHRAE SSPC 135 website.

The BACnet Device Service supports the following key features:

  • The addition of the BACnetSupportedServices protocol

  • Discovery of BACnet devices as follows:

    • BACnet/IP: on localhost using the standard BACnet/IP port (47808)
    • BACnet/MTSP: using the DefaultDevicePath value in the TOML configuration file

    Devices are queried for their device name, which is used to match a device profile. To match the device name with a device profile, all characters following the first underscore are removed. If a matching device profile is found, the device is added to EdgeXpert. For example, a device with the name KMC.BAC.9001_00283 would be matched to a device profile called KMC.BAC.9001. Any discovered device is also queried for its supported services, which are set up in the BACnetSupportedServices protocol

  • Reading a single value from a BACnet device

  • Reading multiple values from a BACnet device when the BACnetSupportedServices protocol is present and DS-RPM-B is set

  • Writing a single value to a BACnet device

  • Writing multiple values to a BACnet device when the BACnetSupportedServices protocol is present and DS-WPM-B is set

The BACnet Device Service supports the following data types:

  • Boolean
  • String
  • UInt8, UInt16, UInt32
  • Int8, Int16, Int32
  • Float32
  • Float64

BACnet Attributes

The device profile defines what resources are available on a particular device. Ensure that the following profile attributes are defined in the YAML file:

Required Profile Attributes
Attribute Description
type The object type. Object types are specified in an enum in the bacenum.h file. For more information on BACnet objects, refer to the Sourceforge website
instance The object instance to be read
property The property to read from the object instance
index The array index of the property

BACnet/IP Examples

If you want to communicate with devices outside the subnet on which the device-bacnet-ip container runs, you must set up BACnet/IP Broadcast Management Device (BBMD):

The following examples illustrate how the BACnet/IP Device Service can be used:

These examples assume that the Edge Xpert services have been started with at least the --xpert-manager, --device-bacnet-ip and --bacnet-server parameters. They use the example bacnet-server provided as part of the open source BACnet stack. A suitable startup command would be as follows:

edgexpert up --xpert-manager --device-bacnet-ip --bacnet-server

BACnet/MSTP Examples

If using BACnet/MSTP, the docker container must be given access to the device path of the MTSP devices, as described in:

The following examples illustrate how the BACnet/MSTP Device Service can be used:

These examples assume that the Edge Xpert services have been started with at least the --xpert-manager, --device-bacnet-mstp and --bacnet-server parameters. They use the example bacnet-server provided as part of the open source BACnet stack. A suitable startup command would be as follows:

edgexpert up --xpert-manager --device-bacnet-mstp --bacnet-server

Note

The bacnet-server simulates a BACnet device. This allows you to run the examples without having a physical device attached.