Click here to Skip to main content
Click here to Skip to main content

VBScan barcode software

By , 23 Jun 2004
 

Introduction

VBScan is a simple program to scan, decode and draw a barcode. It uses only .NET Framework and Windows API functions, no third party products.

It is designed to work with a "barcode wand" scanner that is connected to the com port (RS232) of a PC. Since most barcode wands have TTL voltages you'll need a converter chip to connect the wand to the PC.

After pressing the start button the program periodically checks the DSR line of the RS232. If a transition between black and white is detected it stores how many ticks the last bar was wide. After scanning and pressing stop the scanned barcode get "cleaned", so that we have no incorrect bars. If you now press decode the barcode will be decoded (only Code 3 of 9 supported at the moment) and the datastring is shown in a textbox.

Background

I wrote this program as a project in school. It was designed to work, and nothing more. I'm not a programming professional, so the code is sometimes a bit ugly.

Using the code

I have written 3 classes: Barcode, Code39 and HighSpeedTimer

The Barcode class stores the scanned data in a simple integer array. The class also provides some functions to clean and draw the barcode.

The Code39 class provides functions to decode an barcode object. It only supports "Code 3 of 9" barcodes, but it wouldn't be a problem to implement other encoding variants too.

The HighSpeedTimer class is a wrapper around the windows API functions to time more exact than the normal timer. I had to do this because the resolution of the standard timer is not high enough to scan barcodes exactly. This is probably the most ugly part in my program. If you start the timer, it uses a high amount of processor power, despite the fact that it does actually nothing... If you can help me improve this class i would appreciate it.

In the download file you'll find all the classes mentioned above and a small program (see the screenshot) to test them.

Note: In the frmMain there is a Paint event of the picturebox to redraw the barcode. It works, but uses much CPU time...

History

  • 04-06-23: v0.9.1635 - first posted version

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

About the Author

demm

Austria Austria
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionGeneration Guide for QR Code Generator in VB.NET Pinmemberblueskysinger4-Mar-12 23:15 
QR Code Generators – There are a number of sites for generating QR codes and they’re all free. An Internet search for QR code generator will offer many choices. eg. http://www.keepautomation.com/vbnet_barcode/qrcode.html- You can use it to create QR codes that link to a web page, text, phone numbers, or SMS.
GeneralMy vote of 5 Pinmembermanoj kumar choubey23-Feb-12 19:27 
Nice article
QuestionQR barcode generator Pinmembersteve7g12-Jan-12 16:03 
I have generate some barcode with help of tutorial files online, and will this be OK to generate an EAN-128 code?
http://www.keepautomation.com

GeneralBarcode reader project PinmemberHanumanthappa.H28-Jan-11 4:36 
sir i have study the barcode reader project please send the source code of Barcode reader
Generaloffline Barcode verification System(URJENT) PinmemberMember 321186330-Apr-09 20:39 
Hi!
 
you needs to create a offline Barcode verification System which will verify the barcodes from the given images. The images will be stored in an imagebank in the hard disk. More focus will be in simulating the system through a good user friendly GUI interface. The system should have the following features:
 
1. Grab the image from the imagebank.
2. Teach the system with good image of the barcode with simple image processing like thresholding operation, etc.
3. Store the parameters in the database.
4. Retrive the parameters from the database before inspection.
5. Inspect the barcode images and verify the barcodes value.
6. Give the accepted / rejected signal and show the result on the display.
 
Demo barcode libraries from net can be used for this purpose.

You can use C/C++/VC++ or VB to complete this assignment.
 
Roshan Rajesh
INDIA
Generalhelp Pinmemberlakshmi priya.t.n29-Jan-09 17:39 
Hi,
 
i'm planning to do a project name library management system in which i hav to use barcodes . . . . .
i have to generate barcodes for student details and also for the bookdetails...
i'm new to this area of barcodes.can anyone pls tell me which type of barcode to use,which will be suitable and simple for this application...
i live in india..
 
pls help me..
Questionhow to connect barcode machine with .net projects Pinmemberhiran53612-Jul-08 2:33 
hi
 
we are developing a project in .net for a garment company. How to connect barcode printer in .NET . when a barcode is scaned it should be displayed in bill. plz help me out how to do this.
GeneralHelp Please Urgent Pinmemberbadenmaher6925-Feb-08 6:12 
hey anyone im in need of help how do you know the start and stop bits for the scan
QuestionBarcode help Pinmemberbadenmaher6913-Feb-08 9:52 
is there any chance you could send me more info on the connections schematic or something please
Thanks
badenmaher@hotmail.com
GeneralBar Code Reader PinmemberVeera Raghavan6-Sep-07 4:21 
I am Raghavan from coimbatore,TN.
Please send me the BARCODE READER (or) SCANNER in VB with ACCESS.
I dnt know how to encode the IP and OP the database to the system via
Barcode Reader.
Please guide me at JUSTMAILRAGHAVAN@GMAIL.COM

GeneralRe: Bar Code Reader Pinmemberblueskysinger4-Mar-12 22:38 
Generalusing barcode Pinmemberjotapz30-Jul-07 16:57 
hi!! im doing now a daily time record using barcode my problem is that i dont have any background information about barcode can i have some????????
 

 
thanks ....
GeneralGEnerating Barcode Pinmemberabhijit.dalvi294-May-07 1:22 
I want to develop a application .In which Header TExt, Address, Start Number and End Number and Sheet Size-eg. A4 paper size; are the input.
Based on above data and Barcode standerd Code39, i hav to generate Barcodes for given range of numbers.
There is a wizard provided in CorlDraw.
hw to access tht wizard using vb.net.
Please reply.
Thanking you.
 
