BACnet Network Configuration

The WinCC OA BACnet driver is supporting the BACnet/IP and BACnet/Secure Connect (BACnet/SC) data link protocols. A driver instance can be connected to either a BACnet/IP or a BACnet/SC network. The following sections describe how to set up the driver to connect to such networks.

BACnet/IP

This section includes an example for the BACnet driver configuration in the config file. For details about the possible configs in the config file see Possible Config Entries of the BACnet Driver.

For a start of the BACnet driver the config entry [bacnet] net is mandatory:

This entry configures the type of connection to the BACnet devices:

Syntax

net = <Network> "IP" <IPAddress> <Subnetmask> <UDPPort> <BBMDAddress> <BBMDMaxForeignDevices> <ForeignDeviceHoldingTime>

The parameters have the following meaning:

Network
The unique assigned network number. Currently the BACnet driver is able to communicate with only one network.
IP
Protocol type. The current version supports IP (BACnet/IP).
IPAddress
IP address of the network card, over which the BACnet/IP net is accessible. If the entry is empty, the IP address is specified by the own host name. The latter works only then when there is only one network card attached/used in the computer.
Subnetmask
The subnetmask defines the broadcast addresses, with which the broadcasts are sent into the BACnet net. If the subnetmask entry is empty ("") so the subnetmask of the configures network connection is used.
UDPPort
UDP port is used for the BACnet/IP communication. In most cases the port has to be set to 47808 (0xBAC0).
BBMDAddress
IP address of "BACnet/IP Broadcast Management Device". If the BACnet driver should use a BBMD as client, the entry must be set to the IP address of the BBMD.
BBMDMaxForeignDevices
If the BACnet driver should work as BBMD, the value must be set higher than 0. The value defines the maximum number of foreign devices (default = 0).
ForeignDeviceHoldingTime
Holding time for foreign devices (default = 120 seconds).

Example for the BACnet driver config file

[bacnet]
net = 1 "IP" "" "" 47808 "" 0 120

BACnet/IP Broadcast Management Device (BBMD)

Broadcast messages (Who-Is) are used to discover BACnet devices within a local network. However, IP routers cannot transmit these messages to other networks, which means that only devices within the local network receive the messages. Therefore, devices in other networks are not discovered.

This issue is solved by using BBMDs. There must be one BBMD for each subnetwork. A BBMD might be a device or a software application and is used to forward the broadcast messages received from local network via unicasts to the BBMDs of the other networks. These BBMDs will distribute the request in their local network.

WinCC OA BACnet driver as BBMD

If the WinCC OA BACnet driver is to be used as a BBMD in one of the subnets, proceed as follows:

Define the config entry [bacnet] net and set the appropriate value for BBMDMaxForeignDevices.

As a result, the driver automatically creates the "bdt_<network number>" file in the /data folder of the project. The network number is the unique assigned network number defined via the config entry [bacnet] net. You can change the file location by the bacnetBdtLocation config entry.

If the driver receives a message from the BBMD of another subnet, the corresponding entry for this BBMD is set automatically. However, it may be the case that not all BBMDs are automatically registered in the file. It is therefore safer to enter all necessary BBMD entries manually. The corresponding syntax is described in the header of the bdt file.

If the file is correctly defined, the driver sends Who-Is messages not only as local broadcasts but also directed to the given BBMDs in other networks.

WinCC OA BACnet driver using a BBMD

If there is already another BBMD in the subnetwork, the driver can use this device by setting the BBMD IP address in the config entry [bacnet] netas BBMDAddress.

BACnet/SC

The BACnet/SC uses as data link a websocket connection. This websocket connection provides the needed security like encryption.

For BACnet/SC different modes are defined in the specification. These are:

  • Node without hub function
  • Node with hub function
  • Direct connect

Of these modes, the BACnet driver only supports the Node without hub function mode. This means that a node with hub function must be available in the BACnet/SC network.

For setting up the BACnet/SC configuration the config entry [bacnet] net has a different syntax.

net = <Network> "SC" <IPAddress> <PrimaryHub> <SecondaryHub>
IPAddress
IP address of the network card via which the BACnet/IP network can be reached.
PrimaryHub
URL of primary BACnet Secure Hub (mandatory).
SecondaryHub
URL of the secondary BACnet Secure Hub. This must be set to an empty string if none is available.

To configure the web socket connection, security certificates must be defined. This must be done with the mandatory entries in the config file [bacnet] secureCACertificate, [bacnet] secureCertificate, ../cfg_doku/all_config_entries.html#bacnet__secureCertificateLKey. See also config entry description. These entries must define the certificate/key files in PEM format.