Calculating the checksum for code 3 of 9, Code 3 of 9 character table – Tally Genicom Matrix Printer User Manual

Page 62

Advertising
background image

7265 Programmer’s Manual

58

Copyright © 2004 TallyGenicom Chapter 3 ANSI Bar Codes

Calculating the Checksum for Code 3 of 9

A 3 of 9 symbol is a variable-length string which can include the digits 0 - 9, uppercase A - Z, and
six additional punctuation characters. The values used to compute the checksum for a 3 of 9
symbol are the locations of individual characters in the unique 3 of 9 character table. Your
program will need to refer to a 3 of 9 look-up table to acquire values for the characters you want
to encode, and again to convert the computed checksum back to a valid 3 of 9 character.

The check digit is the modulus 43 sum of all the character values in a given symbol.

1. Compute the check character for the character string:

12345ABCDE/

2. Sum the values of the characters based on their locations in the 3 of 9 character table:

1 + 2 + 3 + 4 + 5 + 10 + 11 + 12 + 13 + 14 + 40 = 115

3. Compute the modulus 43 of the sum:

115/43 = 2 Remainder 29

4. The check character is the character corresponding to location 29 in the 3 of 9 character

table, which is T. Send to the printer:

12345ABCDE/T

Code 3 of 9 Character Table

0

0

12

C

24

O

36

- (minus sign)

1

1

13

D

25

P

37

. (period)

2

2

14

E

26

Q

38

(space)

3

3

15

F

27

R

39

$

4

4

16

G

28

S

40

/

5

5

17

H

29

T

41

+

6

6

18

I

30

U

42

%

7

7

19

J

31

V

8

8

20

K

32

W

9

9

21

L

33

X

10

A

22

M

34

Y

11

B

23

N

35

Z

Calculating the Checksum for CODE 93

A Code 93 symbol consists of a start code, a variable number of data characters, two check digits
(referred to as "C" and "K"), and a stop code.

The values used to compute the checksum for a Code 93 symbol are the locations of individual
characters in the Code 93 character table. Check digit "C" is the modulo 47 sum of the character
values and a weighting sequence, where the weights from right to left are in the sequence 1, 2,
3...19, 20, 1, 2, 3...19, 20....

Check digit "K" is the modulo 47 sum of the character values and a weighting sequence, where
the weights from right to left, starting with the check character "C", are in the sequence

1, 2, 3...14, 15, 1, 2, 3...14,15....

Advertising