MSI Barcode
From Wikipedia, the free encyclopedia
MSI (also known as Modified Plessey) is a barcode symbology developed by the MSI Data Corporation, based on the original Plessey symbology. It is a continuous symbology that is not self-checking. MSI is used primarily for inventory control, marking storage containers and shelves in warehouse environments.
Contents |
[edit] Character set and binary lookup
The MSI character set consist of the numbers 0..9 as well as two "guard" characters (representing the beginning and end of the barcode). The symbology does not support alphabetic characters.
[edit] Binary mapping
Each digit and guard character is represented by a binary number, as shown in the table below.
Character | Map |
---|---|
Start | 110 |
0 | 100100100100 |
1 | 100100100110 |
2 | 100100110100 |
3 | 100100110110 |
4 | 100110100100 |
5 | 100110100110 |
6 | 100110110100 |
7 | 100110110110 |
8 | 110100100100 |
9 | 110100100110 |
Stop | 1001 |
To produce a barcode image from this map, one simply must consider the digit 1 to be a black bar and the digit 0 to be a white bar and produce an image accordingly.
[edit] Check digit calculation
The MSI barcode uses one of five possible schemes for calculating a check digit:
- No check digit (least common)
- Mod 10 (most common)
- Mod 11
- Mod 1010
- Mod 1110
[edit] Mod 10 Check Digit
1. Create a number based on the alternating numbers in the string to be encoded, with the last character of the string being the last character of the new number. Example:
String to be encoded 1234567 Let X Equal the new number X = 1357
2. Take the resulting new number and multiply it by 2
X = 1357 * 2 X = 2714
3. Sum the remaining numbers from step 1
Let Y Equal the sum of the remaining numbers from step 1 Y = 2+4+6 Y = 12
4. Take the sums from step 2 and step 3 and add them together
Let Z Equal the sum of the two resulting numbers from step 2 and 3 Z = X+Y Z = 2726
5. Mod the sum by ten to get your check digit.
Let C Equal the check digit C = Z mod 10 C = 4
The check digit is 4
[edit] Mod 11 Check Digit
1. Reverse the string to be encoded (in this case 1234567).
Let S be the reverse of the string to be encoded S = 7654321
2. Get the sum of the string by looping through each character and multiply it by a weight from 2..7 depending on its position. If the weight's value exceeds seven, reset the weight back to 2.
Let X = the final product of the string to encode. X = 7 * 2 X = 6 * 3 X = 5 * 4 X = 4 * 5 X = 3 * 6 X = 2 * 7 X = 1 * 2
X = 14 + 18 + 20 + 20 + 18 + 14 + 2 X = 106
3. Mod the sum by 11 to get the check digit.
Let C Equal the check digit. C = X mod 11 C = 106 mod 11 C = 7
The check digit is 7
[edit] Mod 1010 check digit
Simply calculate the Mod 10 check digit the first time and then calculate it again with the previous result and append the result of the second Mod 10 Calculation to the string to be encoded.
[edit] Mod 1110 check digit
Same as Mod 1010 but the first calculation should be a Mod 11 Check digit.
[edit] Example
As an example, we will generate an MSI barcode for the number sequence 1234567 using the most common Mod 10 check digit methodology.
The check digit (as calcuated above) for this sequence is 4.
Once you have calculated your check digit, simply map each character in the string to be encoded using the table above as a reference to get the binary map of the bar code; remember to precede the code with "start" and to end it with "stop" For example, to map the string 1234567 with a Mod 10 check digit it would produce the following binary map:
Character | Map | Comment |
---|---|---|
Start | 110 | The start character |
1 | 100100100110 | The number 1 |
2 | 100100110100 | The number 2 |
3 | 100100110110 | The number 3 |
4 | 100110100100 | The number 4 |
5 | 100110100110 | The number 5 |
6 | 100110110100 | The number 6 |
7 | 100110110110 | The number 7 |
4 | 100110100100 | The check digit 4 |
Stop | 1001 |
This results in the following barcode: