This page is a
translated version of the page
BACnet and the translation is 100% complete.
iRidium for BACnet IP
a set of tools for creating visualization interfaces
The driver is meant to control BACnet equipment. Use a project example to have a look at it:
Description
iRidium for BACnet is a set of tools to create an interface to control Smart home or office on the basis of BACnet equipement. It realizes commands of BACnet protocol.
Connection
Control panels (iOS, Android, Windows, Mac) can control BACnet equipment only via BACnet controller.
Import from *xml and *csv files
Configuration of equipment can be saved in xml or csv format and imported to iRidium. ede and hl structures of .csv files are supported.
1 Open StruxureWare Building Operation Workstation and authorize there.
2 Click by the right mouse button to Enterprise server in StruxureWare Building Operation. Select "Import" from the list of options
3 Create a new project in iRidium studio. Find the Devices tab and select Import > BACnet Project(*.xml, *csv) (beta)
. Select a file to import in the window that appears.
4 After importing a dialogue window appears to select the network and subdevices.
A network with subdevices, commands and feedback channels is formed on the basis of the imported file.
When import is done one more time:
1.Networks are united on the basis of the following connection settings Host and Port;
2. If connection settings are identical, names of subdevices are compared and only new ones are added.
Adding Driver Manually
If you can't import data from xml, add the BACnet driver to the project from iRidium database:
Connection settings
When a driver is added to a project with the help of import or manually, indicate connection settings.
- Log Level - level of driver logging,
- Host - controller IP address
- Port - connection port to send data (it is 47808 by default, the driver send requests to the agent),
- Send Timeout - time for data sending in milliseconds
- Update Timeout - time for data update in sending buffer in milliseconds. Update Timeout must be several times as big as Send Timeout.
- Re-subscribe Timeout (min) - time to update subscription.
- LocalPort - connection port to receive data (it is 47808 by default, the agent send response to the driver),
If there are two drivers in the project, LocalPort must be different.
Setting Parameters of BACnet-devices
Devices in BACnet has several important settings.
- Device Instance - ID of Bacnet device. It is seen in the controller web-interface
- Priority - the value of this parameter can vary from 1 to 16 and it means the priority of writing an opearation. Prioritising BACnet commands
- Network ID - Network numbers must be unique on a BACnet system regardless of the protocol. BACnet MS/TP and BACnet/IP network numbers cannot be duplicated. A network number can range from 1 – 65,534 (with 65,535 reserved for broadcasts).
- Maс address - are the lowest level addressing scheme in BACnet. In i-Vu® Open Control systems, MS/TP MAC addresses range from 1 – 99 and must be unique for each device within an MS/TP network.
- Update type - type of update of feedbacks in the protocol (subscription or request):
- Auto (subscribe cov or read property) - automatic type detection.
- Read property - obligatory request of variables.
Change of Connection Settings
You need the possibility to change connection properties when you disconnect from the Wi-Fi network of the automation object and start using 3G or another Wi-Fi network. To maintain control of the object you need to switch from the local to public IP-address of the Internet router.
The switch is not automatic. You have to select the connection mode. For remote acces you have to make ports for controlling the automation system public. In order to do that you have o set up the Port Forwarding service on your Internet router. VPN can provide protected connection.
1 Download the template (*.js) (right-click button: "Save object as ..."), add the template in the script editor with the button (+) Add Script from file
2 Set up script properties as it is 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 Projeсt Device Panel - the list of properties has to be copied from the example.
3 Select the button which will be responsible for the switch of Internal and External properties. Open Macros Editor
for the Press event (Object Properties > Programming), select the Script Call
command and add it by double-clicking on it. Select the name of the function which will be activated by the button:
Now each pressing on the button will apply the corresponding connection properties.
Commands & Feedbacks
To control equipment it is required to set commands (Commands) and feedback channels (Feedbacks). To send a command, drag'n'drop it on a graphic item and enter a value to send. To display feedback drag'n'drop a feedback channel on a graphic item and choose how to output or display a value.
Read more about work with graphic items in the
"Types of graphic items" article.
Setting up
To set a command or a feedback channel, set the following fields:
- Property Type - type of channel/tag value:
- Present Value - mode of reading values from device,
- Out of Service - mode of recording values from the panel,
- Object Type - type of variable
- ObjectID - variable ID (input, output). It can be found in the controller web-interface -> BaCnet Interface - Application - Points - Variable - Advanced Tab
- COV increment - minimal value change for data update.
The following types of variables are supported:
Object Types
type |
description
|
analog-input |
Analogue input
|
analog-output |
Analogue output
|
analog-value |
Analogue value
|
binary-input |
Binary input
|
binary-output |
Binary output
|
binary-value |
Binary value
|
multi-state-input |
Input with multiple states
|
multi-state-output |
Output with multiple states
|
multi-state-value |
Value with multiple states
|
Scripting methods
.SetSubDeviceParam()
The function is implemented to set the parameters in i3Pro app for BACnet driver subdevices.
Syntax
IR.GetDevice("DeviceName").SetSubDeviceParam("SubDeviceName", {
"device_instance": value,
"priority": value,
"network_id": value,
"mac_address": “value”,
"update_type": value
});
input |
value |
value
|
DeviceName |
"BACNet Network" |
type: String BACNet driver name.
|
SubDeviceName |
"BACNet Device" |
type: String Subdevice name in the BACNet driver.
|
output |
|
|
device_instance |
0 - 4194302 |
type: Number Parameter to change the identifier.
|
priority |
1 - 16 |
type: Number Parameter to change the priority of the write operation.
|
network_id |
1 - 65534 |
type: Number The parameter sets the ID value (it is a conditionally changeable parameter). If the device has a configured Network_ID, it will send it to you and i3Pro app will write the received value. If not, the packets will be sent with the specified value when sending messages.
|
mac_address |
"45:67:89:AB:DE:23" |
type: String Parameter for changing the MAC-address setting.
|
update_type |
IR.BACNET_AUTO // IR.BACNET_READ_PROPERTY |
type: Object Parameter to change the way to get feedback. There are 2 ways: IR.BACNET_AUTO (if the device supports subscription-based operation, feedback will be received from the device upon changes; if the device doesn't support subscription-based operation, i3Pro app will poll the device). IR.BACNET_READ_PROPERTY (i3Pro app will poll 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();
Disconnect occurs after the .SetSubDeviceParam function runs.
Add a IR.GetDevice("DeviceName").Connect() function to reconnect to the driver.
.GetSubDeviceParam()
The function is implemented to get the parameters of the subdevice in real time.
Syntax
IR.GetDevice("DeviceName").GetSubDeviceParam("SubDeviceName");
input |
value |
description
|
DeviceName |
"BACNet Network" |
type: String BACNet driver name.
|
SubDeviceName |
"BACNet Device" |
type: String Subdevice name in the BACNet driver.
|
output |
|
|
device_instance |
0 - 4194302 |
type: Number Device ID.
|
priority |
1 - 16 |
type: Number Priority of write operation.
|
network_id |
1 - 65534 |
type: Number Network ID. Network_ID is a conditionally changeable parameter. If the device has a configured Network_ID, it will send it and the received value will be saved in i3 Pro app. If there is no configured Network_ID, packets will be sent with the specified value (by default or using a function) when sending messages. SetSubDeviceParam().
|
mac_address |
"45:67:89:AB:DE:23" |
type: String MAC address.
|
update_type |
IR.BACNET_AUTO // IR.BACNET_READ_PROPERTY |
type: Object The way to get feedback.
|
Example
IR.GetDevice("BACNet Network").GetSubDeviceParam("BACNet Device");