Purpose of This Document
The purpose of this document is to provide practical guidance for configuring, troubleshooting, and debugging BACnet communication between Web Port and BACnet-enabled devices. It is intended to help users identify and resolve common integration issues related to network configuration, device settings, alarm handling, scheduling, and BACnet object interaction.
Communication settings
Direct communication
When communicating directly with the controller, usually only two settings are needed in device settings. Those are Port and BACnet-device fields. Select correct port and fill the BACnet-device field with device's BACnet ID and IP address. Format is BACnet ID@IP Address.
If you are integrating the device for first time check setting Reload configuration. This needs to be done every time PLC’s program has changed and there are new objects or objects are removed. It will create configuration file that Web Port uses for communicating with the BACnet device.
You may also check setting Use AlarmSync so 2-way sync of alarms is activated. This means that if acknowledge alarm in Web Port, it will be acknowledged in the device and vice versa.
Picture 1. Example of device settings using direct communication
Communication via BBMD
If communication is done via BBMD, the difference from direct communication settings is that user must fill BBMD-settings as well. BACnet-device field’s format is now “device:BACnet ID” Reload configuration and Use AlarmSync settings are used same way.
Picture 2. Example of device settings using BBMD communication
Communication settings using Web Port’s OpenVPN Management
Direct communication
When communicating directly with the controller, usually only two settings are needed in device settings. Those are Port and BACnet-device fields. Select correct port and fill in the BACnet-device field with device's BACnet ID and OpenVPN tunnel’s IP address. You can find the tunnel’s IP address from OpenVPN Management tool’s clients. Port forwarding is used in router to route tunnel IP address to device’s IP address. Format is BACnet ID@IP Address.
Picture 3. IP address to device settings when using OpenVPN Management
If you are integrating the device for first time check setting Reload configuration. This needs to be done every time PLC’s program has changed and there are new objects or objects are removed. It will create configuration file that Web Port uses for communicating with the BACnet device.
You may also check setting Use AlarmSync so 2-way sync of alarms is activated. This means that if alarm is acknowledged in Web Port, it will be acknowledged in the device and vice versa.
Picture 4. Example of device settings using direct communication with OpenVPN Management
Router Settings (Teltonika router)
Note that Teltonika’s user interface changes quite often between firmware versions and different devices, so settings may look a little different in your device.
OpenVPN connection
OpenVPN configuration file that Web Port created, can be imported to Teltonika router. The OpenVPN tunnel is created in path Services->VPN->OpenVPN. Add new instance. Set Role as client, Name and Upload config file. Select the configuration file and click save.
Picture 5. Example settings for creating an OpenVPN connection on a Teltonika router
Port forwarding
To get the connection working between Web Port and BACnet device, port forwarding is needed. Port forward setting can be found in Network->Firewall->Port Forwards. Add new instance with desired name, fill in used port to External Port field (BAC0 = 47808 for example) and device’s IP address to Internal IP Address field. After you click add, more settings pop up. There you need to change the source zone to openvpn.
Picture 6. Example settings for port forwarding an OpenVPN connection to BACnet device on a Teltonika router
Scheduled reboot
Set a scheduled reboot for the router once a week. Sometimes BACnet communication gets very slow or stops working if router has high up time.
Updating firmware
When you update the firmware of the device, update from file, not server. Update from server has caused issues where OpenVPN or port forwards don’t work even if they appear to be functional.
Multiple devices in same OpenVPN tunnel
If you have multiple devices connected to same router, you need to use different ports for each device in Web Port to get connection working. This is because you need to use the tunnel’s IP address in Web Port’s device settings. Here is an example of two different devices in same port.
Picture 7. Example of device settings for device 1 (left) and device 2 (right)
Then we must route the connection to correct port in router. For those two devices port forwarding settings could look like this:
Picture 8. Example of port forwardings for device 1 and device 2
Tips & Tricks
Local schedules
Tag
If there is schedule object in BACnet device, it can be controlled with Web Port’s local schedules. Tag address for the schedule object should point to the object and other parameters aren’t needed (ie. present-value). Tag datatype should be SCHEDULE.
Picture 9. Example of schedule tag settings
Schedule
Here is example of setting up a local schedule in Web Port. In local schedule settings Active checkbox needs to be checked. Tag-reference field should be filled with the SCHEDULE tag. # On/Off field should be filled with estimated number of events per day. If you leave 0 to it and try to add an event you will get “Too many events” error. Action field for states should contain “local=Value in device”, so if schedules off state has value 0 then action for off state should be “local=0”. Notice that local must be written in lowercase characters.
Picture 10. Example of schedule settings for local schedule
Alarms
Use AlarmSync setting
If check setting Use AlarmSync in device’s settings, 2-way sync of alarms is activated. This means that if alarm is acknowledged in Web Port, it will be acknowledged in the device and vice versa.
Off normal alarm
When BACnet object is in off-normal alarming state, its event state property has value of 2. When we are looking for specific value in property, we can add "=” to address. So, for example, if we add =2 at the end of address, tag value will be 1 when in this case event state of the object is 2, otherwise it would be 0.
Picture 11. Example of tag settings for off-normal alarms.
Limit alarms
Limit alarms can be in analog input object and therefore object would be in high limit alarm state when its event state property has value of 3. If low limit alarm is active object’s event state would have value of 4. In the picture below there are also examples of setting the limit values for the alarms.
Picture 12. Example of tag settings for analog input limit alarms.
Fault alarm
When BACnet object is in fault alarming state, its event state property has value of 1. Here is example of setting fault alarm tag.
Picture 13. Example of tag settings for fault alarms.
Extended alarms in Siemens PLCs
Some alarms in Siemens PLCs are so-called extended alarms. These are typically used for plant or personnel safety reasons. For example, to prevent an air handling unit from restarting before the alarm has been reset.
For now, we need to use workaround in Web Port to be able to reset the alarms. In workaround, second tag for acked-transitions need to be made and used in alarm criteria. Acked transitions tag should be trended and have low trend interval (eg. 10 seconds) for working better.
Picture 14. Example of tag settings for extended alarms in Siemens PLC's.
Alarm criteria to the alarming tag should be then set like this.
Picture 15. Alarm criteria for extended alarms in Siemens PLC's.
Manual operation example
Tags
BACnet uses priorities in communication. Web Port uses priority 16 by default. Priority 8 is defined as manual operation priority in BACnet. Web Port can write values with different priorities when using “!” in address. For example, writing with priority 8, you would have !8 at the end of address. !!8 is then used to release that priority. Here is example of tags used for manual operation.
Picture 16. Tag settings for manual operation.
Function in lib.conf
To be able to set manual operation from side panel in graphic page, function must be made in lib.conf of symbol library. Here is example of function that releases the manual operation from tag. It writes 0 to tag with suffix _M when button is clicked.
"F16": {
"Description": "BACnet manual operation example",
"Type": "Select",
"Action": "Reset manual operation:M=0",
"Level": "Manual operation",
"Access": 3
}
Picture 17. Function in lib.conf for BACnet manual operation.
Manual operation in graphic page
When person wants to control tag manually, they write the value to the field which controls the tag that has _OPM suffix. When they want to release the manual operation, they click the reset manual operation button.
Picture 18. Manual operation in side panel.
Debugging
Debugging with Web Port
Web Port has some built-in debugging tools, which can perform IO reading/writing and pinging IP Addresses. Those can be found under System settings -> Debug. Those can be handy for testing if the connection is actually working and if Web Port can read known objects from PLC.
Picture 19. Example of debugging with Web Port's debug function.
Debug logs
When Debug mode is checked in device settings, there will be more info from device. All the trend and alarm cycle readings and value writings will be printed there and info from device resets etc.
Debugging with Yabe
Yabe is a great tool for debugging BACnet problems. It’s free open-source program and wide set of features like writing and reading values, acknowledging alarms etc. Web Port’s BACnet driver is based on the Yabe libraries as well.
If Web Port cloud is hosted by Kiona, Yabe can be used by connecting through Web Port’s OpenVPN Management Tool.
Connecting to device with Yabe
First you need to create new BACnet communication channel in Yabe, choose to correct local endpoint and click Start button.
Picture 20. Creating a communication channel in Yabe
After you have created the communication channel, you can connect to the device. This can be done under Functions -> IP Services.
Picture 21. Connecting to device in Yabe
There are two possible ways to connect. Use Foreign Device Registration when device is using BBMD. There you need to set IP address of the BBMD device and port for communication.
If device uses direct IP communication, use Add Remote BACnet/IP node option. There you need to set device’s BACnet ID, IP address and port.
Picture 22. Connection settings to remote BACnet/Ip node in Yabe
Browsing objects with Yabe
When connection towards device is set, you can load BACnet objects of it by clicking the device. After Yabe has finished loading objects, you can browse properties of the objects by clicking them. Properties will be shown on the right side.
Picture 23. Browsing BACnet objects in Yabe
Device errors
Device won’t try to connect and is in offline state
Web Port does not support the same BACnet IDs for multiple devices using the same port, so all devices communicating through the same port must have unique BACnet IDs. If you add a device to Web Port and it does not attempt to connect, you should check whether another device is using the same BACnet ID.
Tag errors
BACnet object not found
This error occurs when tag has an address that isn’t defined in configuration file that Web Port creates when Reload configuration setting is checked in device settings. You can download the configuration file from Import tags side panel menu. File name is combination of BACnet id and port used in device settings.
Picture 24. Downloading BACnet config file from Web Port
Here are some possible causes and fixes:
- Device’s program has changed and there are new BACnet objects that have been added manually to tag list, but the configuration file hasn’t been reloaded. -> Reload configuration file
- Device’s program has changed and some BACnet objects are deleted from the program. -> Delete objects that are deleted from tag lists and reload the configuration file
- Typo in device address. -> Fix tag address
- Some devices have characters like (., <, >, =) in device address and that could cause reading errors. -> Use id from configuration file instead (for example. BINARY-INPUT:34.present-value)
Error from device: ERROR_CLASS_PROPERTY - ERROR_CODE_INVALID_DATA_TYPE
This error usually happens only when Web Port tries to write value. Reading still works. Cause is wrong datatype in Web Port. Correct datatype can be checked with Yabe, when clicking property that is being written.
Picture 25. How to check data type of BACnet property in Yabe
Error: Failed ReadTag
When this error shows in tag status, debug log should be checked to see if it provides more information.
Here are some possible causes and fixes:
- Invalid property. Typo in property or BACnet object doesn’t have property that is trying to be read -> Check object’s properties with Yabe
Picture 26. Error in debug log
DrvBACnet
More info about BACnet Driver here: