PmBACnet - Driver for communication by the BACnet protocol

This driver is used for communication with devices using the BACnet protocol. See Communication by BACnet protocol.
Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communication using the PROMOTIC drivers.
Basic properties of the driver:
- Usage of this driver requires purchase of the license: PmBACnet. With the freeware version PmFree, or when developing the application (with development environment for tersting purposes), this component is always functional.
- The communication is done via Ethernet. The driver supports exclusively the BACnet/IP application layer with UDP transport layer.
- The driver is incorporated into the PROMOTIC system by means of the PmComm object.

The driver supports usage of PmCommData object (for read and write the variables). The PmCommMsg object is used only for special auxiliary message that detects the variables that can be read from the device (see further).

For easy integration of this driver into the application it is handy to use: Preconfigurations in group "BACnet communication protocol"

- There is a slight deviation from standard, namely the fact that from the communicaton point of view the PROMOTIC application is always the client. The functions for searching devices and objects (Who-Is/I-Am) are not supported. The primary identification of target device is its IP address, not the device number (the driver does not use the device number for any purpose).

Note: Who-Is is used for sending a broadcast type request (request for all). The answers that follow I-Am provide the information about the presence of a device together with device number, IP address, etc.

- The driver does not support segmentation and COV (Changing of Value).
The protocol is using objects:

The BACnet protocol belongs to the object oriented protocols group. The BACnet device object is defined by its type, its number and a set of properties.

Object type: for example analog input, binary output, etc. - see further.
Object number: is used for object identification (there can be multiple object of the same type or none). The numbers must be unique within the type, in the range of 0 to 4 194 302 and may not constitute a continuous series.

The "Device" type object represents special case that is always unique within the individual device. Its number is 4 194 303 (3FFFFF hexa). This number is therefore not entered in the driver.

Property: specifies additional information regarding the object, for example current value, unit, limits, etc. Some properties may be of the array type.

Example 1: Some measured temperature is represented by object of the "Analog Input" type, and the number is for example 13 and the property set is for example:
"high-limit" etc.
Example 2: Each BACnet device is described by a single "Device" object, with properties for example:
"vendor-name" (name manufacturer)
"local-time" (time in device)
"time-of-device-restart" (time last device restart) etc.
Object types:

Followed by the list of object types supported by the driver:

- Device: An object containing global device information. For example name and manufacturer identifier, etc.
- Analog Input: Analog value on the device input.
- Analog Output: Analog value on the device output.
- Analog Value: Analog value inside the device.
- Binary Input: Logical value on the device input.
- Binary Output: Logical value on the device output.
- Binary Value: Logical value inside the device.
- Multi-state Input: Multistate value on device input.
- Multi-state Output: Multistate value on device output.
- Multi-state Value: Multistate value inside the device.
- Averaging: Averaging.
- Accumulator: Container.
- PulseConverter: Pulse converter
- CharacterString Value: Text string.
- Schedule: Scheduler.

The "weekly-schedule" property is also supported in this object. This property can be read and written in the PROMOTIC system and is of the String data type. It is a text in the CSV format containing day (1=Monday - 7=Sunday), time and value. Note: In order to read and write the file the methods Pm.FileCsvRead and Pm.FileCsvWrite can be used.

Property "exception-schedule" is not supperted by the driver so far.

Data types:

BACnet uses the following data types:

- boolean - In the PROMOTIC application represented by the data type: Boolean.
- unsigned integer - In the PROMOTIC application represented by the data type: Long.
- signed integer - In the PROMOTIC application represented by the data type: Integer.
- real - In the PROMOTIC application represented by the data type: Single.
- double - In the PROMOTIC application represented by the data type: Double.
- character string - In the PROMOTIC application represented by the data type: String.
- bit string - In the PROMOTIC application represented by the data type: Long. So far it is limited to 32 bits with no way to find out which bits are valid. So far "read only" is supported (cannot write).

In some cases the bit strings are used as so-called BACnet Status Flags. If so, only the first 4 bits are used for following purpose:

- bit 0: in-alarm
- bit 1: fault
- bit 2: overriden (switched to manual control)
- bit 3: out-of-service
- enumerated - For the units property, it is transformed to String value carrying information regarding the physical units assigned by standard (this value can only by read, cannot write). Other values are transformed to Byte with the number of value (these values can beread and written).
- date - In the PROMOTIC application represented by the data type: Date.
- time - In the PROMOTIC application represented by the data type: Date.
Writing into present-value property:

