Laser Labs includes reference samples with every tint meter so that the user can quickly tell if their meter is in spec. Every single test sample is measured by a spectrophotometer that has been calibrated with NIST-traceable light transmittance reference standards.
The old method of accomplishing this involved manually reading the spectrophotometer, typing it into a program, and pressing the print button. Since we were aiming to vastly increase our sales volume with new products, we needed a faster solution that was immune to fat-fingering in wrong numbers.
Luckily the spectrophotometer has a “Print” button that dumps its current measurement value out through a serial port. A USB-Serial module was used to connect the PC to the spectrophotometer. The Visual Basic program opens a serial port, and listens for incoming data. The “Print” button is not debounced, and the data dump is raw data with no headers or footers, so the Visual Basic program captures a stream of ASCII characters, scans for the number format (xx.x), and injects it into the label generation code along with the date. The label printer is a Zebra, so it uses a proprietary formatting language called “ZPL” (zebra programming language). The static portion of the label is saved as a series of strings, and the parts that vary (transmittance reading, date, serial number) are concatenated into some other strings. Its kind of chunky, but it gets the job done…
The end product is a small application that can automatically generate labels by hitting the print button on the spectrophotometer, in varying batch sizes (in case you want multiples of the same label with incrementing serial numbers), with the option to manually set the reading and date for calibration and testing purposes.