Endigit BACnet API - Detailed Help

Latest Version: 1.2.2
Software and operating system requirements:

  • LabVIEW 2017 or higher, supported on LabVIEW RT
  • Windows 10 or higher

Design

The architecture for this API is designed to capture the entire breadth of the BACnet specification. However, only limited functionality is currently implemented. The API is currently able to

  1. Function as a device on a BACnet serial MSTP or BACnet/IP network (replies to Who-Is with I-Am)
  2. Read/write Present Value for Analog/Binary Input/Output/Value object types
  3. Issue Change of Value (COV) requests to reduce network usage

The implementation of this API was based on two main sources

  1. The official BACnet Standard document: https://www.bacnetinternational.org/page/BACnetStandard
  2. BACnet Stack: http://bacnet.sourceforge.net/

Implementation

The Endigit BACnet API is a class-based LabVIEW driver that follows the "Initialize -> Read/Write -> Close" model. You will initialize the main class based on the type of BACnet device you want to be (BACnet/IP, MSTP Master, or MSTP). This initialization will return the light blue class wire, which you will use for any reads and/or writes, and finally for the close. This initialize call spins up dynamic loops to handle the device (UDP for BACnet/IP and EIA-485 serial for MSTP) and APDU (Application Layer Protocol Data Unit) layers.

You will also need to initialize a BACnet object for each object you want to talk to using "Object.lvclass:Initialize B.IP Object.vi" or the generic "Object.lvclass:Initialize.vi". The class returned from this initialize will be an input to any reads or writes.

Errors

Custom error codes: 404120-404159

In order to properly see the Endigit BACnet API errors in LabVIEW, the package copies Endigit-BACnet-API-errors.txt to "LabVIEW\project\errors\".

Examples

Select Help»Find Examples from LabVIEW to launch the NI Example Finder. Navigate to "Browse»Directory Structure»Endigit»Endigit BACnet API" folder to access the examples. You can modify an example VI to fit an application, or you can copy and paste from one or more examples into a VI that you create.

You can also find the examples for Endigit BACnet API in the "...labview\examples\Endigit\Endigit BACnet API\" folder.

Initialize BACnet IP

"IP Address" is the local IP address you want the UDP connection to be opened on.

"Local Port (0xBAC0)" is the local port you want to use to create the UDP socket. The default is 0xBAC0, but this can be any available port. You will receive messages and replies from other devices on this port.

"Instance (7)" (optional) uniquiely identifies this device object from other device objects at this IP address and port. This is up to you to define. Doesn't much matter because only one device can be on a given UDP port anyway.

"Object Name" (optional) is inserted into the "object_name" property of the device, which may be read by other devices.

"Objects" (optional) is an array of objects that you want this device to own. If you are wanting to host objects and values for other devices to read/write from/to, then initiaize them using "Object.lvclass:Initialize.vi" and pass them in here.

"BACnet Out" (output) is the BACnet class used for all other API methods.

Initialize MSTP Master

"VISA" is the reference to the serial port you want your device to reside on.

"Baud Rate" is the defined baud rate for the serial network you are connecting to.

"Address" uniquely identifies your device on the serial network. Must not collide with any other devices on the network.

"BACnet Out" (output) is the BACnet class used for all other API methods.

Initialize BACnet/IP Object

"Remote IP Address" is the IP address of the device you want to read from or write to.

"Type" is the type of the object you want to read from or write to. Tested types with this API are Analog/Binary Input/Output/Value. You will need to get this from your specific BACnet configuration.

"Instance" uniquiely identifies the object of a given type at the specified address. You will need to get this from your specific BACnet configuration.

"Remote Port (0xBAC0)" is the port on the remote device you want to read from and write to. You can have multiple objects on a port and multiple ports on a device. You will need to get this from your specific BACnet configuration.

"Write Priority (0)" (optional) defines the relative priority of objects for arbitration. Valid options are 1-16, with 1 being the highest priority. A '0' will cause the property to not be written (less bandwidth usage), defaulting the priority to a 16.

"Object Out" (output) is the BACnet object used in the read and write methods

BACnet Write

"BACnet In" is the BACnet class and it must be initialized before being called here.

"Object In" is the object you want to write to. See "Initialize B.IP Object.vi".

"Property (Present Value)" is the property of "Object In" that you want to write to. This enum contains all of the properties in the BACnet specification, but only Present Value has been thoroughly tested.

"Value" is the value you want to write to the object property. For analogs, this gets converted to a single. For booleans, 0 is false, everything else is true.

"Timeout (10000 ms)" (optional) defines the maximum time to wait for a reply. If no reply is received by this time, the VI returns a timeout error.

"BACnet Out" (output) is the BACnet class used for all other API methods.

BACnet Read

"BACnet In" is the BACnet class and it must be initialized before being called here.

"Object In" is the object you want to read from. See "Initialize B.IP Object.vi".

"Property (Present Value)" is the property of "Object In" that you want to read from. This enum contains all of the properties in the BACnet specification, but only Present Value has been thoroughly tested.

"Timeout (10000 ms)" (optional) defines the maximum time to wait for a reply. If no reply is received by this time, the VI returns a timeout error.

"BACnet Out" (output) is the BACnet class used for all other API methods.

"Value" (output) is the value of the property that you read from.

BACnet Close

"BACnet In" is the BACnet class used for all other API methods. Each initialized instance should be closed when it is no longer needed.