Hi everyone!
Basically, I have a program that is sending information from my Netduino Plus 2 over the serial port to a VS GUI. After a while, I'll get an exception or 2:
  | ||||||||||||||
Serial Exception
Started by jimbo57, Nov 28 2014 05:17 AM
1 reply to this topic
#1Posted 28 November 2014 - 05:17 AM Hi everyone!
Basically, I have a program that is sending information from my Netduino Plus 2 over the serial port to a VS GUI. After a while, I'll get an exception or 2:
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll
Additional information: Index and length must refer to a location within the string.
It highlights this portion of my code on my GUI side:
this.Invoke(d, new object[] { text });
I'd like to copy my entire code from both programs here but they are quite big. This happens after a few minutes of receiving packets at 112500 baud with no problems at all. Is it a buffer issue? Anyone else experience this?
-Jim
#2Posted 29 November 2014 - 08:39 AM I have never been real clear on the serial port thing with the Netduino. I had some discussion earlier, that probably explained it, but I was a total newb at the time, so I jumped to ethernet since it was the quickest way to get what I wanted working (MQTT type messaging).
I am led to believe that the USB serial port is used for deploying and debugging, and therefore you can not mix your serial traffic on that port if it is in use by visual studio. The proposed solution I believe was to use an FTDI serial cable attached to com2 on the Netduino, and tell visual studio to use that. Then USB com1 is freed up for your serial traffic.
Is this also your understanding, and how you went about it? I need to come back to this someday. As it is, when I need to demo something I usually just use an arduino because of this. http://www.spiked3.com/?p=1731 0 user(s) are reading this topic0 members, 0 guests, 0 anonymous users | ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||