Skip to main content

iRidi for BACnet IP

Tools for creating a visualization interface

The driver controls BACnet equipment. Use the example project to get started:

Description​

iRidi for BACnet provides tools for creating a home or office control interface based on equipment of the same name. Implements BACnet protocol commands.

Connection​

Note

Control panels (iOS, Android, Windows, Mac) can control BACnet equipment only through a BACnet controller.

BacnetConnection.png

Importing from *xml and *csv files​

Tip

Download a valid CSV example:

Release 1.3.87 improves CSV import file reading.

The file is identified by a general header containing Engineering-Data-Exchange

Import uses the required columns with these headers:

keyname; device obj.-instance; object-name; object-type; object-instance; description

Equipment configuration can be saved as xml or csv and imported into iRidi. The ede and hl structures are supported for csv files.

  1. Open StruxureWare Building Operation Workstation and sign in.

  2. In StruxureWare Building Operation, right-click Enterprise server and select Import from the menu.

BacnetImport.png

  1. Create a new project in iRidi Studio. In Devices, select Import > BACnet Project (*.xml, *.csv) (beta). Select the required import file in the window that opens.

BACnetProject1.png

  1. A dialog opens after import for selecting the network and subdevices. The import file defines a network with subdevices, commands, and feedbacks.

Bacnet dev.png

Bacnet dev2.png

Note

On reimport:

  1. Networks merge according to Host and Port connection settings;
  2. If connection settings match, subdevices are compared by name and only new ones are added.

Adding the driver manually​

If importing the device is not possible, add the BACnet driver from the iRidi database:

BACnetProject4.png

Configuring connection parameters​

After adding the driver by import or manually, configure its connection settings.

BACnetProject5.png

  • Log Level is the driver logging level.
  • Host is the controller IP address.
  • Port is the device connection port for receiving data (default 47808; the driver sends requests to the agent).
  • Send Timeout is the send timeout in milliseconds.
  • Update Timeout is the time to prepare data in the send buffer, in milliseconds. Update Timeout must be several times greater than Send Timeout.
  • Re-subscribe Timeout (min) is the subscription renewal time.
  • LocalPort is the device connection port for receiving data (default 47808; the agent sends replies to the driver).
Note

Two drivers in one project must have different LocalPort values.

Configuring BACnet device parameters​

BACnet network devices have several important settings.

BACNet2.png

  • Device Instance is the BACnet device identifier. Find it in the controller web interface
  • Priority ranges from 1-16 and specifies the write operation priority. BACnet command prioritization
  • Network ID uniquely identifies a network in the BACnet system. i-Vu® generates all network numbers automatically. Network numbers must be unique throughout BACnet regardless of protocol; BACnet MS / TP and BACnet / IP network numbers cannot be duplicated. The network number ranges from 1 to 65534 (65 535 is reserved for broadcasts).
  • Mac Address (dec) is a lower-level BACnet identifier. In i-Vu® Open, MAC ranges from 1 to 99 and must be unique for each device within the network.
  • Update type is the protocol feedback update type (subscription or polling):
    • Auto (subscribe cov or read property): detect the type automatically.
    • Read property: force variable polling.

Changing connection parameters​

You need to change connection parameters when you disconnect from the automation site's Wi-Fi network and start using 3G or another Wi-Fi network. For control to continue working, switch from the local IP address to the Internet router's public IP address.

Switching is not automatic; you need to press the connection mode selection button. For remote access, the automation system's control ports must be made public. To do this, configure Port Forwarding on the Internet router. A VPN can provide a secure connection.

  1. Download template (*.js) (right-click to save the target), then add the template to the script editor Icon Scripts.png using (+) Add Script from file

  2. Configure the script parameters as shown in the example:

function Internal_1() {
IR.GetDevice('BACnet').SetParameters({Host: "192.168.0.95", Port: 5001, "SendTimeOut": 2000, "UpdateTimeOut": 1000});
}
function External_1() {
IR.GetDevice('BACnet').SetParameters({Host: "215.110.10.10", Port: 5001, "SendTimeOut": 2000, "UpdateTimeOut": 1000});
}

Copy the driver name from Project Device Panel; copy the parameter list exactly as shown in the example.

  1. Select the button that switches between Internal and External parameters. Open Macros Editor for the Press event (Object Properties > Programming), select Script Call and add it by double-clicking. Select the function the button calls:

Script call internal-external.png

Each button press now applies the corresponding connection settings.

Commands & Feedbacks​

SendRecieve.png

Configure Commands and Feedbacks to control equipment. To send a command, drag it onto a graphical item and specify the Value to send. To display a feedback channel value, drag the Feedback onto a graphical item and specify how to display the Value.

For more information about graphical items, see Graphical item types.

Configuration​

Configure a command or feedback by setting these fields:

  • Property Type is the channel/tag value type:
    • Present Value: read a value from the device,
    • Out of Service: write a value from the panel,
  • Object Type is the variable type,
  • ObjectID is the variable (input/output) identifier. Find it in the controller web interface (BaCnet Interface - Application - Points - the variable - Advanced tab),
  • COV increment is the minimum value change that triggers a data update.

The following variable types are currently supported:

Object Types

TypeDescription
analog-inputAnalog input
analog-outputAnalog output
analog-valueAnalog value
binary-inputBinary input
binary-outputBinary output
binary-valueBinary value
multi-state-inputMultistate input
multi-state-outputMultistate output
multi-state-valueMultistate value

Script methods​

.SetSubDeviceParam()​

Configures BACnet driver subdevice parameters in i3Pro.

Syntax

IR.GetDevice("DeviceName").SetSubDeviceParam("SubDeviceName", {
"device_instance": value,
"priority": value,
"network_id": value,
"mac_address": “value”,
"update_type": value
});

InputValueDescription
DeviceName"BACNet Network"type: String
BACNet driver name.
SubDeviceName"BACNet Device"type: String
Subdevice name in the BACNet driver.
Output
device_instance0 - 4194302type: Number
Parameter for changing the identifier.
priority1 - 16type: Number
Parameter for changing write operation priority.
network_id1 - 65534type: Number
Sets the ID value (conditionally editable: if the device has a configured Network_ID, it sends it and i3Pro stores the received value; otherwise, outgoing packets use the specified value).
mac_address"45:67:89:AB:DE:23"type: String
Parameter for changing the MAC address setting.
update_typeIR.BACNET_AUTO //
IR.BACNET_READ_PROPERTY
type: Object
Parameter for changing how feedbacks are received. There are 2 methods:
IR.BACNET_AUTO (if the device supports subscriptions, it sends feedbacks on changes; otherwise, i3Pro polls the device).
IR.BACNET_READ_PROPERTY (i3Pro polls the device).

Example

IR.GetDevice("BACNet Network").SetSubDeviceParam("BACNet Device"
"device_instance" : 5,
"priority" : 8,
"network_id" : 1,
"mac_address" : "45:67:89:AB:DE:23",
"update_type" : IR.BACNET_READ_PROPERTY

IR.GetDevice("BACNet Network").Connect();`
Note

After .SetSubDeviceParam finishes, Disconnect occurs. To reconnect the driver, add IR.GetDevice("DeviceName").Connect().GetSubDeviceParam()

.GetSubDeviceParam()​

Retrieves subdevice parameters in real time.

Syntax IR.GetDevice("DeviceName").GetSubDeviceParam("SubDeviceName")

InputValueDescription
DeviceName"BACNet Network"type: String
BACNet driver name.
SubDeviceName"BACNet Device"type: String
Subdevice name in the BACNet driver.
Output
device_instance0 - 4194302type: Number
Device identifier.
priority1 - 16type: Number
Write operation priority.
network_id1 - 65534type: Number
Network identifier.
Network_ID is conditionally editable. If the device has a configured Network_ID, it sends it and i3 Pro stores the received value. Otherwise, outgoing packets use the specified value (the default or one set by SetSubDeviceParam().
mac_address"45:67:89:AB:DE:23"type: String
MAC address.
update_typeIR.BACNET_AUTO //
IR.BACNET_READ_PROPERTY
type: Object
Feedback acquisition method.

Example

IR.GetDevice("BACNet Network").GetSubDeviceParam("BACNet Device")