PDA

Click to See Complete Forum and Search --> : Barcoding Procedures


riechan
Sep 1st, 2009, 08:39 PM
Hi guys. Just have a tiny bit of a problem.

So we proposed to have a library system for our thesis proposal, and recently had our predefense for it. Our panel told us to add barcoding feature to our inventory subsystem. The problem is, since this is our first time to handle such interface, we don't know how the flow goes.

So how do you exactly use the barcode reader anyway (when it comes to registering the barcode of a certain book, and adding information related to that barcode)? Like, do you first scan the barcode of a book, encode it with all the necessary info, and then when it's been encoded into your database, can you simply just scan the book, and retrieve the information from your database with the help of that barcode?

A little help here, anyone?

Thanks,
Rie

Note: Please move this thread to its proper forum if necessary. Thanks again.

FunkyDexter
Sep 2nd, 2009, 06:44 AM
Basically a barcode scanner acts as a keyboard and the barcode you see on a book is actually just a font. So although you see narrow line, thick line, big gap, narrow line small gap, the scanner sees "54738" (or some other code) and that's what it sends to the computer.

If you want to see an example of this, plug your scanner in (most use USB or a keyboard wedge) open up notepad and scan something. You'll see a code appear in notepad as normal text.

If you're writing a program in VB you'll typically put a text box on your screen and set focus to it. When the user scans a book the books code will appear in the text box. You can then handle the text boxes events to do whatever you like with that code.

One thing you'll need to consider, there are actually several different barcode fonts. Most barcode scanners are set up to read all of them by default but some need setting up individually. If you try and scan a book and nothing happens the most likely cause is that the scanner doesn't recognise the font. I don't know what font books use but I imangine it's a standard font so if you can find out what that is you should be able to set up your scanner to read it.

riechan
Sep 3rd, 2009, 07:07 AM
@FunkyDexter: I see, so that's how barcode readers work. I thought before that what the reader scans is the bars in there, and it will be stored in the program as an image or something...

By the way, is programming on one kind (or brand) of barcode reader the same with regard to working with other kinds (or brands)? Someone mentioned to me that their APIs differ... I would just like to verify this.

Jenner
Sep 3rd, 2009, 08:40 AM
Most barcode scanners are indistinguishable from a keyboard. For example, suppose you got a UPC style barcode with the number "0259382912". When you scan the barcode, it transmits to the computer the ASCII text "0259382912" just as if you typed it on the keyboard.

Software that utilizes barcodes typically also utilize a database. Let's say you want to make a program that stores books in a library. You make a database with a table that holds relevant information about the books: Title, Author, ISBN, Copyright, Edition... but you most likely also have a Primary Key that is just an auto-generated number. It's meaningless except as a unique number in your system. It doesn't break down into any form of code or any order, it's just a number. When a new book is added to the table, it's automatically assigned the next number in the sequence. It's used by the computer for mostly internal indexing; maybe it's even used by the user as well as an auto-assigned "book ID number".

This number though, makes the perfect barcode! All you need to do is print it on a sticker as a barcode. So, I pick a barcode style I want to use... like CODE39... a very simple barcode that lets you use all CAPITAL LETTERS and numbers. The only stipulation is the actual barcode has to have a "*" at the beginning an the end for the scanner to read it. Thus, if I wanted to make a barcode of the numbers "12345", I take "*12345*" and print it with a CODE39 barcode font. I do this as easily as I tell Windows to print the text "*12345*" in Arial or MS Sans Serif. Heck, I could do it from Word for testing.

When the scanner reads that barcode back though, it's only going to send the text "12345". The "*"'s are there only for the scanner's own reference.

Different barcode systems have different requirements. CODE128 for example has a check-character that you have to calculate and append to the end. If the check character isn't correct, the barcode won't scan. Most scanners though are able to scan at least the 10 most common barcode systems. There isn't much of a need to go beyond those unless you have special requirements.

riechan
Sep 5th, 2009, 10:39 AM
@Jenner: Okay. Just reading through your reply makes me want to quit the project. Unfortunately for me, I can't.

Confusing, really. But, based on what you said, I'm guessing I should go and grab a barcode reader that reads CODE39 font, so that I'll have an easier time getting the code from the barcode. As well as making the BookID for the books static. Guess the only catch here is that the staff would have to print out stickers for the codes.

What if I just use the barcode that is included with the book? Would I need to use a CODE128 barcode reader or would a CODE39 suffice for it? Like in this VB.NET book, it says, 9789812471383?

Sorry if I have a lot of weird questions. This is REALLY my first time to work on this kind of application, and before I start coding, I want to research as much on the topic.

RobDog888
Sep 5th, 2009, 01:42 PM
The easiest way to print barcodes is by using barcode fonts. Some are free and some cost ~$100 or less. I would definately go with Bar3of9 as no need to generate complex check codes etc.

The reader you have should come with some documentation on the start/stop character, quiet zones and width to height ratio tolerances.

If you need to print a bar code simply use a textbox or label and set its font to be the barcode font. If printing from an Access report or Crystal Report its just that simple.

