← cd ..

Dual-line print inspection

Two apps that check the print on every blister foil, on two pharmaceutical lines at once, in under 100 ms per frame. I designed and built both, installed them on the factory floor and trained the operators.

Role
Software engineer · field application engineer
Company
Machinify, Budapest
Year
2025
Stack
C# · .NET 8 · WinForms · WPF · TCP/IP
The HMI marking a defect on a blister foil

The operator HMI flags a defect on the foil. Camera feed redacted · client details removed.

Context

The problem

On a pharmaceutical packaging line, the text printed on the blister foil (batch, expiry, product) must be readable on every single pack. A smudged or faded print is a compliance failure.

The plant ran two lines at the same time and needed every frame checked live, with operators who could trust the result and act on it.

I built two apps: a Sender, the high-speed engine next to the cameras, and an HMI, the operator's command centre.

Requirements

NeedTarget
SpeedCapture, process and send each frame in under 100 ms
Two linesBoth lines on one I/O card, without interfering
Set-upThe HMI finds the Sender and connects with no configuration
No lost dataA defect image is never lost or left orphaned
ComplianceLogin, role-based access and an audit trail of every action

Architecture

Sender and HMI over TCP/IP

Hover or tap any box for a plain-English explanation.

frames triggers 1 port / line confirmed session re-sync after a crash Camerasline 1 · line 2 I/O cardshared by 2 lines Sender.NET 8 · 1 instance / line<100 ms per frame HMIoperator · WPF in v2 Storageconfirmed defects
tipHover or tap a box to see what it does and why it's there.

Key decisions

The trade-offs that shaped it

ADR-01One TCP port per line

Context
Two lines stream results at the same time, and two HMIs may watch them.
Decision
A dedicated port per line, so each stream is independent and two HMI clients can connect at once.
Trade-off
More ports to open on the plant network, but a slow line never delays the other.

ADR-02Confirm before storing

Context
Writing every defect image straight to network storage risked half-written files and images nobody had reviewed.
Decision
Cache locally and move an image only after the HMI confirms the defect.
Trade-off
Some local disk use; in exchange nothing is lost or orphaned.

ADR-03Recover instead of restarting

Context
On a running line, an operator cannot wait for both apps to be restarted in order.
Decision
The HMI reconnects by itself and re-syncs the session state with the Sender after any crash.
Trade-off
A small state-sync protocol to maintain; production keeps running.

ADR-04Security as part of v2, not an add-on

Context
Pharmaceutical compliance requires knowing who changed what, and when.
Decision
Rebuilt the HMI in WPF with a login, role-based access for operator, engineer and admin, and an audit trail of every action.
Trade-off
One more step for operators at the start of a shift; every change is now traceable.

Screens

What the operators use

Camera feeds are blurred and client details removed on purpose.

Outcome

Where it landed

<100 ms
capture, process and send per frame
2
lines running on one I/O card
~496k
blisters counted in two production screens alone
3
roles with an audit trail in v2
← Back to all work