fmorais
16th December 2004, 17:52
Hi.
I am creating a report for printing labels for shipping using EAN-128 barcode specification.
Was able to print the barcodes and they come out on the report.
However, when reading them, the pistol does not seem to read the parentesis.
Example:
(02)05410687012862(37)05(15)050417(3102)007500
comes out as:
02054106870128623705150504173102007500
In the reading.
However, the characters bellow the barcode have parentesis.
Also, I tested with the same pistol and a barcode with parentesis not printed from Baan and the parentesis are read OK.
The string above is constructed with the following code:
barcodeout = chr$(27) & chr$(22) & "+'N" & ....
I have all the reasons to believe the code is not coming out OK from Baan.
Did anyone have the same problem before? Can someone share some thoughts on this matter?
Thanks
Fred
P.S.: I am using BIVc4 / SQL2000. / Windows 2000.
mark_h
16th December 2004, 18:39
I do not know about EAN barcodes, but using extend barcode 3 of 9 I had to do this for the parts that contain /'s or +'s:
for i = 1 to barcode.length-1
if barcode.item(i;1) = "/" then
barcode.item = barcode.item(1;i) & "O" & barcode.item(i+1;barcode.length)
endif
if barcode.item(i;1) = "+" then
barcode.item = barcode.item(1;i-1) & "/K" & barcode.item(i+1;barcode.length)
endif
endfor
So the /'s become /O's and the +'s become /K's. This generates a readable barcode. So you probably need to find out what ('s and )'s are in EAN 128 and do something like I did.
Mark
fmorais
16th December 2004, 20:41
Mark,
Following your idea, I read some more stuff and it seems the string you have to give to generate the EAN-128 barcode does not include parentesis.
Instead of (02) you have to give [something]02 when constructing the string variable. The question is: what is the [something]. I already tried chr$(203) with no luck...
Can someone bring light to the subject?
Thanks
Fred
csecgn
16th December 2004, 23:39
There are three Versions of EAN 128 (or CODE128 what is nearly the same). Some are limited to some chars . CODE128 B has no limits (if I remember correctly). And yes, you have to change some character.
This is a part of a EAN 128 translation prgram:
case "EAN128":
ean128.refzeichen = "!" & chr$(34) & "#$%&'()*+,-./0123456789:;<=>?§ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}ß"
value.in = strip$(shiftl$(value.in))
value.out = "ë" | chr$(137)
ean128.check.sum = 104
for i = 1 to len(value.in)
| compute output
if value.in(i;1) = " "
then
ean128.check.sum = ean128.check.sum + 0
value.out = value.out & " "
else
ean128.ref.value = pos(ean128.refzeichen, value.in(i;1))
ean128.check.sum = ean128.check.sum + (i * ean128.ref.value)
value.out = value.out & chr$(ean128.ref.value + 33)
endif
endfor
| Prüfziffer berechnen/compute checksum
ean128.check.sum = ean128.check.sum \ 103
value.out = value.out & chr$(ean128.check.sum + 33) & "ï" | chr$(139)
value.out = pc$(7) & str$(size) & "vsb11000T" & value.out
break
Sorry for the bad formatting, but it's only a "snapshot".
Hope this help's.
Regards
csesgn
fmorais
17th December 2004, 00:11
What you posted is very usefull but, I still have the question of what to put in the value.in variable to produce the
(02)05410687012862(37)05(15)050417(3102)007500
when reading the code with the pistol.
(02) - EAN Item code
(37) - Number of volumes
(15) - Valid until date
(3102) - Net weight
Please help me just one bit more.
Thanks a lot
Fred
csecgn
17th December 2004, 11:33
I've written the reply late at the evening... . The value.in is the string you wan't to get as a barcode. The last line with value.out = pc$(7)... is for adding control codes for the printer (font selection. We are using HP printers directly on Unix with fonts&more cartridges).
But there is another question: What printer or what kind of barcode muodules you are using for barcodeprinting? This program was originally written for the fonts&more modules from HP (no intelligence, just the fonts). With the more intelligent modules you don't need any translation of characters or to compute the checksum.
Regards
csecgn
fmorais
17th December 2004, 11:56
I am using BWPrint. It takes care of the Barcode printing.
The barcode already comes out. The problem is that I don't know what string to send into the report field. I know that if you build a string like:
(02)05410687012862(37)05(15)050417(3102)007500
And send it to the report, the barcode comes out without the parentesis. I already read somewhere that you need to send some character, instead of the parentesis (chr$(203) or chr$(204) or something). The parentesis are just used to represent the human readable form of the barcode. I already tried:
chr$(204)0205410687012862chr$(204)3705chr$(204)15050417chr$(204)3102007500
and the barcode does not ged read so, the problem remains.
Thanks
Fred
csecgn
17th December 2004, 13:46
I'm not so familiar with BW print. Did you try code 128 instead of EAN 128? Maybe this could be a solution. I'v read that CODE 128 accepts ACII 1 to ASCII 134. You need ASCII 40 and 41.
regards
Christof