Keyence Laser Marker Cell — Aerospace Traceability & Audit System

2025
  • Professional
  • Automation
  • Hardware integration

A traceability and audit server application that verifies laser marker parameters against a locked specification sheet, drives a PLC handshake, retrieves serial number queues from a production API, and records a complete time-stamped parameter history for every part marked — providing comprehensive parameter traceability for aerospace customers.

A major aerospace customer imposed strict requirements: laser parameters must be verified before and after every mark, with a full history linkable to individual part serial numbers. Existing systems were failing, isolated, and nearly impossible to maintain — a significant compliance and audit risk.

Keyence provided no .NET SDK, leaving the documented TCP wire protocol as the only integration path. At the same time, the software and Automation teams operated on completely different development timelines — waiting for the physical cell to be ready before testing any server logic was not an option.

The TCP protocol was implemented from Keyence's communication manual as a parameterized template engine: a method accepts a message template and a parameter dictionary, interpolates values into the wire format, sends to the UTF-8 TCP stream, and parses responses back out by matching against a corresponding response template. This made implementing the full command set fast and nearly bug-free. To decouple development from the physical cell, a software-in-the-loop (SIL) testing approach was built using C# source generators: generated stub classes mirrored the real PLC's tag interface, letting the full control logic be exercised against a simulated PLC in unit and integration tests. State transitions, fault paths, handshake sequences, and timeout behavior were all validated from the test harness long before any hardware was available — and the same stubs were swapped for live PLC clients in production with no changes to the control code. When the real machine was first connected, the software worked correctly within a single day.

Significantly improved traceability, resolved the failures caused by legacy systems, and built enough customer trust to justify a second identical cell and a follow-on automated cell project. Audit logs reliably correlate laser parameters to individual parts for any future quality investigation.

  • C#
  • ASP.NET Core
  • libplctag
  • TCP socket programming
  • Custom protocol implementation (Keyence)
  • JSON Schema
  • EF Core
  • SQL Server
  • OpenTelemetry
  • Grafana
  • Software-in-the-loop (SIL) testing
  • C# Source Generators
  • Layered architecture