Get in Touch
Back to Projects

·9 min read

SANEL LINLED: Test, Data Acquisition and Analysis Software for Automotive RGB Lighting Modules

Desktop software that monitors the lab tests of the RGB modules lighting the charging connection on Mercedes-Benz's next-generation electric heavy truck: LIN/CAN frame parsing, live tracking of 24 modules, MDF4 recording and SQLite-indexed analysis. Built during my internship at SANEL Auto Electronic.

Tags:automotivecsharpdotnetlin-buscan-busmdf4data-acquisition
Mission 07 · SMT-22In progress· Windows desktop · .NET 10Last updated: My role: Software developer intern · SANEL Auto ElectronicSee it in SMT-22 ↗

Industry project

For Mercedes-Benz's next-generation electric heavy truck

Software that monitors, records and reports the lab tests of the RGB lighting modules that show the vehicle's state in colour around the charging connection.

SANEL Auto Electronic · internship project

Large-file trial: 1.08 GB, 72 million records · indexing ~26 s, full-range query ~0.41 s, peak memory ~88 MB.

Mission specs

Platform
C# / .NET 10 · Windows Forms · Inno Setup installer
Communication
Serial stream over a COM port · LIN telemetry, CAN message structures · manual HEX
Scale
2 chambers, 24 modules · 2 temperature sensors and UV/OV flags per module
Data pipeline
async/await, bounded System.Threading.Channels queues, ArrayPool and Span
Recording
My own MDF 4.10 writer (split sessions) · CSV · binary telemetry
Analysis
SQLite disk index · ScottPlot charts · PDFsharp reports

Mission log

Every change to the project is logged here with its date, newest first.

  1. Site

    Project page published. Chamber names and raw HEX data are blurred in the screenshots.

  2. Development

    Serial link and frame parsing, a live test console for 24 modules, RGB and HEX commands, MDF4/CSV/binary recording, an SQLite-indexed analyser and PDF reports. Development continues.

Image records

Test console

Details

Technical report

Architecture, hardware and software in detail.

Introduction

I developed SANEL LINLED Test Tool to monitor the testing of RGB lighting modules designed for the area around the charging connection on Mercedes-Benz's next-generation electric heavy commercial vehicle. The product uses coloured indicators, such as a green light while charging, to tell the user what state the vehicle is in. My software tracks the temperatures and operating state of these modules throughout their lab tests, sends test commands, and turns the results into records that can be examined later.

The project brings automotive communication, desktop software development, asynchronous data processing, test tracking and the analysis of large measurement files together in a single application. Its focus is making the behaviour of a real physical product during testing visible and traceable through measurements.


🎯 What the product is for, and the problem to solve

The lighting module around the charging connection has to produce the right colour and brightness for the operating conditions. Its behaviour under different temperatures, humidity and environmental conditions also has to be studied. In the lab, checking the light by eye isn't enough to explain what happened over the whole of a long test.

For example: at what point in the test did a module heat up, how far apart did its two temperature sensors drift, how long did a supply-related condition last, and during which time window did communication drop? All of this can be investigated afterwards. That's why I designed the software to bring every measurement and event from a test together on a shared time axis.

My contribution was separate from the product's electronic design: I developed the PC software that sends commands to the product, collects its telemetry, tracks test sessions and makes the results analysable.


🔌 LIN, CAN and the PC connection

The product's temperature data is read over LIN. Data from the test rig reaches the application on the PC, which interprets it per product and per sensor.

On the test interface I also worked with message structures containing a CAN identifier and DLC/data-length fields. Using the identifier and message-type fields of incoming frames, I separated temperature messages, status information and command responses. For RGB control I built command frames containing the target module's address and colour channels.

The application reaches the hardware through serial communication over a COM port. The operator picks the port and baud rate and connects. The physical interface that carries LIN traffic from the product to the PC belongs to the test hardware; the desktop software processes the serial data stream that hardware provides.

That separation matters to the architecture: LIN, the CAN message structure and the serial port connection are different layers. The serial baud rate in the application doesn't define the speed of the product's LIN or CAN bus.


🧩 Frame parsing and manual HEX control

Over a serial link, data doesn't always arrive on the frame boundaries the application expects. One message can be split across several reads, or several messages can arrive in a single read. So instead of feeding incoming bytes straight to the UI, I built a frame-parsing layer.

This layer looks at the start of a frame, its expected length, identifier fields and message type. Completed frames are turned into temperature or status measurements. Command responses are separated from telemetry messages, and rejected frames and discarded bytes are tracked with diagnostic counters.

The manual HEX field lets custom commands be sent directly during testing and development. The HEX text is validated and converted into a byte array. The direction, time and description of sent and received data appear in the communication log, so an operator's command and the hardware's response can be examined together.


🌈 RGB colour and brightness control

To test the lighting modules, I added colour selection, brightness adjustment and LED-off commands. The chosen RGB values are scaled to the range the device accepts and sent to the target module.

This takes more care than writing the colour picker's numbers straight into a frame: the software's colour range has to be mapped correctly onto the channel range in the hardware protocol. The colour channels, master brightness and target address are therefore prepared according to the protocol's rules.

With these features, modules can be driven under different lighting conditions while their thermal behaviour is tracked. Sending a colour command is a different responsibility from the product detecting the vehicle's real charging state; the test software's job is to apply and observe defined operating conditions.


🌡️ Temperature, data quality and supply state

The software tracks each product's two temperature sensors separately as S1 and S2. Their latest values, minimum and maximum temperatures, averages and valid-measurement ratios can be analysed. The difference between the two sensors can also be computed from the same raw measurement.

How trustworthy a measurement is matters as much as its value. A sensor connection problem, an invalid reading or a supply-related condition has to be kept apart from a real temperature reading, so measurements are processed and recorded together with quality information.

