Gå videre til hovedindholdet

Deep Dive: Visualizing Raw KNX TP Telegrams


If you spend enough time working with KNX, you eventually find yourself staring at the ETS Bus Monitor, trying to decode telegrams. While ETS provides a great high-level view, it doesn't show you the raw electrical reality of the twisted-pair (TP) bus.


The way KNX TP telegrams are explained to beginners


To bridge this gap, I built the KNX TP Telegram Visualizer. It is a tool designed to take standard KNX inputs and generate the exact physical bitstream and timing parameters as they would appear on the wire. Here is a look under the hood at how the visualizer works and how it models the KNX TP1 standard.

1. Stripping Away cEMI: Logical vs. Physical

One of the biggest hurdles in understanding KNX telegrams is the difference between cEMI (Common EMI) and raw TP formats. The ETS Bus Monitor displays telegrams in the cEMI format. This format adds a two-byte wrapper (Message Code and AddIL) at the beginning of the frame and splits the routing byte into two separate fields.

My visualizer strips this away to show the raw TP bus-side telegram. It calculates exactly what the hardware transmits:

  • Logical Bits: The software representation, ordered Most Significant Bit (MSB) to Least Significant Bit (LSB).

  • Physical Bits: The actual serial character transmitted on the bus. The visualizer accurately constructs this by wrapping the data in a Start-bit ('0'), reversing the payload to transmit LSB first, calculating an Even Parity bit, and appending a Stop-bit ('1').

What I explain to my students on KNX Basic and KNX Advanced courses

2. Dynamic Telegram Assembly and Extended Frames

Under the hood, the visualizer dynamically constructs the telegram byte by byte based on the selected Data Point Type (DPT) and addressing parameters.

  • Header & Payload: It accurately builds the Control Field, Source Address, Destination Address, and the APDU (Application Protocol Data Unit).

  • Extended Frame Detection: The visualizer automatically detects if the payload exceeds the standard 15-byte limit. If it does, it dynamically shifts to the Extended Frame format by setting the Control Field bit 7 to 0 and inserting a dedicated 8-bit Length field.

  • The Hardware Checksum: Because cEMI doesn't include the physical layer checksum, many developers forget it exists. The visualizer calculates this final byte exactly as a KNX transceiver would: by applying a bitwise NOT to the XOR of all preceding bytes.

Timing is everything - a single 1.001_Switch (1 bit DPT) telegram takes approx. 20ms on the bus, while the longest one - download (MemoryWrite) telegram (16 bytes of information) takes only 40ms.

3. Modeling the Signal Waveform

KNX TP1 uses baseband transmission at 9600 bit/s, meaning each bit takes exactly 104 µs. To make this tangible, the visualizer generates a dynamic SVG waveform of the bitstream.

The waveform accurately models the electrical characteristics of the bus:

  • Logical '1' (Passive): The bus remains steady at the baseline DC voltage (around 29 V).

  • Logical '0' (Active): The voltage drops for about 35 µs, followed by an equalization overshoot caused by the power supply's integrated choke.

Because a logical '0' actively pulls the voltage down, it dominates a logical '1' on the bus. This physical reality is exactly how KNX handles CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) to resolve bus collisions.

The logical 1's and 0's on the bus, are controlled by a Choke (from German - Drossel)

4. Precise Timing and Link Layer Acknowledgements

A KNX telegram isn't just a string of data; it is a highly choreographed sequence of timings. The visualizer calculates the entire cycle time, including:

  • Transmission Time: Calculated based on the total number of physical bits at 104 µs per bit.

  • T2 Pause: The mandatory waiting period after the telegram, fixed at exactly 1.352 ms (the length of one 13-bit serial character).

  • LL_ACK (Link Layer Acknowledgement): The visualizer allows you to simulate Positive (0xCC), Negative (0x0C), or Busy (0xC0) responses. It appends this to the waveform, demonstrating how the receiving device acknowledges the frame.

  • T3 Bus Idle Time: The visualizer dynamically calculates the bus idle time required before the next transmission, which shifts based on whether the message uses System priority (50 bit-periods) or a lower priority (53 bit-periods).

T2 pause makes sure the device have time to "understand and decode" the signal before sending LL_ACK back to the sender device

Conclusion

It took me many literations, and right now I am on the version 4. The more I dig deeper into the 50090 standard and official KNX Training Documentation, the more stuff I discover, and more tweaks are made. My future goal would be mapping out every single DPT with different values, just to see what is really happening on the bus, when for example 6-bytes combined value is sending a 4-channel RGBW value to a DALI Gateway?

TRY IT OUT HERE: https://marcdahl.dk/knx/ ]

Kommentarer

Populære opslag fra denne blog

Bound in Ash and Bone: Unearthing 'The Ghouls Almanac'

I am thrilled to finally unveil my latest passion project: The Ghouls Almanac: A Grim Chronicle of the Wasteland . Created with the help of my loving wife and son  —with dark, intricate illustrations conjured alongside Google Gemini —this isn't just an art book. It is a forbidden scripture of the atomic age, written in the style of a post-apocalyptic Necronomicon . If you are a fan of the Fallout universe, you know the stories. But you have never seen them told like this. The Ghouls Almanac is a visceral, mythic retelling of the events of Fallout 1 , Fallout 2 , and Fallout 3 , chronicled by the one soul who lived to see it all: Harold . Before he became the Oasis—a living cathedral of timber and vine —he was the ancient wanderer who witnessed the fall of the Master and the flight of the Enclave . Through Harold's rotting, immortal eyes, the history of the wasteland is documented not as a sci-fi adventure, but as a dark, twisted gospel of flesh, steel, and survival: The Iron ...

A Peek Behind the Scenes of the Wasteland: Download the Unique Fallout Story 'The Stranger Is Not Real'

Have you ever wondered who the man in the trench coat really is? Every time you're in a pinch in Fallout, he appears out of the blue, fires his .44 Magnum, and vanishes into thin air. But where does he go? And what does he actually think about the bizarre things you do in the wasteland? Now you have the chance to find out. In the recently released, fan-made book "The Stranger Is Not Real," we have created a completely unique and entertaining take on the Fallout universe. And the best part? You can download it right now. A Noir Diary from the Edge of Reality "The Stranger Is Not Real" is a brilliant deconstruction of video game logic, told as a hardboiled and cynical noir detective story. We follow the game's most iconic guardian angel—The Mysterious Stranger—through his personal, worn-out logbook entries. Through a series of "cases," our tired narrator slowly begins to realize that he is stuck in an absurd, digital loop. He is forced by a humming i...

The Mythical 1-50: Reclaiming a Missing Piece of 90s Eastern European Childhood

If you grew up in Eastern Europe or a post-Soviet state in the 1990s, you don’t need me to explain what a piece of Turbo gum meant. It wasn't just chewing gum. In a world still shaking off the grayness of the Soviet era, that bright yellow, rock-hard piece of chemical-smelling taffy was a brick of condensed, Western exoticism. But let’s be honest: no one bought it for the gum. We bought it for the treasure hidden inside. We bought it for the wrappers (or "vkladyshi / вкладыши," if you will). The Gateway to a World of Horsepower For us, those wrappers were our first encyclopedias of automotive desire. In a reality where the roads were dominated by Ladas, Zhigulis, and the occasional aging Volga, Turbo wrappers offered us a vibrant, full-color portal to a magical world of Ferraris, Lamborghinis, and Porsches. We didn't just collect them. We traded them, gambled them in playground games involving vigorous hand-slapping, and tacked them to our bedroom walls. We memorized ...