I have developed a software for managing the details of patients, the software stores the data into MSsql database.... However, the data I need to get stored has to be read from an external device which transmits data... Now my query is how I can read that data using VB.NET 2010.
I have searched on net and found that I can use My.Computer.Port to read data from USB connected device, but I am unable to get its logic and any example to get this practically done...
I also been through many books to understand the practical way of doing this, but not yet resolved with anything.....
If somebody can help me with an example so that i get a way forward to accomplish my task....
-
Do you already have drivers ect for this device? Is it as simple as just reading a file off a USB memory stick?pingoo– pingoo2012年02月15日 16:17:00 +00:00Commented Feb 15, 2012 at 16:17
-
1What interface does the device implement? You have a couple of standard interfaces for USB: USB Keyboards, USB drives, USB Serial... If the device communicates using one of these, you are in luck and there probably is a standard interface. If the device does not implement these, you will have to resort to writing your own driver or interfacing with the vendor-supplied driver. Your best bet is to ask the vendor if there is an API available; what you are trying to do is not as easy as "reading the USB port". Look at the Device Manager. How is the USB device reported? Special drivers?parasietje– parasietje2012年02月28日 09:49:24 +00:00Commented Feb 28, 2012 at 9:49
-
Hello @parasietje My device connects using the serial port Com port... And the device does not require driver, its sending some packets of data.Django Anonymous– Django Anonymous2012年02月28日 10:39:12 +00:00Commented Feb 28, 2012 at 10:39
-
1See lvr.com/serial_ports_dotnet.htmparasietje– parasietje2012年02月28日 15:05:11 +00:00Commented Feb 28, 2012 at 15:05
-
What you want to read from it is just a bunch of zeros and ones? Without a driver to translate it, this data will make absolutely no sense. What's the device you are using? Using a Com port is not the same as using a USB port, are you aware of that?Ian Medeiros– Ian Medeiros2012年02月28日 17:41:44 +00:00Commented Feb 28, 2012 at 17:41
3 Answers 3
Here is what I found. You use the HID.dll to interface the usb ports. And you know the best part? I found some examples.
Here's a link that contains basic examples and tutorial for usb interfacing. The HID Page
4 Comments
You loop those : IO.DriveInfo.GetDrives() and check where DeviceType = IO.DriveType.Removable then the device name to use it copying data or other stuff
for details check this out : Detect USB drive
Comments
Abhilash (I only asked this question)
I am adding this, Just to let you people know, my current understanding about the topic...
I actually asked for the question from one of my know person....
He explained me this:-
There are basically two ways to get data from an external instrument. The fist method is to use the software than came with the instrument. If the instrument has an interface of any type, there should be some software that reads the data. You can use this software to store the data to a file and your application will read a file with s fixed structure. very simple.
If the instrument provides a serial port but no software, then you can use the My.Computer.Port namespace to access the instrument's serial port. It's easy to send commands to a serial port and read back the response, but you have to know the commands that the other end recognizes. You will need detailed documentation about the device, which you will most likely find on the Internet.
The first approach is always preferrable. Of course, you have to associate the data with patients. This can be tricky. If you can find the software that allows you to download data from the instrument to your computer, it will be straightforward to acquire the data. Since someone must connect the device to a computer, they can also start the application and save the data to a file.
4 Comments
Explore related questions
See similar questions with these tags.