Simple USB access, but a Significant Dilemma

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone please give me some information on sending data through a USB
port. What I am trying to do is use the USB port (I get how to do it on a COM
port). I am using VC# 2005. I have searched the internet repeatedly but
cannot find anything.

Overall, what I am trying to do is just activate a LED with a transistor via
a progam made in C# by hooking up the the BASE pin of the transistor to the
DATA+ pin on the USB cable and then powering the circuit with the cable.
Sorry if this is a horrible description... Then, theoretically, send data
through the data line to flip the transistor on. (btw: this is just an
experiment). I comprehend the electrical. Knowing this I could do more
complex projects, but not knowing how to turn on an led light on with basic
USB would pose to quite a dilemma.

Mainly, I just want to know how to use USB.

Thanks a lot for any assistance!

-freeskier89
 
c#freeskier89 said:
Can someone please give me some information on sending data through a USB
port. What I am trying to do is use the USB port (I get how to do it on a
COM
port). I am using VC# 2005. I have searched the internet repeatedly but
cannot find anything.

Overall, what I am trying to do is just activate a LED with a transistor
via
a progam made in C# by hooking up the the BASE pin of the transistor to
the
DATA+ pin on the USB cable and then powering the circuit with the cable.
Sorry if this is a horrible description... Then, theoretically, send data
through the data line to flip the transistor on. (btw: this is just an
experiment). I comprehend the electrical. Knowing this I could do more
complex projects, but not knowing how to turn on an led light on with
basic
USB would pose to quite a dilemma.

Mainly, I just want to know how to use USB.

Thanks a lot for any assistance!

-freeskier89

You need a driver for this hmmm.. 'device', you can't directly access USB
devices from user mode applications. Note that you can't write drivers using
C#.

Willy.
 
You need a driver for this hmmm.. 'device', you can't directly access USB
devices from user mode applications. Note that you can't write drivers
using C#.

Willy.

Why not? I thought you could do anything with .Net that you could with any
other language?


Now I want to go and figure out a way to write one, even though I have no
applicable uses for one atm.

Mythran
 
Well for this I guess I'll just use the com port, for complex driver writing
seems to be needed for usb applications. Usb integration would be nice, but
for now I think I will just learn more C# and that should lead me closer to
an answer. I just assumed that access to a USB port would have been simple,
but I guess not! Thank you for the replies by the way!
-freeskier89
 
Mythran said:
Why not? I thought you could do anything with .Net that you could with
any other language?


Now I want to go and figure out a way to write one, even though I have no
applicable uses for one atm.

Mythran

..NET is not a language, C# is a language, and NO you can't use C# for
anything other than normal user mode applications. Drivers, be it user mode
or kernel mode must be written in C possibly mixed with assembly. Even C++
(the language - not the compiler) can't be used for kernel mode device
drivers.
The reason for this is not the language per se, it's most because of the
runtime, you don't wan't to load the CLR in kernel space do you?
Other things that can't be done in C# (or any other pure managed language)
is build DLL's that export function to be loaded dynamically (through
LoadLibrary(Ex)) from non managed code, examples are MMC snap-ins, ISAPI
filters, cluster extentions, etc.....

Willy.
 
.NET is not a language, C# is a language, and NO you can't use C# for
anything other than normal user mode applications. Drivers, be it user
mode or kernel mode must be written in C possibly mixed with assembly.
Even C++ (the language - not the compiler) can't be used for kernel mode
device drivers.
The reason for this is not the language per se, it's most because of the
runtime, you don't wan't to load the CLR in kernel space do you?
Other things that can't be done in C# (or any other pure managed language)
is build DLL's that export function to be loaded dynamically (through
LoadLibrary(Ex)) from non managed code, examples are MMC snap-ins, ISAPI
filters, cluster extentions, etc.....

Willy.

Yeah yeah, I know that .Net is not the language. Oh well, bah! Thanks :)

Mythran
 
Back
Top