Jump to content

Keyboard Input Function problems


Recommended Posts

I am seeing a problem with a USB POSX Barcode scanner. This device works as a keyboard wedge - sending characters from the barcode scanner into the Windows Keyboard buffer message system. Firstly, I DO NOT WANT a keyfocused string control on the diagram, that's a pretty poor and brute for implementation - and not desireable for my application.

I created a 'background' keystroke/barcode scanner detection using the LabVIEW Input Device routines - accessing the keyboard. I too am seeing the LV keyboard function return missing or duplicate charaters from the barcode scanner. Opening Notepad or Word - properly captures the barcode scan with no dups or missing chars. It would be nearly impossible to filter dup chars - as some barcode actually have repeated chars.

Setting a delay in the keyboard input polling loop seems to improve the problem (I am NOT USING THE EVENT STRUCTURE) - but it does not go away. Also, this is not an effect cure - as loop poll timing is effected by CPU loading, other apps running,etc.

:headbang: I am going to chalk this up to a bug in the LabVIEW keyboard routines - as it should not return duplicate or drop characters. It would appear this function is not doing any housekeeping - it appears to be destroying unread chars in its buffer, or rereading chars in its buffer it already read.

I don't know why the function written this way would be useful or desireable for any application. :thumbdown:

Link to comment

hmmm ... i do not agree a key focus is a brute force method, i think yours is to complicaed ;-)

to your problem, i guess your keyboard routine is getting in trouble with the windows event handler, which handles keyboard events (i assume you are using windows). You dont have direct access to the hardware since Win95 .... Following my theory, a solution would be to turn of the windows keyboard event handler, which will require some knowledge in the windows API for the period you are waiting for the scanner input ...

maybe this helps ?

cheers

CB

Link to comment
hmmm ... i do not agree a key focus is a brute force method, i think yours is to complicaed ;-)

to your problem, i guess your keyboard routine is getting in trouble with the windows event handler, which handles keyboard events (i assume you are using windows). You dont have direct access to the hardware since Win95 .... Following my theory, a solution would be to turn of the windows keyboard event handler, which will require some knowledge in the windows API for the period you are waiting for the scanner input ...

maybe this helps ?

cheers

CB

5179[/snapback]

I agree too with this. Opening a dialog with a string control set to have the keyfocus is a very universal way. The user can have a barcode scanner attached through a keyboard wedge and just use that (configure the barcode scanner to append a carriage return to each barcode send and then check for that to autodismiss the dialog) or if there is no barcode scanner present for whatever reason he can type in the ID over his keyboard and press the OK button to close the dialog

If you really need to do background barcode scanner input this is usually done through a serial port barcode scanner (or with the new USB scanners through a driver which installs as serial port driver instead of plugging into the system keyboard queue). These barcode scanners are typically a little more expensive as they are not sold in the same numbers.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.