Skip to content
The text was updated for 2.10; the screenshots are from version 2.5.0 and may differ from the interface.

BACnet ​

About 11 min read

The BACnet protocol lets 2WinScada communicate with building automation controllers, HVAC devices and similar BACnet/IP devices. 2WinScada acts as a client on the network; it periodically reads and writes the Present Value property of the objects on the devices.

Main supported features:

  • BACnet/IP (IPv4) communication over UDP
  • Discovering devices on the network with Who-Is / I-Am and bulk import
  • Reading tags from the device's object list and bulk import
  • Access to devices on other subnets by registering with a BBMD as a foreign device (Foreign Device)
  • Automatically finding the device address from the BACnet device identifier (Automatic Who Is)

Serial lines such as BACnet MS/TP and COV (Change of Value) subscriptions are not used; values are polled according to each tag's Update Interval[s] value.

License ​

BACnet is one of the standard protocols and is available in all of the Starter, Standard and Professional license editions. For details, see the License page.

Channel Definition ​

On the General tab of the new channel window, enter the channel name and select BacNetIP as the Connection Type. After making the settings on the other tabs, click Save.

Connection Parameters tab of a BACnet channel

Connection Parameters tab:

FieldDescriptionDefaultRange
PortUDP port 2WinScada uses for BACnet/IP. The standard BACnet/IP port is 47808 (hexadecimal 0xBAC0).478081–65535; required
Timeout [ms]Time to wait for the response to a request30003000–86400000
RetriesNumber of times a request with no response is sent again30–10

Advanced Parameters tab:

FieldDescriptionDefaultRange
Local Endpoint IpIPv4 address of the local network interface used for BACnet traffic. If the server has more than one network card, enter the address of the card connected to the BACnet network. If left empty, the interface is selected automatically.EmptyIPv4 address
Max PayloadLargest BACnet payload carried in one UDP packet (bytes). 1472 suits the standard Ethernet MTU (1500 bytes).1472128–16384
Use Exclusive PortIf selected, the Port is opened exclusively (not shared) for this channel. Do not select this option if another BACnet application on the same server uses the same port.Off—
Dont FragmentSets the "Don't Fragment" flag in the IP packets sent. If a packet is larger than the MTU on the path, it is dropped instead of fragmented.Off—
Register As Foreign DeviceRegisters 2WinScada as a foreign device with a BBMD (BACnet Broadcast Management Device). Used when the devices are on a different IP subnet and discovery broadcasts do not pass the router.Off—

Advanced Parameters tab of a BACnet channel

When Register As Foreign Device is selected, the BBMD Devices group appears:

FieldDescriptionDefaultRange
Ip AdressIPv4 address of the BBMDEmptyIPv4 address
PortUDP port of the BBMD478081–65535
Time To Live(TTL)How long the registration stays valid on the BBMD (seconds)301–32767

The BBMD registration is made only while Register As Foreign Device is selected and the BBMD Ip Adress is entered; while the option is off, no registration packet is sent to the BBMD. While registration is on, 2WinScada renews the registration by itself at half of the Time To Live(TTL) period (but no more often than every 10 seconds). An expired registration affects only discovery; reading and writing with devices whose address is known continue directly over the IP address.

Importing devices ​

On a saved channel, the Import Devices button in the Devices group of the Advanced Parameters tab lists the BACnet devices discovered on the network. The button is inactive until the channel is saved.

  1. Click Import Devices. The BacNet Device Selection window lists the devices that have sent an I-Am response since the channel started.
  2. If the list is incomplete, click Send WhoIs. 2WinScada sends a Who-Is broadcast to the network (and also through the BBMD if BBMD registration is on). The button stays inactive for 30 seconds. Devices that have not responded for 15 minutes are removed from the list at this point.
  3. Depending on the number of devices on the network, the responses may take time to arrive. To refresh the list, click Refresh Data.
  4. The list shows the Name, Address, BacNet Device Id, Address Type and Network columns. Select the devices to import, click Select and accept the confirmation window.

The selected devices are saved directly with their name, address and device identifier and are added as active. On imported devices, Automatic Who Is is off; the address is taken from the I-Am response. At the end of the operation, the numbers of imported, failed and unsuitable records are reported.

TIP

Discovery and import require the channel to be running in the 2WinScada service. If the list is empty, check that the channel is saved, that the license allows BACnet and that UDP 47808 traffic passes the firewall.

Device Definition ​

A device record represents a single BACnet device. On the General tab, the Name and Active fields are set as for other protocols. On imported devices, the parameters are already filled in.

Parameters tab:

FieldDescriptionDefault / rule
AddressIPv4 address and UDP port of the device, in the IP:port format (e.g. 192.168.1.20:47808)Required while Automatic Who Is is off
BacNet Device IdBACnet Device object number of the device (Device Instance). Must be unique for each device on the network.Required; digits only, 0–4194303
Address TypeType of the address. Only IP (IPv4) can be selected.IP
NetworkBACnet network number where the device is located. Leave it 0 if the device is on the same IP network; for networks behind a BACnet router, enter the network number defined on the router.0
Automatic Who IsIf selected, the device address is found automatically with Who-Is using the BacNet Device Id, and the Address field is not used.On for a new device

2WinScada performs BACnet/IP communication over IPv4 UDP, and the Address field accepts only the IPv4 IP:port format. IPv6 is not supported; the server also rejects a save with an address type other than IP. Devices saved with an IPv6 static address in earlier versions are not deleted; they show Bad quality and the issue is written to the service log. Save these devices with IP selected as the Address Type and an IPv4 address.

