Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Barcode Scanner string conversion

Posted on 2010-11-10
4
Medium Priority
?
766 Views
Last Modified: 2013-12-27
We are developing an application that needs a barcode reader (any make and model) to read SUPPLIERS barcodes, and then look up a corresponding COMPANY STOCK CODE in a lookup table and input this into the running application as a string - i.e. as if the barcode read was the looked-up string.

THis will involve

1. intercepting the barcode read
2. processing it,
3. injecting the result into the keyboard buffer.

2 and 3 are easy, but 1 isn't.  Is there anything out there to do this?

I can't believe this is the first question on this, but I cannot find any previous posts: but it is difficult to search for....

0
Comment
Question by:jonathonberg
4 Comments
 
LVL 3

Expert Comment

by:roynaufal
ID: 34102911
Hello,

I am not totally sure I understand what you mean, so can you please explain and give a bit more details on step 1 ?
0
 
LVL 1

Expert Comment

by:Sindread
ID: 34102913
This should be very simple.
When you scan with the barcode reader it will input the barcode as if it were text to the pc.
for example if you had notepad open it would display the code.

For the processing aspect would be dependant on how you want to program this in whatever language.
you could do a simple vb app. where you focus on text box scan with barcodereader which would push the value into the textbox and have corresponding event for when a value is entered to look up company ccode in DB or flat file table.
0
 
LVL 2

Author Comment

by:jonathonberg
ID: 34103050
Ok - I need to provide more detail:  The application we are scanning into is Sage 50 accounts.  We are scanning in barcodes on items to make up an invoice on trade counters.  This program is "closed" and will not allow modification.  

We need to read the supplier barcode, use a utility to convert this code into a valid stock code using a lookup table and enter that stock code as if it had been keyed.  So if the barcode was "123" we might want to trasnlate this to "XYZ" input into the Sage 50 application.

We are happy and competant to write a memory-resident .Net utuility to perofrm the lookup and to push the final result into the keyboard buffer - my question is how do we intercept the barcode read and stop it going into the keyboard buffer?

P.S. The customer wants a USB or keyboard wedge scanner gun plugge dinto a PC, not a terminal or ODA (we know we could do it that way)

Thank you.
0
 
LVL 25

Accepted Solution

by:
kode99 earned 2000 total points
ID: 34118396
Many barcode scanners can be programmed to do some formatting on the data scanned.  This usually includes things like adding a prefix and suffix to the scan.  You would need to check the manual for any scanner you want to use for the details.

With this you just need to intercept keystrokes to Sage.  You do nothing until the prefix character shows up then you trap and buffer the characters until the suffix shows up.  Then do your lookup and inject the keystrokes for your translated code into Sage.  The keystrokes from the scanner are coming fast so as long as your lookup is fast it will be seamless to the user.

By the sound of it you probably have the skills available for hooking events but if not here's a easy way to get it done,

http://www.codeproject.com/KB/winsdk/messagespy.aspx

Reference on hooking in .net,

http://msdn.microsoft.com/en-us/magazine/cc188966.aspx

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Simple Linear Regression
Six Sigma Control Plans

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question