Earn Points & Redeem with attractive offers!
You can earn points, by asking, answering, voting questions and redeem with
attractive offers
. To view various available redemption schemes, please visit
"My Profile".
New User? Sign Up  |  Sign In  |  Help
IDAutomation Logo
This forum provides support for barcode issues from IDAutomation and the community. You may answer and comment on any thread according to the Terms and Conditions.
Ask
Answer
Find
     
Search for Questions:
My Profile

arek

Resolved Questions Bookmark and Share

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

How do I calculate the checkdigit in code EAN-128? I have the code digits: I895001000710033189501001. From your website I calculated the checkdigit 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 same digits using CorelDraw generator. CorelDraw gave 29 or "=" in code B. I don't know why most of the digit combinations after the barcode generator (using algorithm from your website) are readable by the scanner, but sometimes are not read in the combination I presented above.




03-12-12     863 day(s) ago     Views: 5787

    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 web site 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 863 day(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)

arek
I use Visual Basic 2010 out of Excel.



Posted 863 day(s) ago

(0)
(0)
   Report Abuse

arek
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 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 others 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 web site? What is the correct check-digit calculate algorithm?



Posted 863 day(s) ago

(0)
(0)
   Report Abuse

Tim
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 863 day(s) ago

(0)
(0)
   Report Abuse

arek
I know EAN128 is a standard that uses the same code algorithms from Code128, but when using EAN128 there is 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 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 web site 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 the 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 in 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 web site.



Posted 863 day(s) ago

(0)
(0)
   Report Abuse

Tim
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 web site to format the data including start, stop, and check characters, and to create a readable barcode.
Our most popular is our word and excel add in.



Posted 863 day(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 -
Enter Security Code: *
  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://")
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:// ")
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
 © Copyright 2014 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