A Windows app that drives an Anviz fingerprint terminal directly. Employee enrollment, live check-in/out, timesheets and payroll in one program; the vendor's own software isn't needed. Built for small shift-based businesses (shops, cafés, workshops).
The whole UI is built with Onda components. This is a personal project; the source code and installer are not published. This page explains how the app works.
Highlights
- Talks to the device directly: over TCP using the device's binary protocol, with no vendor program or DLL.
- Live monitoring: the moment someone scans a finger, the app sees it, adds them to "inside now" and shows a notification.
- Fingerprint backup: templates are also stored on the PC; if the device is reset or replaced, nobody has to enroll again.
- Night shifts: on a 22:00–06:00 shift, the morning check-out counts toward the previous day.
- Device screen designer: the company text, IN/OUT labels, time-based automatic status and on-scan messages on the device screen are changed from the app.
- Welcome screen: a second monitor shows a large clock, scrolling announcements and a "Welcome · In 08:02" card on every scan.
The device
Tested with an Anviz TC-series terminal that identifies itself as "TC-E-N".
| Feature | On this device |
|---|---|
| Verification | Fingerprint; card and PIN fields also exist |
| Fingers per person | 2 slots |
| Name on screen | Up to 10 characters |
| Connection | Ethernet, TCP 5010; connected straight to a PC, both get an automatic IP |
| Sending records | Pushes each scan to the PC instantly; stores them while offline |
| Door | Relay output (lock or bell), door sensor |
| Limits we found | Doesn't tell check-in from check-out; its clock can drift |
Talking to the device
The app connects on TCP port 5010. Each command is a frame: start byte (0xA5), device ID, command code, data length, data and a CRC16 checksum. The device answers with the same frame plus a status byte. Packets are built by the open-source MxLabs/Anviz library, which I fixed and extended for this device.
- If it can't connect within 6 seconds it reports "no answer" and the app keeps working.
- On connect, the device clock is synced to the PC.
- Model, serial number, firmware, capacity and pending record count are read.
- Scans made while the app was closed are pulled at once and marked as read on the device.
- After that the device pushes every scan itself; the app saves it immediately.
For reliability:
- One command at a time: the device tags answers only with the command code, so all commands go through a queue.
- Disconnect detection: TCP keep-alive plus a 30-second silence watchdog; the app reconnects on its own.
- UI never freezes: device traffic runs in the background and events are marshalled to the main window.
- Bad-clock protection: if the device clock is off by more than a day, the PC's time is used; records with invalid dates are skipped.
- No duplicates: same person and same second is one record, even if it arrives both live and in a bulk pull.
Screens
- Dashboard: inside now, arrived today, late and absent counts; today's status per person; device card and latest scans.
- Employees: card (name, role, shift, wage, start date, name on the device screen), fingerprint enrollment, import from device, push to device, bulk delete. The app assigns the device user ID itself.
- Fingerprint enrollment: choose the finger and its slot on the device; the device asks for two scans while the window guides step by step. Afterwards it shows a fingerprint image generated from that person's template (not a real fingerprint image; the device doesn't provide one).
- Shifts: start, end, break, grace period and working days; night shifts supported.
- Check-in / out: every scan and its source (live, from device, manual); a forgotten scan can be added by hand; Excel export.
- Timesheet: day by day in, out, worked, overtime, late, early leave and status (OK, Late, No check-out, Absent, Day off…); Excel export.
- Payroll: monthly summary; advances, bonuses and deductions are entered and the net updates instantly; Excel export.
- Device: every device setting in 7 tabs: info and clock, sound / language / matching precision / relay, screen design, network, users on the device, records on the device, maintenance (reboot, open door, delete, factory reset).
- Settings: company name, payroll factors, backup and restore, welcome screen, database reset.
Timesheet and payroll rules
Since the device doesn't tell check-in from check-out, the rules rely on scan order:
- A second scan by the same person within 2 minutes is ignored.
- The work day isn't split at midnight but halfway between a shift's end and the next start.
- 1st scan in, 2nd out, 3rd in… pairs are summed; an odd count means "No check-out" ("Inside" while the shift is running).
- With a single in/out pair, the shift's break is deducted from work longer than 4 hours.
- Arriving late or leaving early beyond the grace period is recorded; time beyond the planned hours is overtime.
- "Absent" is only written once the shift has ended.
| Item | Hourly | Monthly |
|---|---|---|
| Base | Normal hours × hourly wage | Monthly wage (pro-rated if hired mid-month) |
| Overtime | Overtime hours × hourly wage × 1.5 | Overtime hours × (monthly / 225) × 1.5 |
| Missing hours | — | Missing hours × (monthly / 225), can be turned off |
Net = base + overtime − missing hours + bonus − advance − deductions. The factors can be changed in Settings. The calculation excludes social security and tax; it's for internal tracking.
Technology
| Layer | Technology |
|---|---|
| Language and platform | C#, .NET 10 (Windows) |
| UI | Windows Forms + Onda |
| Database | SQLite, single file |
| Device protocol | Built on MxLabs/Anviz (MIT) |
| Drawing | GDI+ (device screen preview, fingerprint image, welcome screen) |
| Tests | xUnit; 10 tests cover timesheet, night-shift and payroll rules |
Timesheet and payroll logic lives in a separate layer with no UI dependency, so the rules are tested without the UI. The UI never talks to the device directly; every command goes through a single device service.
Limits
- A forgotten scan shifts that day's pairing; the "No check-out" status shows it and a manual entry fixes it.
- Designed for one device and one PC.
- Tested only with the Anviz TC-E-N.











Comments
No comments yet. Be the first to share what you think.