Skip to content

BACnet Device Service Component

The BACnet Device Service components integrate the BACnet protocol with Edge Xrt. There are two BACnet Device Services:

  • BACnet/IP
  • BACnet/MSTP

For further information on the protocol, refer to the official ASHRAE SSPC 135 website.

The BACnet Device Service components support the following features:

  • Device discovery and profile generation
  • Change of Value subscription
  • Reading and writing properties of BACnet devices
  • Multiple property read/writes
    • Data Sharing - ReadPropertyMultiple - B
    • Data Sharing - WritePropertyMultiple - B

Note

XRT can be configured to automatically group schedules together creating larger batched readings, improving efficiency and throughput. For information on how to configure this feature please refer to the AutoBatchSize and AutoBatchTimeout settings described in Device Service Component Configuration.

BACnet Device Service Configuration

BACnet/IP Configuration

Note

The core components required for running BACnet/IP (and all other device services) are contained in Device Service Component Configuration. Please refer to this page to ensure the appropriate core components are assigned before continuing.

With those components assigned, there are also the following optional BACnet/IP Driver options that can be used to configure the device service:

BACnet/IP Driver Options

Parameter Type Description Default Value
DeviceObject Map InstanceID
  • BACnet device instance ID
  • UInt32
0
ObjectName
  • BACnet device name
  • String
IOTech Edge Xrt BACnet Device Service Component
VendorName
  • BACnet device vendor name
  • String
IOTech
VendorID
  • BACnet device vendor identifier
  • UInt16
1313
Location
  • BACnet device location
  • String
UK
Description
  • BACnet device description
  • String
IOTech Edge Xrt BACnet Device Service Component
ModelName
  • IOTech Edge Xrt BACnet
  • String
IOTech Edge Xrt BACnet
ApplicationSoftware
  • BACnet device application software version
  • String
1.2
NetworkInterface String Network interface name used to communicate to BACnet devices Primary interface determined by the device service if not set
Port UInt16 Port the BACnet communication will occur over 47808
APDUTimeout UInt32 The timeout on a confirmed request in milliseconds 3000
APDURetries UInt8 The maximum number of retries of a confirmed request 3
MultiBatchSize UInt8 Maximum number of properties in a multi read/write. If the request contains more properties than this limit, then another batch of multi read/writes will be performed. 20
MultiRead Bool Enable multiple property reads true
MultiWrite Bool Enable multiple property writes true
CancelStaleCOV Bool Any COV notifications received that are not expected will be responded to with a cancellation request. true
BBMDAddress String IP Address of the BBMD that the device service will register to as a foreign device If not set, then the device service assumes it is not acting as a foreign device
BBMDPort UInt16 Port number of the foreign device registration to the BBMD 47808

Will only be used if BBMDAddress is set
BBMDTimeToLive UInt16 How long the foreign device registration is set to last in seconds.
The device service will automatically re-establish registration before this time elapses.
65535

Will only be used if BBMDAddress is set
DiscoverMode String Determines the range of properties that will be discovered on a device when generating a profile.

The three options are:
  • All - Will attempt PROP_ALL requests which receive all properties of an object. Upon failure of that call, it will try to read the property list of each object instance and query each property. Upon failure of that, it will try to read the standard and optional properties of each object instance on the device according to the BACnet specification of that particular object.
  • Mandatory - Will only query the mandatory properties of each object instance on the device according to the BACnet specification of that particular object.
  • PresentValue - Will only query present value.
All
DiscoverProperties List of UInt32 values Used to filter for only the properties specified when generating a BACnet device profile.

Property types are specified in an enumeration: bacenum.h file
If empty or not included, no property filtering will occur
DiscoverObjects List of UInt32 values Used to filter for only the object types specified when generating a BACnet device profile.

Object type values are specified in an enumeration: bacenum.h file
If empty or not included, no object filtering will occur
DiscoveryDuration UInt16 Controls the length of time to wait between Who-Is broadcasts in milliseconds. 3000
DiscoveryRetries UInt8 Controls how many extra Who-Is broadcasts are made during a discovery call. 1
IAmBroadcastInterval UInt16 Controls how often the device service will broadcast an I-Am message to the network in minutes.

Any devices provisioned with an IP address will be contacted directly.
30

A template of the BACnet/IP device service configuration file is provided where all the driver options have been set to demonstrate their usage:

{
  "Library": "libxrt-bacnet-ip-device-service.so",
  "Factory": "xrt_bacnet_ip_device_service_factory",
  "Name": "bacnet_ip",
  "TelemetryTopic": "xrt/devices/bacnet_ip/telemetry",
  "RequestTopic": "xrt/devices/bacnet_ip/request",
  "ReplyTopic": "xrt/devices/bacnet_ip/reply",
  "DiscoveryTopic": "xrt/devices/bacnet_ip/discovery",
  "StateDir":"./deployment/state",
  "ProfileDir": "./deployment/profiles",
  "Scheduler": "sched",
  "Logger": "logger",
  "ThreadPool": "pool",
  "Bus": "bus",
  "Driver": {
    "DeviceObject": {
      "InstanceID": 0,
      "ObjectName": "IOTech Edge Xrt BACnet Device Service Component",
      "VendorName": "IOTech",
      "VendorID": 1313,
      "Location": "UK",
      "Description": "IOTech Edge Xrt BACnet Device Service Component",
      "ModelName": "IOTech Edge Xrt BACnet",
      "ApplicationSoftware": "2.0"
    },
    "NetworkInterface": "eno1",
    "Port": 47808,
    "APDUTimeout": 4000,
    "APDURetries": 2,
    "MultiBatchSize" : 25,
    "MultiRead" : true,
    "MultiWrite" : true,
    "CancelStaleCOV": true,
    "BBMDAddress": "172.17.0.2",
    "BBMDPort": 47808,
    "BBMDTimeToLive": 60000,
    "DiscoverMode": "All",
    "DiscoverProperties": [75, 36, 28, 81, 85, 103, 117, 87],
    "DiscoverObjects": [8, 0, 1, 2, 3, 4, 5, 13, 14, 19],
    "DiscoveryDuration": 4000,
    "DiscoveryRetries": 2,
    "IAmBroadcastInterval": 30
  }
}

BACnet/MSTP Configuration

Note

The core components required for running BACnet/MSTP (and all other device services) are contained in Device Service Component Configuration. Please refer to this page to ensure the appropriate core components are assigned before continuing.

With those components assigned, there are also the following BACnet/MSTP Driver options that can be used to configure the device service. All of them are optional, except SerialInterface which is mandatory.

BACnet/MSTP Driver Options

Parameter Type Description Default Value
DeviceObject Map InstanceID
  • BACnet device instance ID
  • UInt32
0
ObjectName
  • BACnet device name
  • String
IOTech Edge Xrt BACnet Device Service Component
VendorName
  • BACnet device vendor name
  • String
IOTech
VendorID
  • BACnet device vendor identifier
  • UInt16
1313
Location
  • BACnet device location
  • String
UK
Description
  • BACnet device description
  • String
IOTech Edge Xrt BACnet Device Service Component
ModelName
  • IOTech Edge Xrt BACnet
  • String
IOTech Edge Xrt BACnet
ApplicationSoftware
  • BACnet device application software version
  • String
1.2
SerialInterface String Path to the RS-485 connection on the host No default, this must be set by the user
APDUTimeout UInt32 The timeout on a confirmed request in milliseconds 60000
APDURetries UInt8 The maximum number of retries of a confirmed request 3
MultiBatchSize UInt8 Maximum number of properties in a multi read/write. If the request made contains more properties than this limit, then another batch of multi read/writes will be performed 20
MultiRead Bool Enable multiple property reads true
MultiWrite Bool Enable multiple property writes true
CancelStaleCOV Bool Any COV notifications received that are not expected will be responded to with a cancellation request true
DiscoverMode String Determines the range of properties that will be discovered on a device when generating a profile.

The three options are:
  • All - Will attempt PROP_ALL requests which receive all properties of an object. Upon failure of that call, it will try to read the property list of each object instance and query each property. Upon failure of that, it will attempt to read the standard and optional properties of each object instance on the device according to the BACnet specification of that particular object.
  • Mandatory - Will only query the mandatory properties of each object instance on the device according to the BACnet specification of that particular object.
  • PresentValue - Will only query present value
All
DiscoverProperties List of UInt32 values Used to filter for only the properties specified when generating a BACnet device profile.

Property types are specified in an enumeration: bacenum.h file
If empty or not included, no property filtering will occur
DiscoverObjects List of UInt32 values Used to filter for only the object types specified when generating a BACnet device profile.

Object type values are specified in an enumeration: bacenum.h file
If empty or not included, no object filtering will occur
DiscoveryDuration UInt16 Controls the length of time to wait between Who-Is broadcasts in milliseconds. 10000
DiscoveryRetries UInt8 Controls how many extra Who-Is broadcasts are made during a discovery call. 1
IAmBroadcastInterval UInt16 Controls how often the device service will broadcast an I-Am to the network in minutes. 30

A template of the BACnet/MSTP Device Service configuration file is provided where all the driver options have been set to demonstrate their usage:

{
  "Library": "libxrt-bacnet-mstp-device-service.so",
  "Factory": "xrt_bacnet_mstp_device_service_factory",
  "Name": "bacnet_mstp",
  "TelemetryTopic": "xrt/devices/bacnet_mstp/telemetry",
  "RequestTopic": "xrt/devices/bacnet_mstp/request",
  "ReplyTopic": "xrt/devices/bacnet_mstp/reply",
  "DiscoveryTopic": "xrt/devices/bacnet_mstp/discovery",
  "StateDir":"./deployment/state",
  "ProfileDir": "./deployment/profiles",
  "Scheduler": "sched",
  "Logger": "logger",
  "ThreadPool": "pool",
  "Bus": "bus",
  "Driver": {
    "DeviceObject": {
      "InstanceID": 0,
      "ObjectName": "IOTech Edge Xrt BACnet Device Service Component",
      "VendorName": "IOTech",
      "VendorID": 1313,
      "Location": "UK",
      "Description": "IOTech Edge Xrt BACnet Device Service Component",
      "ModelName": "IOTech Edge Xrt BACnet",
      "ApplicationSoftware": "2.0"
    },
    "SerialInterface": "/dev/tty/USB0",
    "APDUTimeout": 10000,
    "APDURetries": 2,
    "MultiBatchSize": 10,
    "MultiRead": true,
    "MultiWrite": true,
    "CancelStaleCOV": true,
    "DiscoverMode": "All",
    "DiscoverProperties": [75, 36, 28, 81, 85, 103, 117, 87],
    "DiscoverObjects": [8, 0, 1, 2, 3, 4, 5, 13, 14, 19],
    "DiscoveryDuration": 10000,
    "DiscoveryRetries": 1,
    "IAmBroadcastInterval": 30
  }
}

Determining Serial Interface Path

To find the path of the serial interface used there are a few options.

If the interface is not fixed to the host, for example via USB, remove it and connect again then run the following command:

dmesg -w

This command provides information on the last connected device, which will contain the device's path. This path is usually something like /dev/tty/USBx where x is the USB port number.

If you have a fixed interface, the following command could be used to find all the available serial connections:

dmesg | grep tty
This for example could return ttyS0 which would mean its full path is /dev/ttyS0

BACnet Device Profile

Details on general profile usage can be found on the Device Profiles page

The following sections will cover how device resources are mapped to BACnet properties.

Attributes

The attributes used in a BACnet device resource are described in the following table:

Attribute Description Valid Values
type Mandatory

BACnet object type
UInt32 value

Object type values are specified in an enumeration: bacenum.h file
instance Mandatory

BACnet object instance number
UInt32 value
property Mandatory

BACnet property type
UInt32 value

Property types are specified in an enumeration: bacenum.h file
index Optional

Index of array
UInt32 value

Index 0 holds the size of an array in BACnet
raw Optional

Read / write the full APDU if true

Xrt data type must also be set to UInt8Array if true
true / false

Data Types

When the device receives a request, it returns a value with a BACnet type. The following table lists the supported BACnet data types, their equivalent Xrt data types and the supported read / write abilities:

