Barcode scanner
Posted
#1
(In Topic #813)
Administrator

I'm currently trying to figure out how to make an application to scan barcodes.
I have a USB barcode scanner to scan the barcodes.
I have been searching this forum and other places (like wiki) to figure out how to get this done but nothing was really helpful.
I presume I need to use SerialPort to get this done but I get stuck at something simple as:
Code (gambas)
- BarCodeScanner.PortName = ????
How do I know the portname, I have no idea.
It would also be nice to have some sample code that I can study to get a grasp on how this works.
It is probably something simple I am completely overlooking…
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru

I have written barcode reading programs, but I have always used a USB reader, which is seen by the computer as a keyboard. Once the gun has read the code, it sends the text to the keyboard with a newline on the end.
Do you have no option but to use one with a serial port?
Posted
Regular

…something similar to:gbWilly said
Code (gambas)
BarCodeScanner.PortName = ????
How do I know the portname, I have no idea.
"<COLOR color="#BF0000">/dev/ttyACM0</COLOR>"
or
"<COLOR color="#BF0000">/dev/ttyUSB1</COLOR>"
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

This is just from memory but hopefully will give you an idea to work from. Make sure the TextBox has focus so it will receive keyboard input.
Posted
Administrator

Hi Cogier,cogier said
Hi gbWilly, long time no hear!
I have written barcode reading programs, but I have always used a USB reader, which is seen by the computer as a keyboard. Once the gun has read the code, it sends the text to the keyboard with a newline on the end.
I am using a USB reader and reading your and the other comments I understand that it is more simple than I could imagine.
The Universal Serial Bus made me think I needed SerialPort for some reason, that's where I went wrong. :?
Luckily, no need to use SerialPort. It is all so much simpler than I imagined.
If I get it right it's just getting the focus on a TextBox, scan with USB scanner and the barcode should be in the TextBox.
So I guess it's playtime
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Administrator

Diverod said
I used to just monitor a TextBox for keyboard entry, something like this:This is just from memory but hopefully will give you an idea to work from. Make sure the TextBox has focus so it will receive keyboard input.
Thanks Diverod,
You remembered correctly, your code works as a charm.
It is so simple if you know where to look…
Thanks
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
1 guest and 0 members have just viewed this.

