Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Serial Exception


  • Please log in to reply
1 reply to this topic

#1 jimbo57

jimbo57

    New Member

  • Members
  • Pip
  • 1 posts

Posted 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
 


#2 Spiked

Spiked

    Advanced Member

  • Members
  • PipPipPip
  • 129 posts

Posted 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 topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.