For example, a genuine −40 °C reading can occur in a low-temperature test. Treating that value as an error just because it's very low would throw away an important test result. The software's evaluation considers sensor and supply state alongside the temperature value. Likewise, rapid temperature changes are a natural part of thermal shock tests, so data is evaluated in that context.

UV (undervoltage, low supply) and OV (overvoltage, high supply) are tracked as separate flags. They represent states reported by the device rather than a numeric voltage reading. The start, end and observed duration of each event are recorded. Intervals with no data are never shown as 0 °C or as normal operation.


🧪 Test sessions and tracking many products

I modelled the test setup through chamber, product and sensor relationships. The layout is defined in a JSON file, where product addresses, chamber mappings and mode information can be configured. The current layout supports two chambers and 24 modules in total.

Each test run keeps its own ID, test name and code, start time, operating mode, duration and result. Events such as start, finish, cancel, mode change and communication loss are added to the test's history.

The test catalogue includes high/low-temperature storage, stepped temperature, low-temperature operation, thermal shock, salt spray, humidity–temperature cycling, high pressure, immersion thermal shock and solar radiation. The software supports tracking the product through these experiments and linking the records to each test. Physical temperature and humidity control of the climate chamber is the job of the lab equipment itself.


🏗️ Software architecture

I built the application in C# on .NET 10 with a Windows Forms interface. The project is split into a core holding the shared business logic, the desktop UI, and verification tests. Data acquisition, protocol parsing, recording and analysis each have their own responsibilities.

The basic data flow looks like this:

RGB lighting modules / LIN telemetry
                    ↕
          Test and interface hardware
                    ↕
           PC serial port / COM link
                    ↓
         Byte stream → frame parsing
                    ↓
      Address routing and quality checks
                    ↓
          Telemetry distribution layer
          ├─ Live product and sensor view
          ├─ Test and operating-mode tracking
          ├─ Communication / application logs
          └─ MDF4, CSV and binary recording
                    ↓
      Disk index → analysis → PDF / PNG / CSV

The operator's HEX, RGB and mode commands
travel the send path to the test hardware.

Reading and distributing data runs on asynchronous tasks. I separated producers and consumers with System.Threading.Channels queues. A live snapshot store lets the screen reach the current state without constantly reprocessing the whole history.

Queue capacities are bounded, and overflow and data-loss indicators are monitored. I used tools such as ArrayPool and Span to cut unnecessary allocations while processing data. Long disk operations and analyses run in the background so the UI stays responsive.


💾 Recording and long measurements

Recording uses MDF4, CSV and binary telemetry files. CSV makes the data easy to inspect in other tools, while MDF4 brings measurements, channel definitions, quality information, test context and events together in one structured file.

I wrote a custom writer for the MDF 4.10 layout SANEL uses. To keep long recordings from growing endlessly in a single file, MDF4 data is split into new parts once it reaches a size or time limit. The parts keep the same session ID and a shared time axis, and a session inventory tracks which files belong to the same recording.

Regular disk checkpoints are written during recording. Event descriptions are kept on disk rather than in an ever-growing in-memory list, and moved into MDF4 event blocks when the file is closed. This helps manage memory over long sessions and makes the recording process easier to trace.


📊 The MDF4 analyser and reporting

The analyser I built reopens recordings so products' temperature curves and UV/OV events can be examined. An overview table, per-product cards and a comparative timeline cover different kinds of review.

Rather than loading large recordings into memory, it uses an SQLite-based disk index. In the overview, charts are drawn from summaries that preserve peaks and troughs; when the user zooms in, the matching raw data range is read. This drawing approach is meant to stop a brief temperature spike from disappearing across a wide time range.

The PDF report opens with a test and recording summary, followed by each product's charts and, right after them, that product's event list. Shared system events are presented separately. Long descriptions flow onto further pages, and large reports can be exported as a ZIP of sequential PDF parts plus a full event CSV. Charts can also be exported as PNG, and measurements and events as CSV.


🧰 Technologies

TechnologyWhat it's used for
C# / .NET 10Business logic, protocol handling, recording and analysis
Windows FormsWindows desktop UI
System.IO.PortsExchanging data with the hardware over a COM port
Task, async/await, CancellationTokenAsynchronous work and cancellation
System.Threading.ChannelsAcquisition and recording queues
ArrayPool, Span / ReadOnlySpanLower buffer and byte-handling costs
LIN / CAN message structures / HEXProduct telemetry, test interface frames and commands
MDF 4.10 / CSV / binary filesMeasurement and event records
SQLite / Microsoft.Data.SqliteDerived disk index for large recordings
ScottPlotTemperature and status charts
PDFsharpPDF reports
SerilogApplication and error logs
JSONTest layout, topology and session inventory
Inno SetupWindows installer packages

✅ Verification and what I took away

I wrote verification tests for protocol parsing, sensor data evaluation, closing recordings, opening split sessions, analysis and report generation. The MDF4 output was also checked with the independent asammdf reader.

In a large-file trial, a roughly 1.08 GB file representing a 90-day synthetic time axis was processed with 72 million records. Initial indexing took about 26 seconds, a query over the full range about 0.41 seconds, and the peak working set measured during the process was about 88 MB. These results come from one particular computer and a synthetic dataset; they don't mean a real device was run continuously for 90 days.

This work gave me experience building the whole flow of a test tool for automotive products, from communication frames through data quality, long-term recording and the user interface to reporting. My goal with SANEL LINLED Test Tool was to turn the behaviour of an RGB lighting module in the lab into engineering data that can be followed during the test, investigated afterwards and reported.

The tool is still being developed; the latest changes are in the mission log at the top of this page.