|
I've done check digit calcs for UPC and ISBN but never Code 128. Your example is interesting in that you have an odd # of digits so you're doing a switch from 128C to 128B for the last digit.
I'd suggest a bit more research on the algorithm, specifically with a code switch, but right off the bat, it appears that, at minimum, you are not multiplying the value of the 7 (23) by its position in the string.
I haven't looked at the algorithm in detail so I don't know if the code switch counts as a position or not, but you do need to multiply each character by its position - as you did with the '34' & '56' value.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John McKee
Sent: Thursday, July 28, 2011 10:42 AM
To: Midrange Systems Technical Discussion
Subject: Barcode Code 128 check digit calculation
I'm not understanding how to compute the check digit for a code 128 type c bar code,
First, I guess, is this simple question: Does the DDS BARCODE keyword have an option to do this? We are on (stuck at) v5r4. I didn't see anything that would generate the check digit. I have a sample, printed, of a 7 digit number (1234567).
My efforts, thus far, have been:
Move 105 to a counter (start type c)
Add 12.
Add product of (34 * 2)
Add product of (56 * 3)
Add 104 (start type c)
Add 23
Divide counter by 103, use remainder to look up the check digit.
The resulting bar code (compared to my reference) is missing some bars on the right side, like a digit. But, what is missing?
Can anybody shed some light on this for me?
Thanks,
John McKee
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.