I have a problem with a C# program. Through the Serial port i Receive a large string about 110 characters. This part works ok, but when i add code to split the string up i r
The exception is telling you that, at some point, Substring
is being given parameters that exceed the length of the string. Which likely means you aren't getting the data you are expecting from the serial port. Try inserting a breakpoint at the first call to Substring
and check the contents of data
to make sure the device you are reading from isn't sending some kind of error code or something other than what your code expects.