advertisement
from the serious department...
barcode scanning using VB6
Programming languages. topic
Posted by teao on 18 July, 2003 - 9:43 am
Is there anybody know how to make program using VB6 for barcode scanning?


Posted by rbelknap on 19 July, 2003 - 12:02 pm
There are really two ways that this can happen.

First, using a scanner with a keyboard interface. You just piggyback the kayboard and the scanner. When anything is scanned it will appear as though it was typed on the keyboard.

Second, using a scanner that has a serial interface. You can us the MSCOMM control in VB6 to monitor the port and you'll receive a string from the scanner.

This may seem like a simplistic view, but it really isn't that difficult.


good luck


Posted by bips_kr on 26 July, 2003 - 4:47 pm
how can i write into serial port buffer through VB6 using mscomm my code is

Private Sub Command1_Click()
On Error GoTo errHandler

'FOR WRITING
MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MSComm1.Output = "Hey its working" 'Text1.Text
MsgBox MSComm1.OutBufferCount
MSComm1.PortOpen = False

'FOR READING

MSComm1.CommPort = 2
MSComm1.Settings = "9600,N,8,1"
MSComm1.PortOpen = True
MsgBox MSComm1.InBufferCount
MSComm1.InputMode = comInputModeText
'Text1.Text = MSComm1.Input
MsgBox MSComm1.Input
MSComm1.PortOpen = False

errHandler:
If Err.Number <> 0 Then
MsgBox "Error No: " & Err.Number & ", Error Description: " & Err.Description
End If
End Sub

kindly help


Posted by Anonymous on 17 September, 2003 - 8:18 am
If I am using the keyboard connection for the scanner, what is the trigger event. It seems that the field is lock. Pls help me since it was too urgent to complete this project.

regards
VB beginner


Posted by asm on 27 July, 2004 - 11:01 pm
dear all, i want to ask you some question about barcode, i have barcode scanner denso BHT 7500S, how to make program for it?


Posted by RufusVS on 19 July, 2003 - 12:11 pm
What type of scanner are you using?

Presumably it is programmed via the serial port.

Didn't the vendor of the scanner provide source code for drivers? I would think VB would be the minimum sample app supplied.

At least a manual with communications protocols, I hope.

Rufus

Rufus V. Smith RufusVS@aol.com http://members.aol.com/rufusvs


Posted by David.Wooden on 19 July, 2003 - 12:14 pm
Hello Teao:

The easiest way (but not the only way) to write serial code in VB6 is to use the MSComm control; an ActiveX control that handles a lot of the serial drudgery for you. You will need the serial protocol for the specific barcode reader that you intend to use. If you can be more specific, we can be more helpful.

Best regards,

David Wooden Senior Software Engineer, Systems Integration Omron Electronics LLC
E-mail: david.wooden@omron.com


Posted by Sumathi Sampath Kumar on 6 August, 2003 - 12:22 pm
hi

We use Denso BHT 6000 barcode scanner. I have to write a program in visual basic 6.0 to download data from the scanner to the PC. There are some protocols specified in the manual. But, i dont know how to use it. I am trying with MSComm Control. Please help me.

Thanks
Sumathi


Posted by N. Bovigny on 19 July, 2003 - 12:08 pm
I t seams that TalTech are offering variouse Tools, DLLs, ActivX,...
Loock at www.taltech.com.

Regards.
N. Bovigny


