Looking Inside the Barcodes
The new barcodes for the FMD are 2-dimensional data matrix codes. These look similar to the more common QR barcodes but do not work the same way. Although the unique identification number contained within the data matrix code will be displayed in clear text next to the code the length and almost random nature of this text makes reading the data matrix the preferred option to capture the unique code. Some barcode reading phone apps will read 2-dimensional data matrix codes but that leaves the problem of how to get the data off the output screen of the app and do something with it, such as pass it to the NMVO for verification.
A scanning device attached to a computer will capture data that it reads in one of two broad pathways. Firstly the scanner interfaces directly with a computer program that picks up the data as it is scanned. This is the most efficient approach but does require the program to know technical details of the scanner connection such as ports and parity that may differ between individual scanners. The simpler solution is to use the ability of a scanner to scan into the active input area of a computer, such as Notepad or Excel. The scanner is acting like a keyboard and that keyboard entry can be directed into a computer program that will interact with the NMVO. This approach will work with any USB scanner that is able to read data matrix barcodes and which is set to a suitable keyboard.
In the UK the FMD code has 4 elements; some European codes include a 5th element. These are the product code, serial number, date and batch. What can be put into each element and how long each can be is set by the GS1. The product code and date are of a fixed length but the serial number and batch are of variable length. When a scanner reads data from a barcode it sees it as a single line of text but to work with the NMVO that line has to be broken up into its component elements.
This is a valid test code, 014791836674619110TEST398E53CA521723020121PK05130CCE8222C4640 The first two digits characters ‘01’ state that a product code is coming up. The fixed length of this element string is 16 digits (Two for ‘01’ and 14 for the product code). This means that the next digits, ‘10’, must be another Application Identifier. ‘10’ indicates a batch, which is a variable length field which must be separated from the following element string. The next two element strings begin with ‘17’ (for an expiry date) and ‘21’ for a serial number. The four elements can be in any order provided the elements are clearly differentiated.
The GS1 knew this and allowed a marker to be placed after the variable length fields (batch and serial number). The marker used is FNC1 using Ascii(29) known as the global separator. When reading a batch or serial number the code reads until it meets the global separator and then looks for the next item marker. Ascii(29) is not visible on a standard keyboard but any FMD data matrix scanner must be set to read it. In Windows non-text characters such as Ascii(29) can be seen by the program Notepad++. This is one way to ensure that any scanner reading FMD barcodes is able to process the global separator. This may not be the default keyboard emulated by a scanner. Scanners are usually marketed for a wide range of applications and the global separator is commonly used so it would be surprising if this functionality were not available. It is not necessary to invest in a high end scanning device. The key questions are does it support GS1 data matrix and how will it recognise FNC1 (which is part of the GS1 data matrix)?
Writing a barcode involves taking the desired text and creating an image in the data matrix format. The image can then be printed onto the pack but for testing a barcode reader could read from an image on the screen. Many programming languages include libraries to handle creating 2-dimensional barcodes and for simple testing purposes websites exist that will create barcode images in the FMD format.
The order of the four element strings is not important. The product code length is fixed at 14 characters, with another 2 for the ‘01’ application identifier. The date is fixed at 6 digits with 2 more for the ’17’ identifier. The date must be in the format ‘YYMMDD’. The batch or lot identification may be up to 20 alphanumeric characters, preceded by ‘10’ and followed by the global separator. The serial number may be up to 20 characters plus the ‘21’ identifier and followed by the global separator. [The global separator is not required after the last element string encoded in the barcode.]The serial number should be made up of Western alphabet characters except for i, j, l, o, q and u or their capital equivalents. Letters may be in capital or lower case but not a mixture of the two. The /.,-+*)(‘&%”!:;<?=> characters are also permitted. A serial number needs to be unique for a given product code but could be repeated across product codes. The serial numbers must also pass tests of randomness and not include any repeating sequences such as a fixed leading sequence.