PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio â†’ WINDEV 2024 â†’ Windev 20 with barcode scanner
Windev 20 with barcode scanner
Iniciado por guest, 17,sep. 2015 17:19 - 20 respuestas
Publicado el 17,septiembre 2015 - 17:19
Hello,

I just look for the possibilitys with windev and a barcode scanner. I want to print a barcode on a report wich i can scan with a scanner for the work hours registration and put the worked hours in a database.
Is there someone who has experience with something like this? Is it possible to do and what kind of scanner do i need?
Is it possible with this scanner; https://www.conrad.nl/nl/manhattan-barcodescanner-contact-178488-laser-zwart-usb-806696.html…

Thanks all!
Publicado el 17,septiembre 2015 - 17:39
I never used this one but in theory it's possible.
You can print bar codes with the same type used by the reader you propose.

The proposed reader works as one keyboard so when you scan the barcode it will put the value of the bar code in the current control.

Normally this kind of readers sends one TAB at the end if so you only need to check if that key was pressed and act accordingly.

http://doc.windev.com/en-US/…
Publicado el 17,septiembre 2015 - 19:30
Hey Sammy,

Barcode scanners are really easy to implement. As Paulo says, they just act as an input device like a keyboard. If you want to scan numbers with decimal elements, I've never tried to scan 123.45 for example.

Your suggested scanner will of course work, but if the scanner is just for your own "test-bed", then why spend so much?

Something like this will do just as well:
http://www.amazon.co.uk/COLEMETER%C2%AE-Barcode-Scanner-Handheld-Decoder/dp/B00K5NM6FO/ref=sr_1_5…

HTH...
Publicado el 18,septiembre 2015 - 15:36
Thanks for the response!

I have ordered a scanner so i wil try with it.
Publicado el 18,septiembre 2015 - 16:58
Great Sammy.
When it arrives plug it in, grab yourself something with a barcode on it, open something like notepad and "bleep"!
Publicado el 18,septiembre 2015 - 18:41
keep the manual that come with the scanner , you need to scan the bar code in the manual to change the scanner setting.
Publicado el 18,septiembre 2015 - 23:53
It's really piece of cake, most barcode readers emulate keyboard-input.
So al you have to do is to "catch" the data that comes from the reader into an Edit-control and proces the data.
Keep in mind that the barcod reader that you are going to buy is a CCD-reader, wich is less accurate for reading from a distance. But normally it will work fine

grtz

Patrick
Miembro registrado
102 mensajes
Publicado el 22,septiembre 2015 - 12:16
From my experience - mostly with Motorola mobile barcode scanners - you should be carefull with the expectation that each scan is automatically triggered as data entry with return. In my opinion this is not a 'build in' feature but more likely a software feature comming from a tool called 'Scan Wedge' or 'Data Wedge'.

Most of my customers in the industrial area don't rely on this tool. Instead they use the API offered by the manufacturer.

HTH
Sebastian

--
http://arnoldconsult.de
Publicado el 22,septiembre 2015 - 20:11
Using WinDev 19 to generate bar code enabled program for windows 8 tablet.

Bar code scanner connects via Blue Tooth as two RS232 ports. One port will be used for input and one port for output. You then use the WinDev COM port commands to capture the scans and feed to a designated procedure. In the procedure you update whatever you need. Tablet communicates with the host server computer via Wifi.

I much prefer this kind of connectivity to a a "keyboard wedge" because the user does not have to be positioned in a particular field. I handle that in my programming by tracking where they are in the process and feeding the data to the correct fields or via prefix characters in the bar code.

So yes bar coding works with WinDev.

Stewart Crisler
Publicado el 22,septiembre 2015 - 22:24
Hello Stewart,

Is this also possible with my USB reader? I also not prefer the use of a edit box.
Publicado el 22,septiembre 2015 - 22:40
according to the information on the Conrad website, you can use this scanner in RS-232 mode (virtual comport)
Programming the operational mode of the scanner is most of the time done by scanning special barcodes from the manual

grtz

Patrick
Publicado el 24,septiembre 2015 - 16:12
Hello all,

The scanner is not work in RS-232 mode, in the guide there are special codes to scan also for RS-232 mode.
Is there someone who has an example code?
Publicado el 24,septiembre 2015 - 16:53
Hi Sammy,

"example code" for what? I presume you purchased the barcode reader from your initial post?

Why are you using RS-232 mode when it's a USB scanner; it should just be P-n-P. Nothing to setup, nothing to change, doesn't need code (apart from handling the input value)... just P-n-P.

If I'm on the wrong track, why not let us know how you intend to use the scanner for? :spos:
Publicado el 24,septiembre 2015 - 17:12
Darren,

You are right, it`s a usb scanner and it is pnp. (keyboard wedge) But then i need Always a focus on a edit box.
It is for a time registration program, so different persons has to scan with it and it has to be very easy for them to use. (So don`t need anything else then the scanner)
Publicado el 24,septiembre 2015 - 17:36
Hi,

Yeah, I have the same requierment on an epos window using a "barcode" field. I use SetFocus and/or ReturnToCapture functions depending on requirements.

At a basic level, you need to do something like:
- in the initialisation of the window, set focus to the field that will contain the scanned value.
- when a value is input/scanned and focus "tries" to move away from the field, in the exit event of the field, do some processing like reading a record from the DB. In my system this is carried out in the exit event of the field because my scanner "presses return" for me automatically after a scan.
- still in the exit event, clear stuff down like variables and prepare for the next scan.
- still in the exit event, set focus back to the scanned field again.

...this way you never actually leave the scanned field.

My implementation is a little more complex because I allow the user to go off to do other "view only" things, but as soon as they've done what they need to do, I setfocus/returntocapture and take them straight back to the scan field again.
Publicado el 24,septiembre 2015 - 19:14
Returntocapture is your friend :-)

I do it in several programs, the edit-control that catches the results from the barcodescanner is invisible, and it works perfect

grtz

Patrick
Publicado el 24,septiembre 2015 - 19:24
We use it a lot in keyboard emulation mode but not for time registration.

In this case and if you want to prevent the user from using the keyboard to input the same number as the scanner you can check the time spent between keys, the scanner is a lot faster than the keyboard.
Publicado el 25,septiembre 2015 - 08:35
Hello,

Just put a edit control on your form (invisible or not), and in the description tab of the edit control (GUI tab), define which key combination is the shortcut of your edit control.

Example : many scanners will send by default a STX (Start of Text, ASCII value 2) before sending the actual barcorde, and send a return at the end of the barcode (but you can program your scanner with whatever prefix and suffix code you want)

In this case, set the shortcut for your edit control = CTRL+B (=STX)
When you scan a barcode, your barcode will be automaticly put in the edit control .
Put also a button on your form with shortcut=RETURN, this button will be invoked when all the barcode characters are in your edit control. In the keypress event of the button you put your code the process the barcode.

regards,
Bart
Publicado el 25,septiembre 2015 - 09:59
Thanks Bart!

The STX function works great for me.
Publicado el 25,septiembre 2015 - 10:53
Is the code in the keypress event the correct place?

My code is in the exit event as I don't need to monitor each keypress and it slows the input down slightly. My code is in the exit event as I only need to process the full barcode value.

Also, one lesson I learnt... make sure the history of field entries is turned OFF as this drastically slows down input especially when using barcode scanning :eek:
Publicado el 25,septiembre 2015 - 11:20
Hi

My mistake. Put your code for processing your barcode in the click event of a button. Set the shortcut of your button = the suffix sent by your scanner

Bart