BACnet Data Type Xrt Data Type Read/Write Ability
Boolean Bool RW
Unsigned Int UInt64 RW
Signed Int Int32 RW
Real Float32 RW
Double Float64 RW
Enumerated UInt32 RW
Character String String RW
Date String R
Bit String UInt8Array R
Octect String UInt8Array R
Time String R
BACnetObjectIdentifier String R

Note

The BACnet device service can decode two types of BACnet Character String encoding, UTF8 and UCS2. Any other encoding will be returned as the encoding type followed by the hex bytes. An example is provided: MS_DBCS:00010A09010A094070A0B

BACnet Arrays

BACnet Array types are supported to be read but will only be returned using the Xrt String type. Each element is comma separated where the following BACnet types are supported for the array:

  • Null
  • Boolean
  • Enumerated
  • Unsigned Int
  • Signed Int
  • Real
  • Double
  • Character String

Additional BACnet Types

There is support for reading and writing additional BACnet types in an object form. Details of supported objects can be found in BACnet Object Support.

To read / write any other BACnet types that are not supported, the Xrt data type UInt8Array must be used along with an attribute of raw set to true in the device resource. The device service will return the entire APDU that is received as a UInt8 array. If writing to a device resource of this type the entire encoded APDU must be provided as the payload by the user as a UInt8 array. An example device resource of this type is shown in the Example Device Resources section.

Example Device Resources

The following section provides examples of some device resources mapped to BACnet properties.

  • The extract from a device profile shown below reads the Present Value property of instance 1 of the Binary Input object
Location Description
Object Type Binary Input

Enumeration: 3
Object Instance Number 1
Property Present Value

Enumeration: 85
Indexing No array indexing
BACnet Data Type Enumerated
Xrt Data Type UInt32
{
  "name": "binary_input_1:present-value",
  "description": "Get the present value of binary input object 1",
  "attributes": {
    "type": 3,
    "instance": 1,
    "property": 85
  },
  "properties": {
    "valueType": "Uint32",
    "readWrite": "RW"
  }
}
  • The device resource shown below reads / writes the Present Value property of instance 4 of the Analog Output object
Location Description
Object Type Analog Input

Enumeration: 1
Object Instance Number 4
Property Present Value

Enumeration: 85
Indexing No array indexing
BACnet Data Type Float
Xrt Data Type Float32
{
  "name": "analog_output_4:present-value",
  "description": "The present value of analog output 4",
  "attributes": {
    "type": 1,
    "instance": 4,
    "property": 85
  },
  "properties": {
    "valueType": "Float32",
    "readWrite": "RW"
  }
}
  • The device resource shown below reads the full Priority Array of instance 4 of the Analog Output object
Location Description
Object Type Analog Input

Enumeration: 1
Object Instance Number 4
Property Priority Array

Enumeration: 87
Indexing No array indexing
BACnet Data Type BACnet Array of floats or nulls
Xrt Data Type String
{
  "name": "analog_output_4:priority-array",
  "description": "The priority array of analog output 4",
  "attributes": {
    "type": 1,
    "instance": 4,
    "property": 87
  },
  "properties": {
    "valueType": "String",
    "readWrite": "R"
  }
}
  • The device resource shown below reads the third index of the Priority Array of instance 4 of the Analog Output Object
Location Description
Object Type Analog Input

Enumeration: 1
Object Instance Number 4
Property Priority Array

Enumeration: 87
Indexing Element 3
BACnet Data Type Float
Xrt Data Type Float32
{
  "name": "analog_output_4:priority-array-index-3",
  "description": "The priority array of analog output 4, index 3",
  "attributes": {
    "type": 1,
    "instance": 4,
    "property": 87,
    "index": 3
  },
  "properties": {
    "valueType": "Float32",
    "readWrite": "RW"
  }
}
  • The device resource shown below reads / writes the property Event Time Stamps of instance 2 of the Analog Value Object.
  • The BACnet data type that represents this property is BACnetARRAY3 of BACnetTimeStamp
  • As the device service does not support this it, this resource must be set to a raw type with the Xrt data type as UInt8Array
