954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to read input from barcode scanner?

from what i have research, there are some barcode scanner which is uSB and are keyboard wedge have built in decoders that can read several barcode types and send them via the keyboard so info scanned appears as if it has been typed. Therefore does it means that, if the user just scan a barcode into the textfield, the data can be retrieved using the normal way?

But what if the barcode scanner is non-USB and do not have keyboard wedge interface, can it be done using php? so is there any php scripts that have written for this function? can anyone help? Thanmks in advance.

starsunited
Light Poster
44 posts since Dec 2004
Reputation Points: 11
Solved Threads: 1
 

What do you mean by "Non-USB"? Serial? PS2?

I'd imagine that with either PS2 or USB would work the same, as the OS handles the text input all the same. If it's some other input, it might be different-- you might need to know if PHP has an interface to a certain device driver.

alc6379
Cookie... That's it
Team Colleague
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
 

from what i have research, there are some barcode scanner which is uSB and are keyboard wedge have built in decoders that can read several barcode types and send them via the keyboard so info scanned appears as if it has been typed. Therefore does it means that, if the user just scan a barcode into the textfield, the data can be retrieved using the normal way?

But what if the barcode scanner is non-USB and do not have keyboard wedge interface, can it be done using php? so is there any php scripts that have written for this function? can anyone help? Thanmks in advance.

What exactly are you trying to do? Surely this is a problem for the client interface, not the server?

Roberdin
Supreme Evil Overlord
Team Colleague
282 posts since Feb 2003
Reputation Points: 63
Solved Threads: 6
 

hi

i'm having a similar problem. I'm trying to get a barcode reader to work on an embedded system, but for now just on my desktop running debian with a 2.4.26 kernel. I've got a ps2 barcode scanner in a ps2/usb connector connected to the usb port.

the kernel registers the ps2 connector, but i have no idea how to access the device. Any ideas. At the moment it seems i need to write a device driver for the device, but would love it if there was an easier way.

what device would I have to access to read the scanner? /dev/usb/??? i can't seem to find it. also i'm using the usbkbd driver. I know its limited, but i can't get the keybdev driver to work on the embedded system....

thanks in advance

nickster
Newbie Poster
1 post since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

The joy of barcode readers. I have worked with serial readers and basically as long as you can read from a serial port and detect Start and End of Text you can usually frame the data. With that said the wand when inserted into the well or whatvever will dumps its data quite rapidly. Thus your application needs to be able to read the serial feed rapidly. So is this PHP-able? This sounds a little dicey given the small window that exists for the data dump. Ultimately if the wand you are using is more sophisticated (i.e. allows a delay) then you may be able to read it. As always good luck

mcldev
Light Poster
31 posts since Feb 2005
Reputation Points: 10
Solved Threads: 3
 

We build linux based POS systems with PHP/MySQL. We plug a good USB scanner (try cobra) and it reads the barcode and translates to text. There's not a script side parsing from code39 to text that you have to do, that's what the reader does. If your reader sends delimiters, (like mag stripe readers do) you will need to strip those but that's easy enough. We've used serial port readers but its always a pain getting compatible drivers etc. Just drop a few more bucks and go USB to save headaches.

barnamos
Junior Poster in Training
50 posts since Mar 2005
Reputation Points: 15
Solved Threads: 0
 

Interesting discussion; I actually have a barcode scanner that I could experiement with, and maybe I can make something out of it - or at least make it work, for starters.

Gary King
PHP/vBulletin Guru
Team Colleague
417 posts since Nov 2003
Reputation Points: 53
Solved Threads: 5
 

Hi starsunited. I'll need to do that work soon. A co-worker did it and as far as I remember when talked to him he used handhelds with bar code readers. Basically the handheld has WinCE so he was able to read the barcode and the handheld passed the information directly to a PHP page that handled the code. This is a pretty good thing because if you have a wireless connection you can make live connections to a master database to process orders. I'll try to find more information about how they implemented it.

RamiroS
Junior Poster in Training
57 posts since Mar 2005
Reputation Points: 10
Solved Threads: 2
 

Thanks RamiroS.

starsunited
Light Poster
44 posts since Dec 2004
Reputation Points: 11
Solved Threads: 1
 

Hey,

I have web based ERP system and going to attach barcode reader to the web interface.

Any idea how to use webbased interface for checkout process?

It seems that Javascript has to wait for "\n" (end of string) and Postback the form.
In my case to avoid Postback I'm going to use AJAX.

Does anybody have expirience with barcode and webforms ?

Thanks.

dotnetguy
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 0
 

We use a Cobra scanner that lets you set whether or not to send a "return" after a successful read. Most have that setting available, and the good ones let you program the scanner directly without having to use a Winblows machine (shuddder) and load software etc. We use a modified Konqueror browser as the Point of sale interface.

barnamos
Junior Poster in Training
50 posts since Mar 2005
Reputation Points: 15
Solved Threads: 0
 

Well ... I've been trying to find somewhere answer to the issue related to "as long as you can read from a serial port and detect Start and End of Text you can usually frame the data" as posted by mcldev. I think that would be the key. The scanner itself fires keyboard events. As PHP is server side, there is now way to catch the scanner data. You must use something on clent side. So only way to catch the data is JavaScript (or something like that).
And here comes the question. Are you able to identifySTART and END of text coming from scanner?
Because scanners can be programmed in different way, you cannot rely on any special characters ... I guess ... as I run into a problem.
So to dotnetguy ... don't wait for "\n" I have two scanners here and none of them sends that ;o(
So if anyone has knowladge how to read input stream data or something like that in JavaScript, please let me know.

kyso
Newbie Poster
1 post since Sep 2006
Reputation Points: 10
Solved Threads: 0
 
Hey, I have web based ERP system and going to attach barcode reader to the web interface. Any idea how to use webbased interface for checkout process? It seems that Javascript has to wait for "\n" (end of string) and Postback the form. In my case to avoid Postback I'm going to use AJAX. Does anybody have expirience with barcode and webforms ? Thanks.



Even I am facing same problem in reading input from barcode scanner,and also I have to identify whether input is coming from keyboard or barcode scanner.

p17
Newbie Poster
3 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You