Barkod Code 128 kodlama

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
Kullanıcı avatarı
White Rose
Üye
Mesajlar: 726
Kayıt: 06 Tem 2005 09:41
Konum: Güneyden
İletişim:

Barkod Code 128 kodlama

Mesaj gönderen White Rose »

s.a. Arkadaşlar
Code 128 (A,B,C) barkod kodlama (son kontrol karakteri)
nasıl hesaplanır.
mkysoft
Kıdemli Üye
Mesajlar: 3110
Kayıt: 26 Ağu 2003 12:35
Konum: Berlin
İletişim:

Re: Barkod Code 128 kodlama

Mesaj gönderen mkysoft »

The Checksum

Calculating the checksum can be a little tricky. Each Code 128 character has a numeric value from 0 to 102. In Subset A and B, the numeric value of a character is its ASCII code minus 32. For instance, a space (ASCII 32) has a value of 0, the exclamation point (ASCII 33) has a value of 1, etc.

Subset A permits printing of ASCII control characters, those with ASCII codes between 0 and 31. For these characters add 64 to the ASCII code to obtain the numeric value. For example, the value of NUL (ASCII 0) is 64, SOH (ASCII 1) is 65, STX (ASCII 2) is 66, etc.

Subset C prints numeric digits in pairs, and the value of the character for checksum purposes is the numeric value of the pair (00, 01, 02... 99).

To calculate the checksum, follow these steps:

Initialize the checksum variable with the value of the start character (103, 104, or 105 for Subsets A, B, or C, respectively).
Initialize a multiplier to 1.
Starting at the left end of the barcode data, add the numeric value of each character times the multiplier to the checksum. Increment the multiplier after each character.
Divide the result by 103. The remainder is the checksum.
Convert the numeric checksum into an ASCII character.
http://www.mecsw.com/specs/code_128.html
Kullanıcı avatarı
sunye
Üye
Mesajlar: 105
Kayıt: 24 Ağu 2004 04:49
Konum: izmir

Re: Barkod Code 128 kodlama

Mesaj gönderen sunye »

Düzeltme : Kusura Bakma EAN 128'i görmedim. Bu EAN13 içindi.
Daha önce yazmış olduğum bir programdan aklımda kalanları yazıyorum;

EAN13 barcode standardında 12 basamak kullanıcı tarafından belirlenir. ( Ülke kodu, fabrika kodu, part kodu vb.)

Örnek Kod: 123456789012 + Digit Kod

Çift Sıralı sayıları birbiriyle topla (2., 4., 6., 8., 10., ve 12. sıradaki sayılar)
( 2 + 4 + 8 + 0 + 2 = 16)

Tek Sıralı sayıları birbiriyle topla (1., 3., 5., 7., 9., 11. sıradaki sayılar)
(1 + 3 + 5 + 7 + 9 + 1 = 26 )

Formül : 3 x 16 (Çift Sayıların Toplamı) + 26 (Tek Sayıların Toplamı) = 3 x 16 + 26 = 74

74 sayısının mod 10'u hesaplanır : 74 MOD 10 = 4

10 dan kalan sayı çıkarılır : 10 - 4 = 6

Hesaplamasını varsa elinde sağlam bir barkoda göre test edersin.
Bildiğim tek şey, hiç bir şey bilmediğim.
Cevapla