Location Description
Object Type Analog Value

Enumeration: 2
Object Instance Number 2
Property Event Time Stamps

Enumeration: 130
Indexing No array indexing
BACnet Data Type BACnetARRAY[3] of BACnetTimeStamp
Xrt Data Type UInt8Array (with raw attribute set to true)
{
  "name": "analog_value_2:event-time-stamps",
  "description": "The event time stamps of analog value 2",
  "attributes": {
    "type": 2,
    "instance": 2,
    "property": 130,
    "raw": true
  },
  "properties": {
    "valueType": "UInt8Array",
    "readWrite": "RW"
  }
}

Device Commands

See the Device Profiles page for details on how to define device commands for grouping device resources for fewer requests.

BACnet Device Provisioning

The following sections will explain how devices can be statically configured for both BACnet/IP and BACnet/MSTP Device Services.

Note

For information on dynamic device additions, removals, and updates, please see the MQTT API Guide.

BACnet/IP Device Provisioning

To provision a BACnet/IP device, the BACnet-IP protocol must be used.

The DeviceInstance protocol property can be used to specify the BACnet device instance network ID.

An example of a BACnet/IP device provision within the devices.json file is provided below:

{
  "BacnetSimulator": {
    "name": "BacnetSimulator",
    "profileName": "bacnet-simulator",
    "protocols": {
      "BACnet-IP": {
        "DeviceInstance": 1234
      }
    }
  }
}

If BACnet devices are required that run on different subnets or ports and a BBMD cannot be used, then these devices can be addressed directly. The Address protocol property specifies the IP address of the device and Port can be set if the device is running on a different port than that of the device service.

An example of a directly addressed BACnet/IP device provision within the devices.json file is provided below:

{
  "BacnetSimulator": {
    "name": "BacnetSimulator",
    "profileName": "bacnet-simulator",
    "protocols": {
      "BACnet-IP": {
        "Address": "192.168.60.123",
        "Port": 47809
      }
    }
  }
}

BACnet/MSTP Device Provisioning

To provision a BACnet/IP device, the BACnet-MSTP protocol must be used along with the DeviceInstance protocol property which specifies the BACnet device instance network ID.

An example of a BACnet/MSTP device provision within the devices.json file is provided below:

{
  "BacnetSimulator": {
    "name": "BacnetSimulator",
    "profileName": "bacnet-simulator",
    "protocols": {
      "BACnet-MSTP": {
        "DeviceInstance": 1234
      }
    }
  }
}

BACnet Device Service Interaction

Any sections contained within the part of the guide are to describe protocol specific functionality of the device service.

For information on how to dynamically execute reads, writes, setting up schedules, triggering device discovery and much more, please refer to the MQTT API Guide.

For interactive examples of both BACnet IP and MSTP Device Services refer to BACnet/IP Xrt Example and BACnet/MSTP Xrt Example projects. Follow the instructions in those links, which will demonstrate many features of Xrt with the device service running against a BACnet simulator.

BACnet Priority Levels

When performing a put request on a BACnet device resource, an additional option can be added to the payload, Priority, which indicates the priority level (1 to 16) that the value will be written as. Only a select few Object types and properties support these priority levels in BACnet.

An example user payload is provided which demonstrates its usage on the Present Value property of the Analog Output Object.

In this example, priority level 2 will be set as the value 33.0.

{
  "client": "iotech",
  "request_id": "102",
  "op": "device:put",
  "device": "BacnetSimulator",
  "values": {
    "analog_output_0:present-value": 33.0
  },
  "options": {
    "Priority": 2
  },
  "type": "xrt.request:1.0"
}

These priority levels can also be set to null. In the following example, priority level 1 will be set to null.

This will mean that when the Present Value property is read, the returned reading will skip priority level 1 as its null and return the value from level 2 which was set as 33.0.

{
  "client": "iotech",
  "request_id": "101",
  "op": "device:put",
  "device": "BacnetSimulator",
  "values": {
    "analog_output_0:present-value": null
  },
  "options": {
    "Priority": 1
  },
  "type": "xrt.request:1.0"
}

BACnet Change of Value

