PB & Barcode Scanners

Everything else that doesn't fall into one of the other PB categories.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

PB & Barcode Scanners

Post by Xombie »

Has anyone worked with barcode scanners using PB? Can y'all recommend a library and scanner to use? I don't need anything complex and a hand held would work just fine. I believe the target computer will have a serial port but I'm not 100% certain.

Thanks!
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

As far as i know, Barcode scanner acts like a keyborad. PB will not know if its a barcode scanner or a keyboard (which is fine, its easy to use it. In practical uses, using tha barcode scanner will be the same for PB as is the user uses the keyboard to insert the prices on the gadgdet).

Also there are some PB libs on PureArea.Net that let some manage of barcode stuff.
ColBoy
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:

Post by ColBoy »

Some scanners like the Symbol LS2208 allow you to drive the scanner in a virtual serial mode. i.e. it converts the USB scanner to a serial scanner, where you can grab the barcode from the configured serial port. Otherwise text wedge mode is the same as typing the characters in yourself. Bare in mind, that the edit control will need focus, otherwise the barcode scanned will just vanish into the ether. All fairly painless with PureBasic.

Colin
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

The cheaper scanners only have 1 mode. USB scanners can mostly emulate the keyboard or a serial port. Older scanners used to have a keyboard passthrough plug setup. I don't see this as much nowadays.

The best thing to do would be to insist that the user use a USB scanner with keyboard emulation that can read the 3of9 barcodes.

Start and end each barcode with the "*" character in barcode format.

Viola you are managing inventory!
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Thanks - y'all were right. It treats it just as a keyboard type thing and sends as text + crlf. That works out well. Although, it'd be nicer if it distinguished in some way different than a keyboard so I could trap it better.
alokdube
Enthusiast
Enthusiast
Posts: 148
Joined: Fri Nov 02, 2007 10:55 am
Location: India
Contact:

Post by alokdube »

it really should not matter, I mean why do you need to check the source of the input?
there are IP enabled barcode scanners too by the way...
ColBoy
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:

Post by ColBoy »

alokdube wrote:it really should not matter, I mean why do you need to check the source of the input?
there are IP enabled bar code scanners too by the way...
You might want to do this, when backtracking to determine whether the bar code was really scanned (accurate) or the user typed it in (liable to mistakes).

You can simulate this by using a different suffix character. It the user presses the bar code, then Enter, then it was keyboard entered, if it was scanned with say a tab as the suffix then it was scanned by scanner. It's never infallible though.

Colin
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

You may direct the barcode scanner to a gadget that is not visible, so nobody can type it there manually.
For manual usage use another gadget, so its easy to know which one was used.

Just one idea, never test it myself.
DarkDragon
Addict
Addict
Posts: 2348
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Many barcode scanners have a second port for RS232 communication, next to USB (As HID-Keyboard). Maybe you also want to check this?
bye,
Daniel
ColBoy
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:

Post by ColBoy »

ricardo wrote:You may direct the barcode scanner to a gadget that is not visible, so nobody can type it there manually.
For manual usage use another gadget, so its easy to know which one was used.

Just one idea, never test it myself.
That doesn't work, as you can't direct the barcode scanner if it is functioning as a wedge reader, as you have no way of knowing if the keys are coming from the wedge reader or the keyboard.
Colin
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

The only reason I'd like a way to detect whether it was the keyboard or scanner is because I would like to prevent the user scanning into a string gadget other than the very specific one.

I don't have control over the barcodes so I can't add in special identifiers to handle it in this way.

Mostly it was just an idle wish. If the user accidentally scans the barcode while in a different field, they'll have to back it out. It's for an internal app so I don't worry so much about that.

And the one I purchased is only USB so unfortunately no serial port or otherwise.

I appreciate all the discussion, though. Always good to see thoughts being passed around.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

ColBoy wrote:
ricardo wrote:You may direct the barcode scanner to a gadget that is not visible, so nobody can type it there manually.
For manual usage use another gadget, so its easy to know which one was used.

Just one idea, never test it myself.
That doesn't work, as you can't direct the barcode scanner if it is functioning as a wedge reader, as you have no way of knowing if the keys are coming from the wedge reader or the keyboard.
Well, its possible.

per example if you let the user pick a radio button to change the gadget depending on if was manually or using the scanner. Yes, the user can cheat you, but i dont think we are talking about detectivesque code, just a way to make it easily to manage.
In the front GUI there could be a choice to choosee the option barcode scanner or keyboard.

Im sure there are a lot of other possibilities to achieve this.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post by Rook Zimbabwe »

Yep... put in a button titled BARCODE LOOKUP (or whatever your use would be) and use that to SETACTIVEGADGET() to the correct stringfield! :D
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
tbohon
User
User
Posts: 42
Joined: Sat Nov 22, 2008 4:22 am
Location: Olympia, WA USA

Scanner

Post by tbohon »

Xombie:

Which scanner did you purchase? I'm looking for one myself ... :lol:

Tnx.

Tom
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

It's a Metrologic MS9520. I can't give a recommendation except to say I plugged it in and it worked. Haven't really tested it much beyond that.
Post Reply