Click here to Skip to main content
6,596,602 members and growing! (20,327 online)
Email Password   helpLost your password?
Languages » VB.NET » Applications     Intermediate License: The GNU General Public License (GPL)

VBScan barcode software

By demm

A barcode scanning and decoding software without third-party software
VB, Windows, .NET 1.0, .NET 1.1VS.NET2003, Dev
Posted:23 Jun 2004
Views:182,595
Bookmarked:133 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
26 votes for this article.
Popularity: 5.40 Rating: 3.82 out of 5
1 vote, 3.8%
1
1 vote, 3.8%
2
3 votes, 11.5%
3
5 votes, 19.2%
4
16 votes, 61.5%
5

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 (GPL)

About the Author

demm


Member

Location: Austria Austria

Other popular VB.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 28 (Total in Forum: 28) (Refresh)FirstPrevNext
Generaloffline Barcode verification System(URJENT) PinmemberMember 321186321:39 30 Apr '09  
Generalhelp Pinmemberlakshmi priya.t.n18:39 29 Jan '09  
Generalhow to connect barcode machine with .net projects Pinmemberhiran5363:33 12 Jul '08  
GeneralHelp Please Urgent Pinmemberbadenmaher697:12 25 Feb '08  
QuestionBarcode help Pinmemberbadenmaher6910:52 13 Feb '08  
GeneralBar Code Reader PinmemberVeera Raghavan5:21 6 Sep '07  
Generalusing barcode Pinmemberjotapz17:57 30 Jul '07  
GeneralGEnerating Barcode Pinmemberabhijit.dalvi292:22 4 May '07  
Questionbarcode printing Pinmembertsalim0:52 4 May '07  
GeneralAutomated DTR attendance using Barcode scanner Pinmemberhardguy22:33 2 Oct '06  
GeneralRe: how to deploy the vb.net usercontrol in aspx page Pinmembermadduri_2821:14 12 Sep '06  
GeneralBarcode font Code 128 Pinmemberangelagke19:39 31 Jul '06  
Generaldata scanning through barcode scanners Pinmemberbehzad nasim3:15 31 Mar '06  
Generalhelp me, please! Pinmember4aaaa17:13 10 Mar '06  
GeneralRe: help me, please! Pinmemberhungpvtn2:26 23 Apr '06  
QuestionNeed Help ? Pinmember| Muhammad Waqas Butt |23:11 14 Jan '06  
GeneralRs232.vb Pinmembertoniolol5:41 16 Jun '05  
GeneralRe: Rs232.vb Pinmemberhungpvtn2:27 23 Apr '06  
Generali need to generate barcode in windows application Pinmembersangeeta singh2:31 16 May '05  
Generalsome one know change port to ps/2 or usb Pinmembermalilla_man13:15 11 Apr '05  
GeneralRe: some one know change port to ps/2 or usb PinmemberSumathyKC4:32 20 Sep '06  
QuestionRe: some one know change port to ps/2 or usb Pinmemberericming2:56 21 Aug '07  
Generalproblem reading barcodes ? PinmemberM.ARAFA0:51 16 Nov '04  
GeneralCode39 Quetsion ? PinmemberM.ARAFA15:10 11 Nov '04  
GeneralA Question on using Demo ? PinmemberM.ARAFA15:22 10 Nov '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 23 Jun 2004
Editor: Nishant Sivakumar
Copyright 2004 by demm
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project