In addition to regular polling via schedules that are described in the Schedules page, the BACnet Device Service supports a protocol specific feature called Change of Value (COV). This allows the device service to subscribe for changes to a specific property on a device, which is usually the Present Value.

When the value of this property changes, if the delta is larger than the COV Increment property value, then the device will send the device service a notification which includes this new value.

Setting up a COV subscription is similar to configuring a schedule for Xrt. There are two main differences: - The interval field is not set - An additional field is used, options - Within this field, there is a COV field that contains 2 settings: Confirmed and Lifetime.

The usage of COV options is explained in the table below.

COV Setting Description Valid Values
Confirmed Confirmed or unconfirmed COV notifications. true / false
Lifetime Length of time the COV subscription will last in seconds.

Once the time has elapsed, a cancel request will be sent to the device and the COV removed from the Xrt configuration.

Set to 0 for an infinite COV subscription.
UInt16 value

An example of a COV subscription for two different properties is provided below as a static configuration in the schedules.json file.

{
  "cov0": {
    "name": "cov0",
    "device": "BacnetSimulator", 
    "resource": ["analog_value_0:present-value", "analog_value_1:present-value"], 
    "options": {
      "COV": {
        "Confirmed": false, 
        "Lifetime": 600
      }
    }
  }
}

BACnet Device Discovery

When triggering a BACnet discovery request as described in the MQTT API Guide, there are the following device service settings that can be included within the options field. Some of these will override the corresponding device service driver options that can be found in BACnet Device Service Configuration

Parameter Type Description Example Value
DiscoveryDuration UInt16 Driver Option Override

Controls the length of time to wait between Who-Is broadcasts in milliseconds.
5000
DiscoveryRetries UInt8 Driver Option Override

Controls how many extra Who-Is broadcasts are made during a discovery call.
2
DiscoveryDeviceRange List of 2 Unsigned Integers Configure a specified range of devices to issue a discovery on.

Set the lower and upper limits on what BACnet device instances should respond.
[0, 999]

An example discovery:trigger command using these options is provided:

{
  "client":"iotech",
  "request_id": "108",
  "op": "discovery:trigger",
  "options": {
    "DiscoveryDuration": 5000,
    "DiscoveryRetries": 2,
    "DiscoveryDeviceRange": [0, 999]
  },
  "type": "xrt.request:1.0"
}

A device can also be discovered directly for the BACnet/IP device service by specifying the IP address and Port in the options field of the discovery request. This will allow discovery of devices on different subnets and ports without the need for a BBMD.

Parameter Type Description Example Value
Address String The IP address of device to be discovered 192.168.50.27
Port UInt16 Defaults to the port the device service is running on

Port the device to be discovered is running on
47808

An example discovery:trigger command using these options is provided:

{
  "client":"iotech",
  "request_id": "108",
  "op": "discovery:trigger",
  "options": {
    "Address": "192.168.50.27",
    "Port": 47808
  },
  "type": "xrt.request:1.0"
}

When receiving the details of the discovered devices on the TelemetryTopic some additional information will be included in a properties field. These are described in the following table.

Property Type Description Example Value
InstanceID UInt32 Device Object Instance ID 1234
Contactable Bool Indicating whether the device is directly contactable. If false, some of the other properties will not be included as they are read directly from the device. true
Port UInt16 Port Number of the BACnet Network

Only for BACnet/IP
47808
IP String IP Address of the Device

Only for BACnet/IP
192.168.50.27
DeviceType String Indicates whether the device was discovered using BACnet/IP or BACnet/MSTP BACnet-IP / BACnet-MSTP
ApplicationSoftware String Device Object Property Application Software 2.0
Firmware String Device Object Property Firmware Revision 1.0.1
ModelName String Device Object Property Model Name IOTech BACnet Simulator
ObjectName String Device Object Property Object Name BacnetSimulator
VendorID UInt32 Device Object Property Vendor Identifier 1313
VendorName String Device Object Property Vendor Name IOTech

When a device is discovered, the value of the ObjectName property with the InstanceID value appended is used as the device name when its details are published. If a device is uncontactable, or the ObjectName property is empty, only the InstanceID value is used as the device name.

