USB ?

J

Jarod

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
 
B

Bruno van Dooren

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.
 
J

Jarod

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
 
B

Bruno van Dooren

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.
 
J

Jarod

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
 
B

Bruno van Dooren

Hello Jarod,

Jarod said:
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/CodeExamples/CSharp.htm

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top