abhijit.dalvi29@gmail.com
Questionbarcode printing Pinmembertsalim3-May-07 23:52 
Greetings.......
 
I have problem in prinitng the barcode from vb.net. in vb 6.0 I used the following method to print.
 
Open "LPT1:" for output as #1
Print #1, "barcode printer commands"
Print #1, "barcode printer commands"
Print #1, "barcode printer commands"
Close #1
 
but it doesn't work in vb.net, because we can't open the port directly from vb.net.
 
can u help me........? please.......
 
salim

 
tsalim

AnswerRe: barcode printing Pinmembermanojhdwr@gmail.com14-Oct-11 22:42 
AnswerRe: barcode printing Pinmembermanojhdwr@gmail.com14-Oct-11 22:42 
AnswerRe: barcode printing Pinmemberblueskysinger4-Mar-12 23:13 
GeneralAutomated DTR attendance using Barcode scanner Pinmemberhardguy2-Oct-06 21:33 
anyone can help me? pls send me a time attnedance with visual basic language code using barcode scanner at lustrac@yahoo.com thanks..
 
Chris
GeneralRe: how to deploy the vb.net usercontrol in aspx page Pinmembermadduri_2812-Sep-06 20:14 
hai,
 
can any body help me regarding the usage of usercontrol which is designed in vb.net forms and fail to deploy the usercontrol in aspx page since it is not highlighting on toolbox
 
regards
sekharbandhuSmile | :)
GeneralBarcode font Code 128 Pinmemberangelagke31-Jul-06 18:39 
Can i use this VBScan barcode software to scan or read the sample barcode font Code 128?
 
Thanks
 
angela
Generaldata scanning through barcode scanners Pinmemberbehzad nasim31-Mar-06 2:15 
help me please! to read data from bar code scanners through a vb form
GeneralRe: data scanning through barcode scanners Pinmembermanojhdwr@gmail.com14-Oct-11 22:45 
Generalhelp me, please! Pinmember4aaaa10-Mar-06 16:13 
I have barcode of machine is TR550 of PROMAX proceduce and connect to computer by COM gate, but i don't know anyway to connect with computer ,please show me the way detaily, (i have vb.net for this project),if you have source code is you give me,please. thank you very much.
- My email: quoc20042002@yahoo.com
 

 
4aaaa
GeneralRe: help me, please! Pinmemberhungpvtn23-Apr-06 1:26 
QuestionNeed Help ? Pinmember| Muhammad Waqas Butt |14-Jan-06 22:11 
Hi nice artical. Can you provide this demo coding in C#.Net?
 
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
GeneralRs232.vb Pinmembertoniolol16-Jun-05 4:41 
Is it correct : Pariti_Odd
line 39
why not Parity_Odd ?
thxs
GeneralRe: Rs232.vb Pinmemberhungpvtn23-Apr-06 1:27 
Generali need to generate barcode in windows application Pinmembersangeeta singh16-May-05 1:31 
is anybody is there who can tell me how to generat barcode?
 

sangeeta
Generalsome one know change port to ps/2 or usb Pinmembermalilla_man11-Apr-05 12:15 
some one know's how change this code to work in ps/2 or usb barcode scanner
GeneralRe: some one know change port to ps/2 or usb PinmemberSumathyKC20-Sep-06 3:32 
QuestionRe: some one know change port to ps/2 or usb Pinmemberericming21-Aug-07 1:56 
Questionproblem reading barcodes ? PinmemberM.ARAFA15-Nov-04 23:51 
Dear all ,
 
The VBScan application doesn't read any barcodes format...
what's the problem ?
 
the result when i read any barcode "No barcode scanned " and i select the appropriate com port .
 
thanks ,
 

 
Moustafa M.Arafa
Solution Developer,DotNet Trainer.
MCT,MCSD.Net,MCAD.Net,MCP

QuestionCode39 Quetsion ? PinmemberM.ARAFA11-Nov-04 14:10 
Hi ,
 
i have anew barcode reader,when i test code39 images,it doesnt work.?
 
Is this demo working on code39 with the start/stop characters (*) or not ?
 
Moustafa M.Arafa
Solution Developer,DotNet Trainer.
MCT,MCSD.Net,MCAD.Net,MCP

QuestionA Question on using Demo ? PinmemberM.ARAFA10-Nov-04 14:22 
Hi ,
i want to send an image of code 39,because the demo doesn't work on any printed image with code 39 ,to test that my barcode scanner working properly.

 
Moustafa M.Arafa
Solution Developer,DotNet Trainer.
MCT,MCSD.Net,MCAD.Net,MCP

Generaltransformed to asp.net Pinmembertommy skaue29-Jun-04 2:07 
I should know the answer to this, but is it easy to transfer this to asp.net to generate and show barcodes on a website?
 
third-parties want their share of $$$ if you wanna print a single barcode ona website Wink | ;)
 
------------------------------------------
Hey! Stop reading my signature... stop it!
hmm... you're still reading it...
GeneralRe: transformed to asp.net PinmemberSocolongo29-Jun-04 2:56 
GeneralRe: transformed to asp.net PinmemberGraeme Howell30-Jun-04 15:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130619.1 | Last Updated 24 Jun 2004
Article Copyright 2004 by demm
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid