The scanner beeps and the right product name appears on the till. Only at the end of the shift does someone notice that two packs have been recorded with the same serial number. A checkout test with one ordinary barcode would never have caught that mistake. It tested the product lookup, but nobody checked what happened to a longer string containing a serial number. Here is how to test a USB scanner in keyboard mode at the workstation where it will actually be used.

Prepare known samples and a test document

Set aside an EAN-13 with a known value, a sample with mixed case and punctuation, and a GS1 DataMatrix containing several fields. Write down exactly what each should produce. Invented serial numbers in test symbols are useful because you can read them repeatedly without making transactions involving real stock. For the final test, open a training document in which entries do not change inventory levels.

Record the scanner model, connection mode and active keyboard layout. In USB HID keyboard mode the scanner sends keystrokes to the active application. With a virtual serial port, an application configured to read that port receives the data. If the scanner beeps and an ordinary text box stays empty, check that the cursor is in the box and that the connection mode matches the test.

Establish that digits arrive intact

Scan the EAN-13 into an empty text field and compare all thirteen digits with the reference. A sample beginning with zero is especially useful. Some applications import the value as a number and discard leading zeros. Testing first in plain text and then in the checkout software shows where the value changed. Some scanners can also convert between UPC and EAN formats. Check that setting if the length consistently differs by one digit.

Add letters and punctuation

A string of digits tells you little about keyboard layout. Case and punctuation matter in a serial number. Scan the sample with letters and compare each position, including quotation marks and other symbols. If the same positions are wrong on every scan, save the first result and change one setting, such as the computer’s active keyboard layout. Reading the same sample again tests that particular explanation.

Find the end of the serial number

In GS1 data, an application identifier tells the receiver how to interpret the field that follows. Identifier 01 is followed by exactly fourteen digits for the GTIN. The serial number after identifier 21 has a variable length. If another field follows it, such as a batch number with identifier 10, a separator marks the boundary. Otherwise the digits 10 could simply be part of the serial number itself.

Suppose the serial number is AB7 and the batch is LOT5. The example below shows the boundary in a form you can read on paper. The bracketed label stands for a single control character with decimal value 29. Typing the brackets and letters on a keyboard would produce four ordinary characters. A plain text editor may show no visible sign of the real separator.

21AB7[GS]10LOT5

Use the scanner test to capture a sample with this field boundary. Compare the displayed separator with the expected position immediately after the serial number.

Distinguish field boundaries from the end of a scan

A scanner can send Enter or Tab after the entire message. The till may use that final key to confirm the entry or move to another box. Changing the final key cannot restore a missing separator in the middle of the message. Check the contents of the captured string and then check what the application does after the last character arrives.

Try two packs of the same product with different test serial numbers. Read both in the capture field and then into the training document. Compare the saved serial numbers as well as the product names. Finally read one of the packs again. A plain retail barcode may increase the quantity, while a system tracking individual serial numbers may warn about a duplicate. Agree on the expected result with the person responsible for the stock records.

Record a result that someone can repeat

Keep a photo of the sample, the expected string, the captured string, the keyboard layout and the action at the end of input. Note whether you scanned a screen or a paper label. If only one works, check contrast, glare and print size before reprogramming the scanner.

These notes will help when a computer is replaced or the checkout software changes. Repeat the original test with the same sample. If the capture field still contains the correct data but the saved record differs, you can now concentrate on how the application processes the input.

GS1 DataMatrix guideline (PDF)