Jenner
Sep 8th, 2009, 08:19 AM
@riechan: Don't worry, at this point, even the CHEAPEST barcode scanners can read UPC, CODE128, CODE39, CODE39 extended, and about a dozen other barcode types right out of the box, with zero configuration. Just point, click the button, scan, and it'll send the barcode's into to the computer via keyboard. Most of the time, you don't even know what format the barcode you're scanning is in! The scanner just figures it out! :)

Whichever barcode system you use is entirely your choice. Some have limitations though:
UPC is limited to 10 numbers, and no letters. It also has specific formatting requirements.
CODE39 has no limit on length (except for how much your scanner can optically scan at once, typically maxxing out at around 26 characters) and is limited to numerals, some select symbols and upper case letters. A "*" character must be at the beginning and end of the barcode.
CODE39 Extended is the same as CODE39, but higher density to include more symbols and lower case letters as well.
CODE128 is like a high-density version of CODE39 Extended. It's main difference is it also needs a single checksum character at the end, that must be calculated from the rest of the data.

If you hit up Wikipedia, it'll explain all these barcode systems to you.

Personally, I'd recommend CODE39, since it's one of the easiest to use and a free CODE39 font is easy to find and use.

Don't get frustrated or discouraged, remember, barcodes are nothing more than just a label of data. They really are super simple!

If the books already have a barcode, then you may be able to use it. Like any data, you ask yourself some simple questions: Is this data unique to this book? Would any other book ever have this same barcode? If I got exactly two of the same editions of this book, would they have the same barcode or different ones? Would it matter for what I'm doing? Can I use this data as a unique index in a table of all my books? Do I want to track each individual copy of the book, or do I just need to know how many general copies I got?

CVMichael
Sep 8th, 2009, 11:59 AM
See this for Code128 barcode

http://www.vbforums.com/showthread.php?t=514742

FunkyDexter
Sep 15th, 2009, 08:00 AM
Jenner, you just saved me BAGS of time.:thumb: We're going to print various identifiying codes (Customer numbers, product codes etc) on letters we sent out and we want to prepend them with a single char to identify what type code it is so we can ensure it's read back in apropriately. We couldn't get the "free 3 of 9" font to accept them reliably, though, and it was only when I read your post that the penny dropped - they have to be capitals. There are times when I can spend hours missing the bleeding obvious.:blush:

riechan:-
1. As others have said, Code39 is a good barcode font to use but, unless you're going to be printing the barcode yourself (which I don't think you are - you're going to be reading it off books) then you don't have a choice, you're going to have to use whatever the standard for ISBNs is. Looking round google I get the impression it's called ISBN-13 but I'm really not very clear on that (our scanner doesn't list that as a font it knows but I can scan books with it:confused:). You shouldn't struggle to find this out with a bit of leg work though.

Jenner
Sep 15th, 2009, 10:12 AM
I did find an awesome little program (VB6 w/ source) and free font for creating 3D Barcodes using the PDF417 standard. I'd post the link to it but for the life of me I can't seem to find the site anymore.

InertiaM
Sep 15th, 2009, 04:01 PM
@Jenner - It was probably this site (http://grandzebu.net/informatique/codbar-en/pdf417.htm)

PDF417 isnt really a genuine 2D barcode, it's more like a multiple-stacked 1D. DataMatrix (and others) are proper 2D barcodes.

Jenner
Sep 16th, 2009, 03:05 PM
That would be it. Hey, you need a 2D scanner to read it, that's 2D enough for me in my book. :)

gate7cy
Jan 11th, 2010, 03:36 AM
Very helpfull topic guys. Some nice piece of information but I am having some problems with barcodes. In my case I am going to print the barcodes and also generate them. I have used various fonts and I cannot get the scanner to scan them. It scans whatever barcode I test, other than the ones that I generate. I tried printting on paper A4 and on the label A4 but not scanning. Is the printer I am using to print the label barcodes has to be setup or have any special specs in order to print succesfull barocdes. I made some mockup barcodes to test the length and characters it can read. I found out that when I enter normal, long barcodes they are not scanned. I was succesfull in scanning some 3-digit barcodes and 4-digit. I could not scan anything more. I am using Barcode39 with font size 16. I am testing the printouts on two completely different scanners. Both of them work the same in scanning my barcodes. Which that means they ony scan small character sequences. Anybody with some help. Thanks for your efforts

Jenner
Jan 11th, 2010, 08:50 AM
Code 39 requires asterisks (*) on either side of whatever you're scanning. So if you wanted to make a barcode of:

123456

You'd need to type this:

*123456*

And convert it to the barcode font. When the barcode reader scans it, it uses the asterisks on the ends as reference only, and it will only read "123456".

Also, do NOT test barcode printing in Word! Use Wordpad! Word has hidden characters that my get translated to the barcode font and it'll muck up your barcode! So, open Wordpad, type: *123456* highlight it, change to your Code39 font, print, and it should scan perfectly.

gate7cy
Jan 11th, 2010, 09:26 AM
I am using the asterixes already and I am not using word