Barcodes are a significant part of our workload. In many applications we're printing them, or visioning them, or most likely of all, both. Barcodes are known by everyone but the details related to their use in manufacturing are not obvious to the typical developer we hire who has no experience in our industry. Here I'm going to try and summarise what I think is important.
Types of Barcode
A barcode will have several properties. It's important to separate these mentally because they can be interchanged and thinking of a barcode as a single concept leads to confusion. Different software will also use different names depending on the level it is interpreting the barcode at. There is no specific standard for this (that I know of), this is just my concept of different levels of talking about a barcode.
- Dimensions (1D/2D/others)
- Symbology (Code 128, EAN, Data Matrix, QR)
- Encoding (ECC-200)
- Formatting standard (not the correct term) (GS1)
1D barcodes are ubiquitous in everyday life and are pretty simple. One lesser known feature is that some barcodes are omni-directional while some are not. What this means is that some 1D barcodes have a start and stop sequence at the beginning and end. This allows a barcode reader to identify whether to read the barcode left to right or right to left (if it's upside down). Barcodes without this functionality have to be scanned in the correct orientation to get the desired data. Another lesser known fact is that for most 1D barcodes the size of the white gap is data too and not just a space between the black bars.
2D barcodes are known by most as QR codes. QR is a symbology of a 2D code. The more common symbology in industry (from my experience) is Data Matrix.
There are other barcodes that contain colour or shapes. I've never seen those used in industry so I can't talk about them from personal experience.
There are different 1D and 2D barcodes with different rules defining how to represent data. Some can only represent numbers, some can do alphanumerics and some can do more. As mentioned earlier some 1D barcodes will have a start and stop value and some will not. What features the barcode has is defined by its symbology. Different symbologies look different in most cases. In a 1D this might be how many black and white spaces per character, in a 2D it might be how many squares make up a character.
Data Matrix and QR are two visually different symbologies of 2D barcodes.
This is the system of translating human readable data into binary data for encoding into the barcode. This tends to have a strong correlation with the symbology but not always. For example most Data Matrix barcodes have an encoding of ECC-200 but it's entirely possible to just insert raw unencoded data into a Data Matrix. There were also previous standards found in older Data Matrix barcodes.
I'm not sure if this has a technical name. On top of all of the above, the data in a barcode can conform to a standard set out by an organisation, for example GS1. These standards stipulate that certain characters have to be in certain places and certain data has be to presented in certain ways. This is all on top of and independent off all of the above. So I can have a GS1 compliant Data Matrix using any encoding or a GS1 compliant Code 128.