# Plessey Code

Plessey Code is a 1D linear barcode symbology based on pulse-width modulation, developed in 1971 by The Plessey Company plc, a British-based company. It is one of the first barcode symbology, and is still used rarely in some libraries and for shelf tags in retail stores, in part as a solution to their internal requirement for stock control. The system was first used in the early 1970s by J.Sainsbury to identify all of its products on supermarket shelves for its product restocking system.
The chief advantages are the relative ease of printing using the dot-matrix printers popular at the time of the code's introduction, and its somewhat higher density than the more common 2 of 5 and 3 of 9 codes. It has later led several variations as Anker Code by ADS Company, Telxon, and MSI (also known as Plessey modified). It is difficult to have the specifications for them nowadays and thus hard to tell the differences between them (except for MSI), because it was mainly available as a paper document and has since been discontinued.

## Encoding

The barcode encodes hexadecimal digits (i.e., the hex digits 0-F) as 4 bars (bits). The LSB is on the first bar on the left, and the MSB is the last bar on the right. A "0" bit is represented as a narrow bar, followed by a wide space. The "1" is represented by a wide bar, followed by a narrow space.
The barcode can be read in either direction (left to right or right to left).
The barcode comprises:
* the forward start code
* the label / data digits
* the check code, for error detection
* the termination bar
* the reverse start code

### Forward start code

The forward start code is "1101". It defines the beginning of the encoded text.

### Label

The character of the text to encode are hexadecimal values encoded as reversed BCD
| Value | Encoding | Value | Encoding | Value | Encoding | Value | Encoding |
| 0 | 0000 | 4 | 0010 | 8 | 0001 | C | 0011 |
| 1 | 1000 | 5 | 1010 | 9 | 1001 | D | 1011 |
| 2 | 0100 | 6 | 0110 | A | 0101 | E | 0111 |
| 3 | 1100 | 7 | 1110 | B | 1101 | F | 1111 |

### Check code

The check code for error detection and correction is as CRC, using polynomial division. Is uses 2 characters, or 8 bits. The generator polynomial is $g(x)=x^{8}+x^{7}+x^{6}+x^{5}+x^{3}+1$ with n=8, in binary "111101001".

### Termination bar

The termination bar follows the CRC. It's a full pitch bar.

### Reverse start code

The reverse start code, with the forward start code, are used to detect the direction of reading : from left to right or right to left. It's encoded as a reversed "0011". Reversed because the "0" is represented by a wide space and simple bar, and "1" as a simple space and wide bar.

## Dimensions

The dimensions of the bars and spaces are defined by the following rules :
${\frac {a}{b}}<1$ , with b < 0.229 mm
${\frac {c}{d}}>0.33$ , with c > 0.127 mm
Bit dimension in mm :
| | | "1" | "1" | "1" | "1" | "0" | "0" | "0" | "0" |
| bit/inch | pitch 'p' | width | min | nom | max | width | min | nom | max |
| 40 | 0.635 | bar 'a' | 0.305 | 0.343 | 0.381 | bar 'c' | 0.114 | 0.127 | 0.152 |
| 40 | 0.635 | space 'b' | 0.254 | 0.292 | 0.305 | space 'd' | 0.471 | 0.508 | 0.533 |
| 32 | 0.787 | bar 'a' | 0.394 | 0.432 | 0.470 | bar 'c' | 0.127 | 0.152 | 0.173 |
| 32 | 0.787 | space 'b' | 0.318 | 0.356 | 0.394 | space 'd' | 0.584 | 0.635 | 0.685 |
| 25 (std.) | 1.020 | bar 'a' | 0.533 | 0.584 | 0.635 | bar 'c' | 0.127 | 0.178 | 0.229 |
| 25 (std.) | 1.020 | space 'b' | 0.381 | 0.432 | 0.483 | space 'd' | 0.787 | 0.838 | 0.889 |
Values are slightly different for Anker Code
Before and after each barcode, there should be margins of 4 bits.