Bar codes
Good day for everyone
I need to generate one bar code using type EAN128. I have started to build
my report using the TppBarCode component and I've searched in the property
BarCodeType EAN128 and it doesn?t appear, there are others like EAN 13 Code
128 but I dont need them. If someone can help me to solve my problem I will
apreciate you.
Thanks
I need to generate one bar code using type EAN128. I have started to build
my report using the TppBarCode component and I've searched in the property
BarCodeType EAN128 and it doesn?t appear, there are others like EAN 13 Code
128 but I dont need them. If someone can help me to solve my problem I will
apreciate you.
Thanks
This discussion has been closed.
Comments
AutoEncode to False and manually encode the data.
-----------------------------------
Tech Tip: Manual Encode Barcode 128
-----------------------------------
By default Barcode.AutoEncode is set to true. For most applications, you
should use the AutoEncode feature - which creates the encoded version of the
data automatically.
Set AutoEncode to False and manually encode the data for a Code 128 BarCode
when you have special requirements.
If you are unfamiliar with Code 128, I will try to give you a quick
tutorial, as Code 128 is more complicated than most other one-dimensional
barcodes.
The first thing you must know about Code 128 is that it has three different
character sets (A, B, and C). That means one set of bars can mean three
different things based on which set is currently in use. The other tricky
bit is that you have the option of switching character sets in the middle of
the code. I think you see now why this is a more difficult code.
Character set A can encode most symbol characters (!,$,/, etc.) as well as
all uppercase letters and the ten digits. In addition, it can encode the
"special" ASCII characters, such as carriage return, line feed, null,
escape, etc.
Character set B encodes all symbol characters, upper and lowercase letters
and the ten digits.
Character set C encodes 100 pairs of numbers. That is, one set of bars
could mean "05" or "43", etc. This effectively doubles the density of Code
128 when using numbers only. Also note, because they are numeric pairs, the
Code C portion must have an even number of digits.
Now that you know what the differences in the codes are, you now have to
know how to use them with the BarCode component. Since all normal ASCII
characters are used by Code 128, we must use special characters to tell the
component what to do. The BarCode component uses ASCII values #208 through
#242 for this purpose. If you're using the Object Inspector to type the
Data property, you hold down the Alt key, then type (on the numeric keypad)
0 + the number (Alt-0208 for instance). The table below lists all of the
special characters.
#208 START A
#209 START B
#210 START C
These are the special START CODE characters. Each Code 128 barcodes MUST
START with one of the three above. Which start code you use is obviously
which character set is active. You cannot use a start code in the middle of
a symbol. See the table below for the special codes used to switch to a
different character set.
Special Char Character Set A Character Set B Character Set C
#201 Function 3 Function 3
#202 Function 2 Function 2
#203 TempShift to B TempShift to A
#204 Switch to C Switch to C
#205 Switch to B Function 4
#206 Function 4 Switch to A Switch to A
#207 Function 1 Function 1 Function 1
#211 NUL
#212 SOH
#213 STX
#214 ETX
#215 EOT
#216 ENQ
#217 ACK
#218 BEL
#219 BS
#220 HT
#221 LF
#222 VT
#223 FF
#224 CR
#225 SO
#226 SI
#227 DLE
#228 DC1
#229 DC2
#230 DC3
#231 DC4
#232 NAK
#233 SYN
#234 ETB
#235 CAN
#236 EM
#237 SUB
#238 ESC
#239 FS
#240 GS
#241 RS
#242 US
Got all that? Ok, so here's what that table means: if the current
character set is A, then a #205 means Switch to Code B. If the current set
was B, that same #205 means Function 4.
The Switch codes are all boldfaced because you'll probably use those the
most. A Switch code means "Switch to Character Set X for the remainder of
the code, or until another Switch code is encountered."
The Temp-Shift codes means "Shift to Code X for the next character only."
The "Function" codes mean different things based on your barcode reader.
Generally they are explained in the reader's documentation.
Ok, I think a few examples are in order:
Let's say you want to encode the text "CODE 128". Character set A is
sufficient. Here's how:
ppBarCode1.Data := #208 + 'CODE 128';
If you were using the Object Inspector, you would've typed {Alt-0208}CODE
128.
Here's a little more advanced example. We want to encode "1234 abcd". We
can use Set C, since we have an even number of digits. Then we have to
switch to Set B for the lowercase letters.
ppBarCode1.Data := #210 + '1234' + #205 + ' abcd';
Ok, one last example. We want to encode "Soft Sector 1996", but we want a
Carriage Return in between "Soft" and "Sector". Here goes:
ppBarCode1.Data := #209 + 'Soft' + #203 + #224 + 'Sector ' + #204 +
'1996';
See what happened there? We started off in Set B and wrote "Soft", then we
Temp Shifted to A to encode the CR. The we wrote "Sector" in Set B.
Finally, we switched to Set C to encode "1996."
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Barcode type EAN 128 using CODE 128 A,B or C like in showed examples?because
my doubt is how to generate Barcode type EAN128 using TppBarcode component?
Thanks again
Yes. Code 128 is a gernal purpose standard. UCC/EAN-128 is a specific
application of that standard.
http://en.wikipedia.org/wiki/GS1-128
http://en.wikipedia.org/wiki/Code_128
I do not have an example, but customers have used this approach. Here is
some more info I found via Google.
http://www.idautomation.com/code128faq.html#About_Code_128
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com