While Automatic Who Is is on:

  • 2WinScada sends Who-Is only for this device identifier (and also through the BBMD if BBMD registration is on) and waits about 3 seconds for a response. If the address is not found, the attempt is repeated every 30 seconds.
  • If 4 tag reads fail in a row, the address is searched again. This way, devices whose IP address changes are reached again.

While Automatic Who Is is off, the address in the Address field is used directly and no new search is made.

Importing tags ​

The Import Tags button is in the Tags group on the Advanced Parameters tab of a saved device. The button is inactive until the device is saved.

  1. Click Import Tags. 2WinScada reads the device's object list (Object List) and queries the name and type of each object.
  2. The window that opens shows the Name, Address and Data Type columns. Select the rows to import, click Select and accept the confirmation window.
  3. The selected tags are added to the device with their name, address and data type. The other tag fields are created with their default values.

Only the objects in the object types table appear in the list. The device must be active and its address must be known; on a device with Automatic Who Is on, the list is empty if the address has not been found yet.

Import Tags window

Tag Definition ​

Tags are defined in the device's tag table in the same way as for other protocols (see Tag Management). In the Address field, write the object type and the object number (instance) separated by a colon:

text
<OBJECT_TYPE>:<instance>

Examples:

AddressMeaning
OBJECT_ANALOG_INPUT:5Analog Input number 5
OBJECT_ANALOG_VALUE:5Analog Value number 5 (e.g. a setpoint)
OBJECT_BINARY_VALUE:5Binary Value number 5
OBJECT_MULTI_STATE_VALUE:2Multi-state Value number 2

The object type name is case-sensitive and must be written as in the table below. If the address cannot be resolved, the tag is not read.

Object types and data types ​

Object types listed by Import Tags and the assigned Data Type:

Object typeName in the addressData Type
Analog InputOBJECT_ANALOG_INPUTReal
Analog OutputOBJECT_ANALOG_OUTPUTReal
Analog ValueOBJECT_ANALOG_VALUEReal
Binary InputOBJECT_BINARY_INPUTBool
Binary OutputOBJECT_BINARY_OUTPUTBool
Binary ValueOBJECT_BINARY_VALUEBool
Multi-state InputOBJECT_MULTI_STATE_INPUTInt
Multi-state OutputOBJECT_MULTI_STATE_OUTPUTInt
Multi-state ValueOBJECT_MULTI_STATE_VALUEInt
CharacterString ValueOBJECT_CHARACTERSTRING_VALUEString

Other object types with a Present Value property (e.g. OBJECT_INTEGER_VALUE:1) can be defined manually; in this case, choose a Data Type that matches the value on the device.

Read and write behavior ​

  • Each tag is updated by reading the object's Present Value property when its Update Interval[s] expires. The tag value changes only when the value read changes.
  • The quality of a tag that cannot be read becomes Bad. When at least one tag can be read from the device, the device quality becomes Good.
  • Writing is done to the object's Present Value property and is supported only for Analog, Binary and Multi-state Input/Output/Value objects. The value is sent with the BACnet data type that matches the object type:
ObjectType sentAccepted value
AnalogREAL (DOUBLE if the Data Type is LReal)A number; for REAL, within the single-precision range
BinaryENUMERATEDOnly 0 or 1 (Bool values are sent as 0/1)
Multi-stateUNSIGNEDAn integer of 1 or greater (state number)
  • Writing to String (CharacterString) tags and to other object types is not supported. An unsuitable value (e.g. 2 for Binary, 0 or a fractional value for Multi-state) is rejected without being sent to the device.
  • No priority is specified in the write request; by the BACnet standard, the device then applies the lowest priority, 16. If a command with a higher priority exists, the written value has no effect.
  • After writing, 2WinScada waits for the device's acknowledgment using the channel's Timeout [ms] and Retries values. A rejected or unacknowledged write does not appear successful: the warning Write request rejected: the server could not hand the request to the driver. appears on the screen of the user who made the write, the reason is written to the service log and the write is not recorded in the Operation History. In Recipe Apply, these items are listed as failed.

WARNING

Before trying write operations on a live plant, check the device documentation, that the object is writable and the priority array (Priority Array). During initial commissioning, define tags as Read Only.

Troubleshooting ​

SymptomChecks
The device list is emptyCheck that the channel is saved, that it is running in the 2WinScada service and that the license allows BACnet. After Send WhoIs, refresh the list with Refresh Data. Check the firewall for UDP 47808 and the Local Endpoint Ip value.
Devices on another subnet do not appearCheck the Register As Foreign Device setting, the BBMD Ip Adress and Port values, and that the BBMD accepts foreign device registration.
No response arrives, the port is used by another applicationIf another BACnet application on the same server uses port 47808, clear Use Exclusive Port or use a different port.
The device cannot be found (Automatic Who Is)Check that the BacNet Device Id value is the same as the Device Instance on the device. The search is repeated every 30 seconds. If needed, clear Automatic Who Is and enter the Address.
Tag quality is BadCheck the object type name and number in the address, that the device is reachable and the Timeout [ms] value.
The Import Tags list is emptyCheck that the device is saved and active and that its address has been found.
The write has no effectCheck the Read Only setting, that the object is writable and that no command with a higher priority exists. Details are in the service log.
"Write request rejected" warning on writeCheck that the object type supports writing, that the value matches the object type (Binary 0/1, Multi-state an integer of 1 or greater) and that the device accepts the write. The reason for the rejection is in the service log.
Device quality is Bad, address type IPv6IPv6 is not supported. Save the device with IP selected as the Address Type and an IPv4 address.

2WinScada 2.10