× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



And, you don't necessarily have to use 128C. That's good if you have a large number of digits and want to print in a small space - but you have to pad with a leading zero if you have odd # of digits. Each "character" represents two digits. Look at the A & B versions of Code 128 symbology. Dan's example below uses 128A.

There are also online calculators that will tell you the check digit so you can verify your calcs. This was the first one that popped up in a search.....
http://www.barcodemill.com/


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan Kimmel
Sent: Thursday, July 28, 2011 2:35 PM
To: Midrange Systems Technical Discussion
Subject: RE: Barcode Code 128 check digit calculation


Check the US wiki site. There's a good explanation there. http://en.wikipedia.org/wiki/Code_128

If you want seven digits in the barcode, the checksum is the total of each of the ascii character values multiplied by the position

1234567 checksum =

(103
+ 1 * 17
+ 2 * 18
+ 3 * 19
+ 4 * 20
+ 5 * 21
+ 6 * 22
+ 7 * 23)mod 103

Then you have to convert that value to an ascii character following the rules given.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John McKee
Sent: Thursday, July 28, 2011 3:59 PM
To: Midrange Systems Technical Discussion
Subject: RE: Barcode Code 128 check digit calculation

Tried several variations. Don't know what to do with that odd character. The process, as explained to me, was to do the bulk in code c and switch to B for the odd digit. The example I have are of only code b. But, that example shows the sstart b is included in the total, with no multiplier.

I wish I had something that explained this. My web searches may not have been good. I found nothing, so far, on dealing with odd length numeric strings. ate a code128 mode c, and it would not take an odd length, or anything but numbers.

Do you have any suggestions for how to deal with the odd length, or references I can study?

John McKee
-----Original message-----
From: "Harman, Roger" Roger.Harman@xxxxxxxxxx
Date: Thu, 28 Jul 2011 13:47:31 -0500
To: "'Midrange Systems Technical Discussion'" midrange-l@xxxxxxxxxxxx
Subject: RE: Barcode Code 128 check digit calculation

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.

--
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.