Sections
You are here: Home Forum .NET C# UsbPacket.Open() not working

UsbPacket.Open() not working

Up to .NET C#

UsbPacket.Open() not working

Posted by Josh de Leeuw at April 22. 2007
I'm having trouble getting UsbPacket to open. I'm using C#. I get a message in the debugger that information about the containing class is not available. The demos seem to run ok, though sometimes they fail. Is it possible that if the program exits during debug before closing the port that the system will need a restart to recover the use of the port? Also, is a call to Open necessary, since it is missing in the example code? Thanks.

UsbPacket.Open() not working

Posted by William Richards at December 27. 2007
I am having this problem as well but with Vista. last I checked my program was working just fine with XP but I can not get my program to work with vista. Even mctest does not work under vista. Mchelper however, is working just fine under vista. Will

UsbPacket.Open() not working

Posted by Aaron Tunell at December 27. 2007
have you tried communicating over ethernet? I had serious headaches with C# till i switched over to ethernet. There's something wrong with comm over USB in C#.

UsbPacket.Open() not working

Posted by William Richards at December 28. 2007
Like I said I have no problems under XP using USB. Just with Vista.

UsbPacket.Open() not working

Posted by William Richards at December 28. 2007
Ok I just confirmed it, my code will open the USB port under XP but NOT Vista. So I figure that that is a bug. for XP you do have to make sure that you loaded mchelper and that the dll from MCtest is referenced in you project. Now the question remains for jodeleeuw are you using XP, Vista or linux? if its Vista sorry I can't help but if it is XP well here is a sample of my code that does it... ============================================================= using System; using MakingThings; namespace RoboCon3 { class RoboCon3 { static void Main(string[] args) { UsbPacket usbPacket; Osc osc; OscMessage oscM; String mcCommand; usbPacket = new UsbPacket(); usbPacket.Open(); osc = null; osc = new Osc(usbPacket); while(usbPacket.IsOpen()) { // Button A has just been pressed. mcCommand = "/digitalout/7/value 1"; oscM = Osc.StringToOscMessage(mcCommand); osc.Send(oscM); Console.WriteLine("Button A is pressed"); // and insert your other commands here... }

UsbPacket.Open() not working

Posted by William Richards at December 30. 2007
Well I attempted to communicate with the MC via VISTA and UDP last night to no avail. Perhaps I have incorrectly installed the device on Vista but then why is the MC helper still working under Vista. is there a different API for Vista that for XP? Hmmm.........

UsbPacket.Open() not working

Posted by Liam Staskawicz at December 30. 2007
There shouldn't be too much to install for the Ethernet side of things. Are you sure you've gotten all your network configuration in your C# code set up properly? Have you done any loopback/localhost tests just to confirm the .NET UDP stuff works as expected? We don't have a separate API for Vista.

Re: UsbPacket.Open() not working

Posted by Jason Osborne at April 10. 2008

Ran into the same problem with the C# tutorial. I was able to get MC working over ethernet with the examples but was wondering if anyone had found a fix for this as its important the USB works for my project.


I did discover the same issue. XP works and Vista doesn't. Is this an issue with the way .Net works with Vista? Maybe the OSC code?

Re: UsbPacket.Open() not working

Posted by Vincent Parmentier at November 18. 2008

Hello,

I just wrote an article in the "Bugs, Known Issues, & Requests" forum about this problem and its workaround.

 

Best regards.

 

Vincent.

Powered by Ploneboard
Document Actions