Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read a bar code into VFPRO ? 3

Status
Not open for further replies.

venado

Programmer
Nov 28, 2000
35
CA
Using VFP, how can I create a file with the information read with a bar code reader?

Does anyone has any suggestion?

Thansk,
Carlos
 
With most PC-compatible bar code readers I've used, they mimic keyboard input. Therefore, if the user was positioned in the UPC field and they scanned the item, the resulting code would be automatically entered in the UPC field (or whatever the current field is).
Robert Bradley
 
If you attach a barcode reader to your computer and scan a barcode. It is the same as typing it in from the keyboard. You can build your application by typing it in from the keyboard and then attach the barcode reader and substitute barcode reading for typing in from keyboard.


Don
dond@csrinc.com

 
Hi all
I tried what you said about simulating the key board input using VB6.0 VF6.0 VF7.0Beta and no way in hill it works. Not a surprise for me caz if it worked I would feel so dumm when I have to send my serial communication class to the trash can. Well my friend Venado here how it works...
Assuming that the bar code scanner you wanna use is connecting to one of the serial ports ( This is important ) and this the case 99%. Make sure that you understand that the according to the bar code you want to read, your return value either numbers only (Code 128 or I2o5) or mix of numbers and characters (Code 39). So your job is to get this return value from the scanner as string, save it in variable, then do what ever you want with it just like any string variable. Enough introduction let's go to work
Select Tools->Options->Controls and set reference to Microsoft Communication Control Version 6.0. This ActiveX control will handle all the communication between your App and the serial ports. put it in your form from the ActiveX tool bar.

In the Init event of this control insert this command
Code:
 this.PortOpen = .t.
*-- The most important property of this control is InputLen
which is the number of characters in your bar code. you can set it in the design time or programmatically in the run time but make sure you set it.

*--
Code:
 CommPort=X
set this property to the port you connected you barcode scanner to. 1 or 2 for example.
*--
Code:
 Name = BarCodeScaner &&-- for example
*--
Code:
Visible=.F.
Add a text box to your from name txtBarCode.
Now put a command butoon in your from and in the click event of it insert this command
Code:
lcBarCode=thisform.barcodescaner.input()
txtBarCode.Value= lcBarCode
Now, run your from, scan your bar code first, click the command button, your bar code is there in the text box.
I will leave the rest to your imagination, like replace the command button with timer to pool the barcode scanner for input every x sec, or trim the return string if it has any special chars.
Hope I answered your Q.
Have fun
Walid
 
It works in hill fine if you're scanner is a wedge type that hooks in with your keyboard. In my experience it's exactly as FoxDev, BlindEyePeteCantSeeOutOfTheOther :) and Dondas said.[tt]

PC/Keyboard Port
|
| <-- Wedgey :eek:
/ / kb scanner[/tt] John Durbin
john@johndurbin.com
MCP Visual FoxPro
ICQ VFP ActiveList #73897253
 
As far as I know, this type of barcode scanners can be found in any ancient Egyptian museum, I believe Khofo used them during building the great pyramid.
They don't support any kind of barcode reading technology standards what so ever
If you want to use them, be my guest(and their victim). If you want to follow the nowadays industry standards, I told you how.
 
Granted, Napoleon used one of these &quot;wedge&quot; type scanners in several battles, but they most certainly do support various encoding standards such as Code39. Many of them may not have oPOS drivers, but that doesn't prevent them from being useful.
Robert Bradley
 
I have a tools shop that's used a Metrologic for years with no problem. It reads all sorts of codes. I'm no expert though but I kinda like shtuff simple. It's almost true plug 'n play. There were only a few settings I changed on it. I never played with the expensive Laser scanners. John Durbin
john@johndurbin.com
MCP Visual FoxPro
ICQ VFP ActiveList #73897253
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top