#19406 - 03/16/06 04:31 PM
UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Can someone help me to create UCC128 barcodes? Here is my customer's description of what we need:
"They are 128 barcodes with a C Function1 prefix"
This is apparently not the same as a 128C barcode - I created a couple of those and sent them to him, and he said that they were the wrong type.
Any ideas? Or maybe someone has done this before?
Thanks,
JAFrank
|
Top
|
|
|
|
#19408 - 03/17/06 10:35 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
The following link gives you some of the specs for these barcodes http://www.gs1uk.org/EANUCC/WORD_Files/GS_Section_5-3_V7.doc The PPTalk help tells you how to form custom built 128 barcodes including switching character sets. (Search for "Select data for a Code 128 bar code"). It doesn't tell you which ascii character the PP implementation uses to represent the FNC1 code though, so some experimentation may be necessary.
|
Top
|
|
|
|
#19409 - 03/20/06 01:32 PM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Thanks for the reply, but I am apparently still doing something wrong since my customer is telling me that the resulting barcode still scans as a 128C rather than a UCC128.
I have created a barcode with a custom data selection. Under 'string to display' I have:
f =@(152,61,68)
In 'Barcode Options', I have Code C selected, as well as 'Automatically Append Checksum' and 'Add start/stop character automatically'
Did I misread the instructions above, or am I doing something wrong?
Thanks, JAFrank
|
Top
|
|
|
|
#19410 - 03/21/06 07:06 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
Try the following example Select a barcode type of code 128, check 'append checksum', and 'add start/stop'. Select subset code B. In 'data', select custom and paste in this ='\206'+'\203'+c128('00')+c128('35')+c128('01')+c128('23')+c128('45')+c128('12')+c128('34')+c128('56')+c128('78')+c128('94')
This means - \206 = function code1 \203 = switch to code C c128()=PPtalk function to convert 2 characters into 1 Code128C character. You obviously need to replace this bit by your own data. This produces a barcode identical to that in the standards doc which scans successfully. I've tried to produce versions that don't switch codes but with no success. Hope this helps This does highlight a problem with the PPTalk help. The section 'Select data for a C128 barcode' is plain wrong. It gives the following special characters - \203 = switch to code C \205 = switch to code B \206 = switch to code A The correct values are \203 = switch to code C \204 = switch to code B \205 = switch to code A \206 = function code 1 regards Stuart
|
Top
|
|
|
|
#19411 - 03/21/06 08:45 AM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Thank you for the information - I will try to test it later today.
One question, though - does each value in the barcode have to be encoded separately, as in your example, or can the whole number be done at once in a single data selection.... [+c128(@(42,2,10)]?
Thanks again,
JAFrank
|
Top
|
|
|
|
#19412 - 03/21/06 09:39 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
The c128 function takes only a 2-character string as input and returns a 1-character string. It would be nice if it took any even number of characters but .. it doesn't. You can always put it in a loop if you have a lot to encode. regards Stuart
|
Top
|
|
|
|
#19413 - 03/23/06 12:59 PM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Ok, I did this: Originally posted by stuartg: Try the following example
Select a barcode type of code 128, check 'append checksum', and 'add start/stop'. Select subset code B. In 'data', select custom and paste in this ='\206'+'\203'+c128('00')+c128('35')+c128('01')+c128('23')+c128('45')+c128('12')+c128('34')+c128('56')+c128('78')+c128('94')
Except I modified the data selection to this: This is closer, it is a B F1, the requirement is a C F1 Do you see what I could have done wrong? Thanks, JAFrank
|
Top
|
|
|
|
#19414 - 03/24/06 08:29 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
I haven't got any examples of this type of barcode, but I have created an example that looks feasible (and scans), so I suggest you try this experiment. The problem I found is that PPress assumes that the only characters that you can add in Code 128 C barcodes are all numeric. This is only partly true - there are also the function codes and the start/stop characters. I could find no way to access these codes if Subset C is selected, because Press automatically tries to convert any string its given. So to circumvent this, specify Code B, remove the 'append checksum' and the 'add start/stop' - we have to add these explicitly. Paste this code into the custom data selection ='\211'+'\206'+c128('00')+c128('35')+c128('01')+c128('23')+c128('19')+'\212' This means \211 = start code c \206 = function code1 00350123 = data 19 = checksum \212 = stop code Unfortunately, the standard checksum calculator puts the check character on the end of the string. This is no good because we've already put the stop code on, so I've manually calculated this checksum. It scans ok, but my scanner isn't fussy, so try it out, and if its the right format, I can do a function that appends the right checksum. regards Stuart
|
Top
|
|
|
|
#19415 - 03/28/06 09:58 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
Assuming that the format you are looking for is that in my previous post, the following function calculates the checksum etc. Just throw your data at the function and give the output to a standard barcode. regards Stuart function @Barcode128CF1(&bcdata:string):string
%
% translates &bcdata to a C Func1 Barcode
% function adds start/stop, checksum and func1 characters
% If a human readable code is required this must be added
% manually.
%
% pass this data to a type128 barcode using a custom data
% selection eg custom data selection = @Barcode128CF1(&my-data)
% ensure that (1) all the checkboxes "add hyman readable",
% "add start/stop" and "add checksum" are NOT checked
% (2) the barcode subtype is set to A or B (NOT C)
% (3) input data must be even nunber of numeric characters
%
define(&bc,string,'')
define(&i,integer,0)
define(&bccheck,integer,0)
% code c start
&bc:='\211'
&bccheck:=ord('\211')-32
% function code 1
&bc:=&bc +'\206'
&bccheck:=(&bccheck+ord('\206'))-32
% data items
for(&i,1,2,length(&bcdata))
&bc:=&bc + c128(mid(&bcdata,&i,2))
&bccheck:=&bccheck+(((&i+3)/2)*strtoint(mid(&bcdata,&i,2)))
endfor()
% check digit
&bccheck:=mod(&bccheck,103)
&bc:=&bc+char(&bccheck+32)
% stop char
&bc:=&bc+'\212'
&result := &bc
endfunction()
|
Top
|
|
|
|
#19416 - 03/28/06 02:33 PM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Wow, this is great, but I'm apparently a little out of my depth here.
I sent your previous sample to my customer to test against his reader, but haven't heard back from him yet.
I'm not familiar with how to incorporate a function in PlanetPress - is this a separate presstalk object, or do you convert the barcode itself to a Presstalk object and then add the fuction code to it? Or is there some other way to use it that I haven't come across before?
Thanks very much for your assistance - this is amazing!
JAFrank
|
Top
|
|
|
|
#19417 - 03/29/06 04:24 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
I set this up as a global function. On the Insert tab, click Global Function. A new function GlobalFunction1 will appear in your document. Double clicking on it will open the PressTalk editor, just copy and paste the code in place of the empty function. stuart
|
Top
|
|
|
|
#19418 - 03/29/06 08:43 AM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
I'm trying desperately to not appear thick here...I must be getting a little hard of thinking in my advancing years. I followed your directions (several times), but after I paste your code into the PressTalk editor in place of the empty function: GlobalFunction1()
EndFunction and click the Ok button, I get the following error message:
P0030: No other function declaration is allowed in the global function definition Wouldn't it be nice if it just worked the way it was supposed to? I really do appreciate all of the help you have given me.
|
Top
|
|
|
|
#19419 - 03/29/06 09:10 AM
Re: UCC128 Barcodes
|
OL Expert
Registered: 03/06/03
Posts: 713
Loc: Swindon, England
|
I remember getting that message, but I can't remember what I did to get rid of it. It works fine whenever I try it now. Send me a private message with your email and I'll send you a form with the function in.
|
Top
|
|
|
|
#19420 - 07/06/06 02:56 PM
Re: UCC128 Barcodes
|
OL Expert
Registered: 02/21/01
Posts: 669
|
Try removing any empty lines following the text.
_________________________
Uomo Del Ghiaccio --------------------
|
Top
|
|
|
|
#19421 - 09/12/06 01:01 AM
Re: UCC128 Barcodes
|
OL User
Registered: 01/04/02
Posts: 86
Loc: Portland, OR
|
Well, this one has come back to haunt me, but in a way I hadn't imagined....
For some reason, if I run my form locally AND my 20 character data selection ends with '95', part of the barcode does not display - just a blank section, right in the middle.
It even happens with preview.
I can't see anything wrong with Stuart's function - or even anything that would cause it to care what the actual digits are.
Any ideas?
JAFrank
|
Top
|
|
|
|
|
|