Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / Visual Basic
Article

VBScan barcode software

Rate me:
Please Sign up or sign in to vote.
4.02/5 (33 votes)
23 Jun 2004GPL32 min read 334.7K   12.3K   190   35
A barcode scanning and decoding software without third-party software

Image 1

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.

Image 2

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)


Written By
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHow to use? Pin
Member 117295091-Jun-15 17:52
Member 117295091-Jun-15 17:52 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey23-Feb-12 19:27
professionalManoj Kumar Choubey23-Feb-12 19:27 
GeneralBarcode reader project Pin
Hanumanthappa.H28-Jan-11 4:36
Hanumanthappa.H28-Jan-11 4:36 
Generaloffline Barcode verification System(URJENT) Pin
Member 321186330-Apr-09 20:39
Member 321186330-Apr-09 20:39 
Generalhelp Pin
lakshmi priya.t.n29-Jan-09 17:39
lakshmi priya.t.n29-Jan-09 17:39 
Questionhow to connect barcode machine with .net projects Pin
hiran53612-Jul-08 2:33
hiran53612-Jul-08 2:33 
GeneralHelp Please Urgent Pin
badenmaher6925-Feb-08 6:12
badenmaher6925-Feb-08 6:12 
QuestionBarcode help Pin
badenmaher6913-Feb-08 9:52
badenmaher6913-Feb-08 9:52 
GeneralBar Code Reader Pin
Veera Raghavan6-Sep-07 4:21
Veera Raghavan6-Sep-07 4:21 
GeneralMessage Closed Pin
4-Mar-12 22:38
blueskysinger4-Mar-12 22:38 
Generalusing barcode Pin
jotapz30-Jul-07 16:57
jotapz30-Jul-07 16:57 
GeneralGEnerating Barcode Pin
abhijit.dalvi294-May-07 1:22
abhijit.dalvi294-May-07 1:22 
Questionbarcode printing Pin
tsalim3-May-07 23:52
tsalim3-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 Pin
manojhdwr@gmail.com14-Oct-11 22:42
manojhdwr@gmail.com14-Oct-11 22:42 
AnswerRe: barcode printing Pin
manojhdwr@gmail.com14-Oct-11 22:42
manojhdwr@gmail.com14-Oct-11 22:42 
AnswerMessage Closed Pin
4-Mar-12 23:13
blueskysinger4-Mar-12 23:13 
GeneralAutomated DTR attendance using Barcode scanner Pin
hardguy2-Oct-06 21:33
hardguy2-Oct-06 21:33 
GeneralRe: how to deploy the vb.net usercontrol in aspx page Pin
Madduri Rahul Rajasekhar12-Sep-06 20:14
Madduri Rahul Rajasekhar12-Sep-06 20:14 
GeneralBarcode font Code 128 Pin
angelagke31-Jul-06 18:39
angelagke31-Jul-06 18:39 
Generaldata scanning through barcode scanners Pin
behzad nasim31-Mar-06 2:15
behzad nasim31-Mar-06 2:15 
GeneralRe: data scanning through barcode scanners Pin
manojhdwr@gmail.com14-Oct-11 22:45
manojhdwr@gmail.com14-Oct-11 22:45 
Generalhelp me, please! Pin
4aaaa10-Mar-06 16:13
4aaaa10-Mar-06 16:13 
GeneralRe: help me, please! Pin
hungpvtn23-Apr-06 1:26
hungpvtn23-Apr-06 1:26 
QuestionNeed Help ? Pin
| Muhammad Waqas Butt |14-Jan-06 22:11
professional| Muhammad Waqas Butt |14-Jan-06 22:11 
GeneralRs232.vb Pin
toniolol16-Jun-05 4:41
toniolol16-Jun-05 4:41 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.