469,331 Members | 5,644 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

USB ?

Hey
I have some device connected to USB is there any simple way to communicate
with that port ? Any free libraries / open source library or something like
this ? I saw System.IO.Ports can now communicate with COM ports. Is there
something like this for USB ?
Jarod

Feb 5 '06 #1
7 8548
Hi,

this is not possible. for USB communication you have to have a kernel mode
device driver for the USB device.
Is it a device that you made yourself? if not then you either need the
device driver, or the USB protocol specification for the device so that you
or someone else can make a device driver.

There are some chips available (from TI or FTDI for example) that can be
used for making USB devices appear as virtual COM ports, but that is only
useful if you make the devices yourself. they will not help you communicate
with an existing device.

If your device has a device driver but no api, you can invoke win32
functions createfile, writefile, readfile and deviceiocontrol to communicate
with the driver. you still need the driver interface documentation in that
case.

kind regards,
Bruno.
"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
Hey
I have some device connected to USB is there any simple way to communicate
with that port ? Any free libraries / open source library or something
like this ? I saw System.IO.Ports can now communicate with COM ports. Is
there something like this for USB ?
Jarod

Feb 5 '06 #2
Jarod,
Take a look at the SharpUSBLib project here:

http://www.icsharpcode.net/opensource/sharpusblib/

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jarod" wrote:
Hey
I have some device connected to USB is there any simple way to communicate
with that port ? Any free libraries / open source library or something like
this ? I saw System.IO.Ports can now communicate with COM ports. Is there
something like this for USB ?
Jarod

Feb 5 '06 #3
> There are some chips available (from TI or FTDI for example) that can be
used for making USB devices appear as virtual COM ports, but that is only
useful if you make the devices yourself. they will not help you
communicate with an existing device.


I will use FTDI and device is made by myself ;)
Jarod

Feb 5 '06 #4
We use FTDI in my company.
The chips come with 2 types of driver between which you can choose:
- a virtual COM port driver. this exposes your device as a COM port.
- an interface driver with dll. this allows you to communicate directly with
your device without needing a virtual COM port. you can easily invoke the
dll functions from C#.

kind regards,
Bruno.
"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
There are some chips available (from TI or FTDI for example) that can be
used for making USB devices appear as virtual COM ports, but that is only
useful if you make the devices yourself. they will not help you
communicate with an existing device.


I will use FTDI and device is made by myself ;)
Jarod

Feb 6 '06 #5
You might find #usblib useful.
http://www.icsharpcode.com/OpenSource/SharpUSBLib/

-Alex

Feb 6 '06 #6
> The chips come with 2 types of driver between which you can choose:
- a virtual COM port driver. this exposes your device as a COM port.
- an interface driver with dll. this allows you to communicate directly
with your device without needing a virtual COM port. you can easily invoke
the dll functions from C#.


Could you email me with C# lib that packs this ivokes ? Because there is
some invokaction code needed to marshal C++ data on C# data and that's
usually hard for me ;) So if you have such library and can share please
email me ;)
Jarod

Feb 6 '06 #7
Hello Jarod,

"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
The chips come with 2 types of driver between which you can choose:
- a virtual COM port driver. this exposes your device as a COM port.
- an interface driver with dll. this allows you to communicate directly
with your device without needing a virtual COM port. you can easily
invoke the dll functions from C#.


Could you email me with C# lib that packs this ivokes ? Because there is
some invokaction code needed to marshal C++ data on C# data and that's
usually hard for me ;) So if you have such library and can share please
email me ;)
Jarod


I would if I could, but I can't, so I won't ;)
The reason being that we don't have such a library.
We use the FTDI dll in LabVIEW (graphical programming language: www.ni.com),
where we have to do something similar, but in LabVIEW code instead of C#.

however, the FTDI website has some examples that you might find usefull:
http://www.ftdichip.com/Projects/Cod...les/CSharp.htm

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.