The present-value property forms the priority array priority-array with 16 priority values. While writing, it is possible to define the priority i.e. the array index of the written value. If the written value is defined as Variant data type containing Empty, then the BACnet value NULL will be sent which means that the selected index value will be deleted.


Recommended parameters values:

Recommended values for the Ethernet parameters:
Network addressDevice IP address. Based on the fact that the driver does not support device search so far, the IP address is used as a main device identifier instead of the device number.
TCP/UDP port number47808 (defined in the BACnet standard, the hexadecimal value is BAC0)
Ethernet transfer typeUDP
Description and recommended values for the Protocol parameters:
Maximum APDU length acceptedDespite the fact that for BACnet/IP the recommended length of data packet of the application layer is 1476 byte, some devices may require shorter packets.

The packet lenght information can be found, for example, by the message type "Read list of all available information from the device" - see further.

The standard tolerates following alternative lenghts (octets = byte number):

50 octets
128 octets
206 octets (fits LanTalk frame)
480 octets (fits ARCNET frame)
1024 octets
1476 octets (fits ISO 8802-3 frame) (default)

The communication description by the PmCommData objects

The variables in the PmCommData object (or even better the variables in the PmData object with ExtComm data extension) are read by this driver all together in a single communication message. The driver itself does not limit the number of variables, but if the designer sets too many variables in a single PmCommData object then the maximum message size can be exceeded (see the configurator "Maximum APDU length accepted") and the transmision fails. Therefore it is recommended to separate variables into multiple PmCommData object.

Note: Other PROMOTIC communication drivers separate the variables from a single PmCommData object into multiple messages. But it is not possible for this protocol - if implemented then it would significantly limit the number of variables in a single message. Therefore the decision to define the number of variables depends on the application designer that can optimize the variable count in PmCommData object to maximum number possible.

All variables are read (if the Data refresh enabled configurator is checked). When writing to the variable, only the single value is sent (if the Auto send when writing to item configurator is checked).
Description of the ItemID configurator:

ItemId is the text identifier of the item that is used for addressing the value in the device. The ItemID configurator tells the driver how to receive or send the item value. The text can be written manually, or it can be assembled in the window opened by the button to the right of the configurator. Macro expression can be used for input (it is evaluated while the application is launching).

The text string for ItemId has in general the following syntax:


- ObjectNumber: It is not entered for the "Device" object type
- PropertyIndex: (optional) The object property can also be represented by an array - in such case, the array index in brackets can be used.
- priN: (optional) Entered only for the present-value property. N is the writing priority. See Writing into present-value property.
Examples of identifier syntax:
1) Device.model-name = Device type name
2) AnalogValue.2.present-value.pri8 = Current analog value of number 2. When writing into this item, the value will have the priority 8 (see Writing into present-value property).
3) BinaryValue.14.present-value[4] = Current value on index 4 in binary array numbered 14
In order to define the ItemId correctly, it is recommended to:
- Use the "Read list of all available information from the device" message to find out the contents of of the device (see further).
- For entering the value into the ItemID configurator use the selection window that can be opened by the button to the right from the inputbox.
Caution when writing values into the device:

Setting the ItemId defines the required BACnet object and property. But BACnet data type is not defined. When the value is received, the driver recognizes the data type and remembers it for the specific variable. When sending the value after that, the driver already knows the type to be used for sending the value.

But if at least one receive does not occur before, then the driver may not know the correct BACnet type for defined variable is used by the device. The driver then sets some suitable type based on the BACnet property name. This may result in setting incorrect type. Therefore it is recommended to execute at leas one receive before sending a value.

Description of the PmCommData > Parameters > Special Parameters configurator:
This configurator is not used for given driver.

The communication description by the PmCommMsg objects

The PmCommMsg objects can be used for special communications, that cannot be executed by the PmCommData object. For this driver, there is only a singe special message implemented:
- Read list of all available information from the device:

In order to set the ItemId configurator correctly in the variables for the PmCommData object it is necessary to have the information about available objects in the device. This informaton can be read from the device and this is exactly the sole purpose of this message:

The message reads the information and saves it into a text string on the Data-received page.

The information gathered by this message provide an overview of objects present in current device (object list with types and object numbers). This information can be used for compiling the ItemId in the PmCommData object.


In order to create and configure the PmCommMsg object correctly it is handy to use the preconfiguration::

If you (in this preconfiguration) check the configurators:

then the correctly configured PmCommMsg object is created together with a panel that can run the message and read the desired information from the PLC.

PROMOTIC 8.3.29 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice