p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

pro_vb thread: Using a Scan Code Wand with VB


Message #1 by "Jim Jim" <matrix00002@h...> on Tue, 17 Apr 2001 16:20:44 -0400
> but what if I need the application to be able to read data that scanned 
in
> by some type of bar-code wand? I can program to respond to events from a
> mouse or keyboard, but how or where do you get info to program to react 
to
> events from a bar-code wand? 

Well, I use CommX port controls from Greenleaf Software (www.gleaf.com).  
Connect a barcode scanner to a serial port and drop one of these activeX 
port controls on a form.  I usually set up the communication parameters 
and open the port (with the open method) in the form_load routine.  Then 
you can write an event handler for the CommX control's IncommingData 
event.  In the IncomingData event, I retreive a byte at a time from the 
port control's buffer (ReadByte method) and then generally use a CHR() 
function to convert it to a readable character.  Notice I read a byte from 
the buffer - that is the only conversion necessary - from byte to 
character.

I use the same port controls for writing to serial label printers.  They 
cost about $200(US), but I think it is worth it.  By the way, I generally 
use Symbol barcode scanners.

Good Luck!
Chuck
BC Designs, LLC
www.bettercontent.net

  Return to Index