ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
iv searched briefly on lq.org and afew other places, but couldnt find exactly my result.
if anyone knows of free software/APIs for reading information from a barcode reader to a computer? (any OS, or programming language.. preferably VB.net on windows NT-based system)
What's your barcode reader? Are you using a serial interface? If so, the reader should simply send serial signals into the computer, which should be ASCII characters. (I last did this under OS/2 2.1 in the mid-90's so forgive me if I'm outdated.)
Why would you want to use vb.net? At the very least please drop that POS "language" and go with C#. I remember being at TechEd '01 when Mr. Gates introduced VB.NET and I immediately thought it smelled like a dying skunk.
well i meant VS.net (SOME .net language, preferably vb, since the program im designing is only going to be used once on this specific machine, and vb.net is a (more) simple language so that will ease the process.
i think iv looked at c# once, so i dont want to use it. i know vb.net, java, c++, but would prefer vb.net for this project, so the GUI design is simple and quick
i dont even have a reader yet.. i was hoping to find some software first, then go from there. i wonder if that idea of just reading the serial port is still how it is done? i hope; sounds relatively easy.
if nothing else, i guess i can look for a reader that COMES with some libraries for getting its input.
i dont remember them off the top of my head but i know there are several opensource barcode reader projects. maybe you could start by getting some code and figuring out how to port it to .NET (blah) or whatever you decide to use...
Almost all the bar code readers I have seen plug into a PC keyboard interface: at the end of the cable from the reader are a socket for the keyboard and a plug to go into the PC. Whenever a bar code is scanned, the reader generates the same output as though the digits of the code were typed on the keyboard. Data from any keys pressed when the reader is not scanning a bar code just passes straight through.
So in Visual BASIC you're probably looking at using the INKEY$ function, which has been around since GW-BASIC .....
Code:
DO
DO
$I = INKEY$
LOOP UNTIL $I > ""
PRINT $I;
LOOP
There are also a minority of bar code readers that attach to RS232 or USB ports. The former are easy {if you know about working with files and devices} and the latter probably will come with Windows-only drivers if they don't just emulate e.g. a keyboard or RS232 interface. They have the "advantage" that it might be possible to tell what came from the reader and what came from the keyboard {though maybe not if the USB ones just emulate a USB keyboard}.
I worked at a place where they wanted to have a PC with a keyboard-inline bar code reader and not be able to "spoof" the bar codes by typing on the keyboard. {mathematical impossibility alert!} They ended up putting extra non-printing control characters fore and aft, but as I recall it was still very easy to defeat ..... fortunately, it relied on the stupidity of the users, which in general is unlimited.
Both systems exist, serial and keyboard style readers. As said, the output is usually the same as from a keyboard.
It's important to know about barcodes and the readers. There are several 'codes' and there are several specifications for spacing versus height.
Buy the wrong reader and you might not be able to read the barcode because it does not understand the code and/or because the resolution is not heigh enough.
The readers made by Welch Allyn and sold by Farnell or RS seemed to work with any bar codes we could chuck at them. UPC, EAN, Interleaved Two of Five, Three of Nine, the lot. And we did experiment with any bar code we could find! The only thing that could throw those readers off, was if you changed encodings partway through, which obviously is never going to happen in real life {just a stupid quirk of the label printers we were using}. But this was a testing lab and we liked breaking things
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.