Posted by PHickman on 20 July, 2003 - 12:00 pm
Another control that my company uses the the GreenLeaf CommX control (http://www.gleaf.com). This control is similar to the MSComm control except it can actual interrupt your program when something comes into the port. For example, you could have the control interrupt your VB6 app when a CR/LF comes into the port. That is all we used in our barcode reader application. The manual included with the barcode reader should tell you the command protocol used to enable the barcode reader.


Posted by Waiter on 15 August, 2003 - 7:33 pm
Normally, vb is event driven and PLC is sequence driven. Need to keep this in mind.

Your received seriel communication will trigger the "OnComm" event. i.e. "MSComm1_OnComm", this is were you put your code to read the input buffer and deal with it.

There are as many approaches as there are programmers. One methode I use is to set the buffer length to one. This will trigger an OnCommm event every time a character is received.

Private Sub MSComm_OnComm()
Dim Buffer As Variant


Posted by Anonymous on 25 September, 2003 - 7:20 am
Please help me to write a VB code to read a barcode data.



Posted by Aileen on 17 October, 2003 - 11:33 am
I need help on this too. Appreciate if someone could help. my barcode is of code 39. How do I display the scanned data onto the textbox? I need to create a program to store scanned in part number into the Access database. thanks in advanced.


Posted by Lawtons on 23 October, 2003 - 12:34 am
Get this book. It will tell you everything you need to know in about three pages. Also comes with a CD. Having this book will save a lot of time.

Amazon.com

Visual Basic Programmer's Guide to Serial Communications 3


Posted by entalvis on 10 November, 2003 - 10:38 pm
i'm using a scanner that piggy-backs on the keyboard, it scans in numbers from barcodes fine in everything except the vb app i made, do i need something special for it to go into my vb text box?


Posted by Gregorio Cavazos on 11 November, 2003 - 1:13 pm
Maybe the your current focus is your problem, you need to have the pointer (focus) in a textbox in order to read the barcode and write the code in the textbox on focus.

Gregorio Cavazos C.


Posted by Anbu on 20 November, 2003 - 12:18 pm
Hi All.

My Serial Bardcode Scanning Program using MSCOMM is working fine in Windows Local Com Ports.

How to use the Terminal Services Redirected Comm Ports TS002, TS003 etc.


Posted by Atul on 30 June, 2004 - 12:22 am
Hi,

I am getting a problem. prob is i want to get data to box text box. how can get this? will u help me? any body give the source code for this in visual basic?

atul


Posted by Jerry on 16 February, 2007 - 12:41 am
Did you ever learn how to do this?


Posted by Anonymous on 2 February, 2004 - 8:42 am
I created an app in use to scan our media, the code looks like this:

Private Sub txtInput_KeyPress(KeyCode As Integer)
If KeyCode = 13 Then 'Carriage Return
YourVariable = txtInput.Text
End If
End Sub

When using a keyboard attached scanner it is most likely a CR/LF is appended to the output. After the scan finishes all you need to do is deternmine the end of the string (carriage return) then read the textbox's text value. In the case of my program I created for my job, I use the scan to query the database.

Another way is to wait for the LostFocus event, this will usually occur after return is pressed.

Hope this helps.


Posted by Salman on 19 February, 2004 - 3:37 pm
Dear!!!

i read your mail but please tell me what can i do to run it. I have presently two scanners:
1. A flatbed scanner
2. A webcam

Thanks for your cooperation.

Looking for your reply.

Thanks and Regards,

Salman


Posted by Michael van den Berg on 27 April, 2004 - 3:20 pm
I am using a scanner to scroll a flexgrid based on its keypressed event. Now it seems the barcode reader returns the <Enter> key before returning the scanned text, any experience with that?

Thx in advance,

Michael van den Berg


Posted by Anonymous on 12 December, 2003 - 11:40 pm
Go to http://www.freevbcode.com you can find your program there.


Posted by Anonymous on 25 January, 2005 - 12:15 pm
I bet you guys didn't know you could scan barcodes with a normal pc scanner.


Posted by Anonymous on 18 June, 2005 - 11:04 am
When you say a normal pc scanner, do you mean a flatbed scanner? If so, how do I do that? Thanks...Rich


Posted by kay on 19 December, 2003 - 5:47 pm

Assume that you are using keyboard wedge interface barcode scanner,

<ol>
<li>Create a new vb project
<li>In Form1, add a text box control(text1.text)
<li>In keydown event of text1.text, type as below


Private Sub Text1_KeyDown( _
KeyCode As Integer,Shift As Integer)

select case keycode
case vbkeyreturn:
msgbox text1.text

end select

End Sub


<li>that's all.
</ol>

Good luck.

kay



Posted by sharpo on 7 January, 2004 - 11:42 am
I suggest you could use Moxa PComm Lite. You can download this program from
http://web2.moxa.com.tw/services/download/download.asp

Download the file and install it. You can find the VB example in the smae folder. Very easy.

sharpo


Posted by Anonymous on 10 March, 2004 - 5:38 pm
Is there anybody knows to prevent entries (input) from keyboard but data should be taken from Scanner. I want to block all possible entries (keyboard) such as numpad, other numerical keys and cut & paste method from other applications.


Posted by B. Anderson on 12 September, 2008 - 1:30 am
There is a VB6 tutorial for USB scanners at http://www.idautomation.com/scanenable/ and it is much easier than using com ports.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2010 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
Time flies like an arrow
Fruit flies like a banana
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive