Bar code reader component

Posted on 2003-02-28
Medium Priority
Last Modified: 2010-04-04
Hello Experts.
We want to develop application that needs to be interfaced with Bar code reader, to read bar code in store products information in a database.

1. I didn't started this application, so that I want to know is there any special components in Delphi that is used with bar code readers, and what type of it's Interface, is it serial or like card reader connected with Keyboard.

2. Is there any advisable bar code reader device that easy to program? or programming has no thing to do with device type.

Thanks in Advance

Question by:Motaz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8043107
  a barcode reader contains its own software to generate the character-equivalent of the barcode read as though the characters contained in the barcode were typed by a human user on a keyboard.

  You can get a keyboard wedge type, or some types allow you to input via a serial port.

  In either case, you scan the code, the characters are "keyed" into the device you're reading (keyboard, serial port, wherever...)

  No need for components at all!



Author Comment

ID: 8044233
Is that mean I can start programming, and when I get the bar code reader, just I have to plug it, install it's driver and software, then it needs only focused edit box to input bar code from products in my edit box?


Author Comment

ID: 8044236
and What about the types of Bar code readers?

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 8045404
I've been working with some bar code readers for a while, usig models from Metrologic. Basically i've used three models, two with serial interface and one with keyboard interface. In all of them the configuration of the Bar code reader is made directly to the Reader and there is no need to install special software or drivers, just plug them in and they start working. The Keyboard type, just sends the input to the keyboard buffer so it´s not necesary to make any special programing for this, the serial type however, sends the input to the serial port so you must program the code to scan the serial port at some time intervals (there are components that do this, but i don´t remember the name of any of them, search in www.torry.net for some of them) and do what ever you want with the data you received. I usually send this data to the Keyboard buffer so i don´t have to mind what kind of barcode scanner is installed, and it behaves exactly like a Keyboard type Bar code reader. To do this, I use a very usefull DLL named "PushKeys.dll" you can find it in:


Hope this helps you.

Expert Comment

ID: 8045690
Hi Motaz,

  I've also worked with some Metrologic barcode readers. The model I used was working with an RS232 cable. You plug the serial cable in one of your COM port, set a terminal program with correct settings (often 9600 bauds, and so and so) and your set. If you want direct control of your barcode reader without the use of external driver, a simple access to your COM port in Delphi can make you happy :). No need for edit box.

  But, you might prefer other solutions?

// Connect to FPortName --> '\\.\COM1'

  FHandle := CreateFile( pchar(FPortName),
                         GENERIC_READ or GENERIC_WRITE,
                         0, // Not shared
                         nil, // No security attributes
                         0 // No template
                        ) ;

I don't have the code where I am but tell me if you need more help with this. The barcode scanned is sent in ASCII directly to you by the reader. You can tell the barcode reader to send a starting and ending character to help you extract the code from the string.


Anyway, hope it helps!
Have a nice day Motaz! ;)

Accepted Solution

billious earned 1000 total points
ID: 8045774

   You got it. Nothing more required. There isn't even an "install the driver and software" step - it's just like having a second keyboard in parallel with the first (if you use a "keyboard wedge" type.)

   I'm certain that some types will require some simple driver - somehow it's expected. There are some that you can program to decode only some barcode types, but that's probably too fancy for your needs - and it's a hardware configuration consideration, nothing to do with your software.

   What do you mean by "types"? Do you mean "Brand" or physical configuration (wand, gun, benchtop) or are you concerned about the various barcode types in use?

   If you're dealing with product codes (as found on most items for sale at supermarkets) then you will find that there are three standards, (EAN-8/UPC-E) which is the 8-digit standard, UPC-A, which is the 12-digit standard, and EAN-13, which is the 13-digit standard. If this is what you are using, then simply fill the code read with leading zeroes to the 13-digit length.

  If you're using ITF-14 (carton outer) then you'll get a 14-digit code. You would find ITF-14s at supermarkets - on the big outer wrappers, the barcode surrounded by a heavy-printed box.

   If you are after some other internationally-defined code, such as SSCC or EAN-128, then decoding is another matter - somewhat complex in some cases.

   If you are looking for some internal application, such as asset-tracking then the format is what you choose.

   In all, don't worry about the exact barcode "font" in use - it's the barcode-reader's job to do that. Your application can assume that the reader will simply input the sequence of characters defined in the code sample to whatever port it's attached to - serial, parallel or keyboard - and  no special measures need to be taken on your part. It's the job of the barcode-reader to decode whatever barcode type is presented to a character-string, and the job of its driver to present that string as though it was coming from the keyboard.




Expert Comment

ID: 8047100

Author Comment

ID: 8048367
I'll post points to all commenters

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question