Reading numbers from hand scanner or bar code reader in C# - c#

Can any body who did some work on related thing tell me how can I achieve this?
What I want to achieve is to read number (printing on my boxes) from scanner and put that number in database. The numbers can be product IDs. What I need to know
From where to start
What is type of hand scanner can i choose for this
can i read these numbers by c# too adn what classes supports this?
any tutorial available?

As extensively explained here: https://stackoverflow.com/questions/613881/how-to-read-a-value-from-a-barcode-reader a barcode reader/scanner (either parallel, serial or USB connected) is normally seen as a keyboard from the computer, this happens at the device driver level, you have nothing to do about that in your C# code.
In fact you should also support manual entry of the code ( alpha-numeric ), like the cashier does in the supermarket when you took an item with unreadable (by the scanner) barcode.
in your C# application have a textbox where the user can type the code using the keyboard and when focus is on that textbox and the user scans a code with the reader you won't notice any difference between the input coming from the normal keyboard or the reader... no differences except that in some cases the barcode reader will also include a CR ( ENTER ) at the end of the code and you can use that to initiate your next action, like database operation etc.
I think you can actually configure if you want the CR to be sent to you after each read or not, somewhere in the driver settings of the device, it might depend on the specific device.

What i know is most of new scanners comes with a library or SDK in different programming languages so before you buy ask about one with support library, and if it doesn't come with one i think you can use the SerialPort component in windows forms.
This example might help you Using Barcode Reader In C Sharp

Related

Extract gps data storage

I am using dotSpatial labrary in c#, I only can read realtime data.
but my problem is this.. how could I extract gps data storaged in my usb-gps device (it is passive gps)?
device information
brand : landairsea
Model: Gps Tracking Key
webPage: http://www.landairsea.com/gps-tracker/gps-tracking-key
From looking at their user guide:
http://www.landairsea.com/downloads/past-track-10.pdf
You could use the past-track software to save the stored data as .las format.
I believe that DotSpatial has a LIDAR plug-in that can read .las files:
Dotspatial.Plugins.LiDAR
If you are asking how to write a C# replacement for the Past-Track program that connects directly to the USB however, I don't know exactly.
DotSpatial has a positioning library that is DotSpatial.Positioning that was originally ported from http://geoframework.codeplex.com/. It is possible that this utility will have the capability to connect to your device, but I think it would probably only support a limited subset of GPS devices, and I never used it myself at all.
Hopefully that information is a little helpful though and will point you in the right direction.
Edit:
I have downloaded the Past-Track 10 software that is designed to retrieve data from the unit. This in turn installed Antaris4 and u-blox5 USB drivers. I think this is half of what you will need to write a C# app that can talk to your GPS and do things in code. You can find the drivers on the web. I think I found it here:
http://www.driverguide.com/driver/detail.php?driverid=1869444
But make sure you find a version of the driver that matches your PC configuration (32/64 and correct operating system). Incidentally, that will probably mean you will need to make x86 and x64 builds for your C# app.
The next step is to find some documentation for it and then attempt to use the drivers from C#. So far I haven't found a good document showing how to work with the drivers, but I'm sure it exits. I will update with a link when I find it.

How to obtain a serial number of scanner with TWAIN?

I would like to obtain the serial number of a scanner in C# using twain_32.dll.
I've found out it has to be done with dscap method with the icap_serialnumber capability.
Can anyone give me an example how to do this?
You have confirmed that your scanner driver supports this capability? I find it in the TWAIN spec as CAP_SERIALNUMBER (0x1024). And it is optional - you cannot assume that a scanner supports it.
If you get TWRC_FAILURE when you try to GET that capability, check the condition code. Your library or component should provide a way to get the condition code after the GET. A value of TWCC_CAPUNSUPPORTED would mean that the scanner driver does not support that capability. Other condition codes are described in the TWAIN specification, although sometimes a little imagination is needed to guess what the driver is trying to say...
The TWAIN Working Group forum is maybe a little better place for this kind of question.

I will create a program Check stock with barcode, What do I need to learn

i will create a program check stock with barcode and database
what do i need to learn
What language should I use to development. And Should I use a database where.
c/c++, java, Visual C# not experience but pretty
spec
check in, check out and check amount in stock
Thank
sorry for grammar
Any of those languages will work. Most Barcode scanners are serial (RS-232), so you need to have the ability to connect through your language. I would suggest C# on a windows platform because the .NET platform has a well-defined serial port. Also, GUIs are pretty easy to implement.
As far as a database, you could start with a simple text database. This is basically a file where each line is an item. Make your interface to this clear, so if you need a full database later, you can easily switch them out.
Good luck

Reading from USB device and sending queries to it, in C#

I've read this: https://stackoverflow.com/questions/1176053/, which was an insightful article.
However, I have no great background in WMI, and I found the large amount of documentation to be overwhelming. I can't find what I'm looking for.
The situation is that I have a device that will send data over the USB port, to the soundcard of the PC in question.
Consider camera-software. You connect your camera, start the program, and you can control the program with the camera, and vica versa. For instance, you can press a button on the camera and it'll start transmitting to the program. Or you can click a button in the program and it will start querying for data.
I need to find a way to query and catch this data, safely and correct.
It's probably a Stream of bytes, but searching for that doesn't produce any results.
I'm thinking I first need to somehow connect.
Then send the query.
Then receive.
However, connecting and querying both is something that I can't find in the example code, or the System.Management documentation on MSDN.
I don't think that WMI code would be relevant for you, I think that's just able to get out basic information about the device. If you want to actually read and send data to it you'll have to use different APIs.
When I've done any USB develoment it's been mostly using HID which is fairly straightforward, but I don't think you can transfer audio streams using HID, you'll need to use the Audio class driver. Though you might need to use HID to find out information about the soundcard.
Some useful links to get you started are:
Jan Axelson's website (author of USB Complete) - http://janaxelson.com/usbc.htm
A USB HID Component for C# - http://www.codeproject.com/KB/cs/USB_HID.aspx?msg=2004501
A USB library for .Net - http://www.icsharpcode.net/OpenSource/SharpUSBLib/
A Java sample for a webcam app - http://www.mutong.com/fischer/java/usbcam/
Here is another great one for reading and writing to USB devices:
http://winusbnet.codeplex.com/

Question on Speech Recognition classes in .NET

Is it possible to have an application built using the .NET speech recognition classes and pass in a WAV file for it to go through and create a text representation of it. For example, this what I'm trying to do:
We have a QA department at my office and they have to listen to hundreds of calls a day which is quite impossible, and there's not enough people listening to everything to keep up. What I want to do is have the audio file uploaded to our server and have the server parse it and create a transcript of it. It doesn't matter if it's not perfect, but just a base which would be easier to skim through a couple of dozen lines of text than listen to a 2 hour recording.
Based on a saved transcript I can implement full-text search in the database and also run checks against the transcript if someone is saying something that's a misrepresentation.
So, is it possible to create an application using the .NET speech recognition classes and just pass the WAV file to it and it spit out a rough transcript?
I've dug around MSDN on the Speech classes briefly while thinking up the idea, so I don't have that much knowledge if it's possible to be done.
If possible, I would appreciate any examples in C#. Topic 1055347 is similar to the question I'm having, and was provided links, the most specific of which is in C++. I'm not a C++ developer, nor have I ever went to school for programming, I'm all self though C#, so I would like to stay in the language that I know.
Thanks in advance!
This sounds like you've got a call center type of application. Microsoft Speech Server has a SR engine optimized for telephony (8000 Hz sample rate), which will generate much better recognitions than the desktop SR engine. However, the engine isn't really designed for transcription (although it can do it), and the transcriptions definitely need to be reviewed before further processing occurs. Microsoft Exchange Unified Communications uses the SR engine to generate transcripts of voice mail, and while it's better than nothing, it often generates amusing nonsense.
With areas like speech recognition you are likely to either find a stand alone EXE or an API in c/c++.
For the links in the other topic, you can use a tool like P Interop Assistant to generate C# code. The C# code acts like a wrapper around the unmanaged dll, so you can call it from c#.
This is likely to be the best way to get the functionality you are looking for.
Yes.
I did such an application a few years ago on the Tablet PC; you can read about it at http://web.archive.org/web/20060615192119/www.devx.com/TabletPC/Article/30761 (At the time, I spoke of using Interop to access the libraries, but I believe that the programming model has remained the same, just with a managed wrapper.)
At the time, the results were very poor, but maybe for your use-case better than nothing.
How about route the calls to Google Voice? I'm sure there are similar services. I have been amazed at its accuracy so far, plus you can click and listen to it if required. Google Voice will forward voice calls to SMS or email.
UPDATE: On reread, maybe since you are recording calls it won't work as I yous the voice message left.

Categories