New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

How to calculate check-digit in Code 128/EAN-128

How do I calculate the check digit in code EAN-128? I have the code digits: I895001000710033189501001. From your website, I calculated the check digit to be 85 and equal to "u" digit from code B. However, when I generated the barcode the scanner wouldn't read it. It worked when I generated the barcode again from the same digits using the CorelDraw generator. CorelDraw gave 29 or "=" in code B. I don't know why most of the digit combinations after the barcode generator (using the algorithm from your website) are readable by the scanner but sometimes are not read in the combination I presented above.


03-12-12     12.6 year(s) ago    

  Report Abuse

 

Tim

Best Answer

Use the VBA code with the Code128 method as a base. This will handle the case for switching character sets.

The algorithm on our website is complete and I noticed an error in your calculation.
You currently have the FNC1 character weighted as 102, where this should be a value of 202.
104+102*1 should be 104+202*1

Posted 12.6 year(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (5)
I use Visual Basic 2010 out of Excel.

Posted 12.6 year(s) ago

(0)
(0)
   Report Abuse
I will try to present my problem in a different way.
I want to calculate the check-digit of symbols that will be encoded. The symbols are I895001000710033189501001

The structure of code in the EAN128 standard is
START B, FNC1, I, CODE C, 89,50,01,00,07,10,03,31,89,50,10,01, check-digit, STOP
so check digit is calculated:
104+102*1+41*2+99*3+89*4+50*5+1*6+0*7+1*8+10*9+3*10+31*11+89*12+50*13+10*14+1*15=3587
and
3587 mod 103 = 85 (so from code A it is "NAK", code B it is "u", code C it is 85)
so the check digit should be 85 but the generated barcode isn't read. I made the same code from other tools along with this generated barcode, but they produced a value of 29 not 85 for the check digit. Why is it different? Is the algorithm for the check digit wrong on your website? What is the correct check-digit calculation algorithm?

Posted 12.6 year(s) ago

(0)
(0)
   Report Abuse
What language are you writing your program in? There is probably a developer tool you can use.
Or if you would like to write it yourself you can use our VBA code as a base. We also have a C# class file as well.
The algorithm on our site is complete and correct, however, I recommend using one of our tools or our source to implement the check digit.

Posted 12.6 year(s) ago

(0)
(0)
   Report Abuse
I know EAN128 is a standard that uses the same code algorithms as Code128, but when using EAN128 there is an FNC1 symbol that takes part in computing a check digit. This is why I wanted to specify which type of code I mean. I want to build a special program to draw a label with a barcode. I do not want to use some program to generate only a code. I am trying to make a program that will draw a barcode on my special label, so I want full information concerning how to calculate check digits. I tried to use the algorithm on your website where the check digit is calculated by multiplying all digits by position values of digits, finding the sum, and dividing by 103. As explained on-site, this algorithm is also used to calculate check digits in code 128 where codes B and C are used. When I calculate the check digits most are correct, but in some exceptions, the barcode does not work. One of these exceptions I explained at the start of the thread. So I am asking why this is happening. It tells me something is missing in the algorithm of the check-digit calculations I found on this website.

Posted 12.6 year(s) ago

(0)
(0)
   Report Abuse
Arek,

The check digit for EAN-128 is the same as code 128. EAN 128 is a data standard that uses the same code 128 algorithms. We have several free font tools on our website to format the data including start, stop, and check characters, and to create a readable barcode.

Posted 12.6 year(s) ago

(0)
(0)
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook