Beckhoff TwinCAT 3 as KNX Building Controller: EL6900 Terminal and BA Library
Overview
Beckhoff TwinCAT 3 with EL6900 EtherCAT KNX terminal is used in high-specification commercial buildings where deterministic control, complex logic, and multi-protocol integration are required in a single DIN-rail controller.
Hardware Setup
CX9020 Embedded PC (ARM, fanless, 24VDC) runs TwinCAT 3 runtime. Mount CX9020 on DIN rail, attach EL6900 EtherCAT terminal (adjacent, EtherCAT E-bus connection). EL6900 connects to KNX TP bus via terminal block (KNX+ and KNX- pins). No IP interface or separate KNX coupler needed — KNX TP bus is mastered directly from TwinCAT.
TwinCAT 3 BA Library
Import via TwinCAT Package Manager. Key function blocks: 'FB_KNX_Switch' maps a BOOL variable to KNX group object (DPT 1.001 on/off); 'FB_KNX_RoomController' is a PI setpoint controller with inputs (room temp, setpoint, occupancy) and outputs (valve position 0-100%, fan speed 0-100%, window contact); 'FB_KNX_DALI' is a DALI gateway proxy that sends group dim value (0-255) via KNX to DALI gateway. Scan cycle: TwinCAT 3 task cycle 10ms — guaranteed deterministic, unlike general-purpose OS platforms.
BACnet/IP and Multi-Protocol Integration
TwinCAT 3 TC3 BACnet library or BK9050 coupler creates a BACnet/IP device for Metasys/Priva/ECLYPSE BMS connectivity. KNX to BACnet mapping is done in TwinCAT structured text code. Modbus TCP: 'FB_ModbusTCP_Client' polls energy meters (SOCOMEC Countis, Eastron SDM630) every 10s — results written directly to KNX group objects. Example: Eastron SDM630 Modbus reg 0x0C (active power) → TwinCAT REAL variable → KNX GA (DPT 9.001 W) updated every 10s.
KNX Secure
TwinCAT 3 supports KNX Data Security — EL6900 encrypts group telegrams. Configure group keys in ETS6 Backbone Key Tool, import into TwinCAT EL6900 configuration.
Commissioning
TwinCAT Scope View visualises KNX group object values in real time — useful for verifying room controller output without a separate SCADA system.
Need help with your KNX or DALI project?
Our certified engineers can discuss panel design, commissioning, integrations and project-specific edge cases. Free initial consultation.
Contact our engineers →