Using multiple BACnet adapters
The following example illustrates how to use multiple BACnet adapters connecting to different devices.
The example below uses a total of three adapters, 1 x BACnet/IP and 2 x MS/TP using terminals EL6861. The next picture shows the overview in the TwinCAT system manager.
The device BACnet/IP is connected to the network adapter FEC1 of the CX9020.
The first MS/TP device Device 2 (BACnet MSTP) is connected to the terminal named Term 2 (EL6861).
The second MS/TP device Device 3 (BACnet MSTP) is connected to the terminal named Term 3 (EL6861).
All three devices are now connected to the PLC.
In this example devices connected to the network have already been scanned and are available as BACnet client references. Using the function FB Code (see separate chapter for details) code was generated to access the objects through function blocks from the BACnet library.
The next window shows the variables and code in the POU MAIN copied from the created client function blocks.
The code {attribute ‚TcLinkTo‘ := … generates a dynamic connection to the referenced BACnet device. The dynamic connection symbol is marked in green in the system manager.
The default adapter is connected using a manual connection.
The three connections look like this: