Configuration

BACnet MS/TP is supported in the following versions of TwinCAT:

  • TwinCAT2, Build 2259
  • TwinCAT3, Build 4022 (BETA)

BACnet MS/TP is supported in the following controllers:

  • Min. CX9020 or higher

BACnet MS/TP device

BACnet MS/TP may be configured in the TwinCAT System Manager in the device category „BACnet“. A MS/TP connection may be added to the system configuration by selecting "I/O Devices". The MS/TP device connects a terminal EL6861 to the TwinCAT system.

It is recommended to scan the terminals before adding a MS/TP device. The terminal / IO-device connection may be specified in a single step.

Configuration 1:
Inserting BACnet MS/TP Device in TwinCAT

In the following dialog all EL6861 terminals available in the system configuration are shown in a list. Multiple MS/TP channels may be connected to a single controller. Each of the terminals may be operated as a single sub-bus-system or optionally be included into a routing to other MS/TP channels or BACnet/IP.

Select the terminal you want to connect to the MS/TP IO device.

Configuration 2:
Selection of the desired terminal

EIA-485 Adapter

Specify the settings for the MS/TP interface in the following dialog box:.

Configuration 3:
Setting of the MS/TP interface

Adapter

Select the EL6861 terminal to connect to the BACnet MS/TP IO device.

Baudrate

Select the baud-rate of the MS/TP network. All devices within the same network shall be configured to the same baud-rate.

Station Address

Setup the station address of the MS/TP IO device. Each MAC-address within one MS/TP network shall be unique. The BACnet MS/TP IO device only supports the MS/TP master mode. Possible values of the station address range from 0-127.

Reply Timeout

Specifies the timeout value how long the IO devices waits for a response „DataAvailable“ or „ReceiveError“. The default value equals 255ms and may be adjusted up to 300ms if necessary.

Usage Timeout

Specifies the minimum time without receipt of a „DataAvailable“ or „ReceiveError“ telegram the node has to wait before using the token or responding to a PollForMaster telegram. The default value equals 20ms and may be adjusted up to 100ms if necessary.

Max Master

Specifies the highest station address used in the network. If the highest address is not known, the default value of 127 shall be used.

Max Info Frames

Specifies the number of telegrams the device may send before it has to pass the token to he successor device. The standard value equals 30.

Scan Devices – Only Run Mode

Scan MS/TP Devices: This option allows to determine MS/TP devices connected to the terminal using the BACnet-services „Who-Is“ and „I-Am“. Slave-devices do not support this functionality and must be configured manually. This function is only available in Run-mode. The PLC project has to be activated and the PLC needs to be in Run-mode. After this Dynamic Device Binding feature may be used to determine other MS/TP masters on the network. If MS/TP devices were found and transferred to the System Manager configuration, this configuration needs to be activated again.

Configuration 4:
Dialog „Scanning BACnet Devices“

Capture Settings

Live Capture: This option captures the communication within the MS/TP network. The capture files may be used for analysis using network tools like Wireshark. This option is only available in TwinCAT3.

The capture file will be stored on a local storage medium. Depending upon the operating system the names may vary. In the example below the filename “capture” and a USB memory stick („Hard Disk2“) connected to the PLC was used.

The button „Start“ starts the capture process, the number of telegrams captured is displayed in the right column of the dialog window. The button „Stop“ terminates the capture process. After this the storage media may be disconnected from the PLC.

Configuration 5:
TwinCAT3: Ethernet Capture Start
Configuration 6:
TwinCAT3: Ethernet Capture Stop

The captured file uses the file extension „.pcap“ and may directly imported into Wireshark or other network analysis tools. In addition the filename contains date and time of the capture.

Configuration 7:
Recorded file „capture*.pcap“
Configuration 8:
Display in Wireshark

Rules for unique addressing in a BACnet Internetwork

A BACnet Internetwork describes two or more networks connected by BACnet-router devices (most likely supporting different data-link-layer, e.g. BACnet/IP and MS/TP).

Configuration 9:
Scheme of BACnet Internetwork
  • The Device-instance-number and the Device-object-name shall be unique for all BACnet devices within the entire BACnet-Internetwork.
  • Within each single BACnet-network the MAC address of each device shall be unique. Depending on the data-link-layer the length of the MAC address may be different (BACnet/IP: 6 Byte = 4 Byte IP address+2 Byte UDP-Port, MS/TP: 1 Byte 0-127 for MS/TP master).
  • BACnet-Router, which connect BACnet networks are configured knowing their individual BACnet network number. The BACnet network number of each single BACnet network shall be unique within the entire BACnet internetwork as well.
  • Devices w/o routing capabilities may be configured for BACnet network no. 0, which means they reside within the “local network”.

BACnet-Routing (currently only available in beta state)

BACnet devices using different network media (data-link-layer) may be connected through BACnet router devices. Those devices provide a logical connection on network layer-3. Due to the routing provided the BACnet application layer 7 (reading or writing values, sending alarms, Dynamic Device Binding, etc.) is transparent the all BACnet devices. There is no need to translate the data compared to gateway applications.

BACnet-Network numbers

Every network connected to a BACnet router and so linked to other BACnet networks requires a unique network number in the range from 1-65534. The network number is assigned in the router. The BACnet network number is required to unique with the entire BACnet inter-network (across all connected media and sub-networks). Using the terminal EL6861 it is up to the configuration whether to use the terminal as a single sub-network w/o routing to other networks or connecting to other BACnet networks through the supported routing functionality.

Setting up routing information

The router settings are provided in the dialog „Settings“ / „System Manager Settings“.

Configuration 10:
Setting of the routing information

In the following dialog specify the network number and activate the Checkbox „Enable Routing (beta)“. Confirm these settings by choosing „Save“.

Configuration 11:
Setting oft he network number

Repeat these settings for all BACnet networks which take part in the BACnet routing. (the following example shows the BACnet/IP supplement configured as router).

Configuration 12:
Make settings for all networks

After activating this example configuration a routing between network 1 (MS/TP) and network 2 (BACnet/IP) will be established. Other devices on the network, e.g. a BACnet/IP management station may request data from devices connected to MS/TP.