An example of discovered device that is contactable:

{
   "BACnetSimulator:1234":{
      "properties":{
         "ApplicationSoftware": "2.0",
         "DeviceType": "BACnet-IP",
         "Firmware": "1.0.1",
         "IP": "192.168.50.27",
         "InstanceID": 1234,
         "ModelName": "IOTech BACnet Simulator",
         "ObjectName": "BACnetSimulator",
         "Port": 47808,
         "VendorID": 1313,
         "VendorName": "IOTech",
         "Contactable": true
      },
      "protocols":{
         "BACnet-IP":{
            "DeviceInstance": 1234
         }
      }
   }
}
An example of discovered device that is not contactable:

{
   "1234":{
      "properties":{
         "DeviceType": "BACnet-IP",
         "IP": "192.168.50.27",
         "InstanceID": 1234,
         "Port": 47808,
         "Contactable": false
      },
      "protocols":{
         "BACnet-IP":{
            "DeviceInstance": 1234
         }
      }
   }
}

If discovery was triggered on BACnet/IP with the Address option specified, then the discovered device published will have Address and Port protocol properties instead of DeviceInstance.

{
   "BACnetSimulator:1234":{
      "properties":{
         "ApplicationSoftware": "2.0",
         "DeviceType": "BACnet-IP",
         "Firmware": "1.0.1",
         "IP": "192.168.50.27",
         "InstanceID": 1234,
         "ModelName": "IOTech BACnet Simulator",
         "ObjectName": "BACnetSimulator",
         "Port": 47808,
         "VendorID": 1313,
         "VendorName": "IOTech",
         "Contactable": true
      },
      "protocols":{
         "BACnet-IP":{
            "Address": "192.168.50.27",
            "Port": 47808
         }
      }
   }
}

BACnet Profile Discovery Options

Profile discovery can occur via a device:scan on a provisioned device where there are the following device service settings that can be included within the options field of the command. Some of these will override the corresponding device service driver options that can be found in BACnet Device Service Configuration.

Parameter Type Description Example Value
DiscoverMode String Driver Option Override

Determines the range of properties that will be discovered on a device when generating a profile.

The three options are:
  • All - Will attempt PROP_ALL requests which receive all properties of an object. Upon failure of that call, it will try to read the property list of each object instance and query each property. Upon failure of that, it will try to read the standard and optional properties of each object instance on the device according to the BACnet specification of that particular object.
  • Mandatory - Will only query the mandatory properties of each object instance on the device according to the BACnet specification of that particular object.
  • PresentValue - Will only query present value.
All
DiscoverProperties List of UInt32 values Driver Option Override

Used to filter for only the properties specified when generating a BACnet device profile.

Property types are specified in an enumeration: bacenum.h file
[75, 36, 28, 81, 85, 103, 117, 87]
DiscoverObjects List of UInt32 values Driver Option Override

Used to filter for only the object types specified when generating a BACnet device profile.

Object type values are specified in an enumeration: bacenum.h file
[8, 0, 1, 2, 3, 4, 5, 13, 14, 19]

An example device:scan command using these options is provided:

{
  "client": "iotech",
  "request_id": 101,
  "op": "device:scan",
  "device": "BacnetSimulator",
  "options": {
    "DiscoverMode": "All",
    "DiscoverProperties": [75, 36, 28, 81, 85, 103, 117, 87],
    "DiscoverObjects": [8, 0, 1, 2, 3, 4, 5, 13, 14, 19]
  },
  "type": "xrt.request:1.0"
}

BACnet Events

There is support for receiving BACnet Events and Alarms. Details of this can be found in BACnet Events.

There is also a BACnet extension component that can be used to register the BACnet/IP Device Service for all events from every device that is provisioned. This component can also deregister from all events. Details on how to use this component can be found on the BACnet Event Registration Extension Component page.

Run the BACnet Device Service

Standalone on Command Line

Find details on how to run the BACnet Device Service on the Run Device Services page.

Docker Container

Find details on how to run BACnet over IP & MSTP Device Service in a docker container at Run BACnet/IP Docker & Run BACnet/MSTP Docker