reading data from serial connection
- From: "Neraj " <nobd21@xxxxxxxxx>
- Date: Thu, 31 Jul 2008 17:11:01 +0000 (UTC)
Hi, I attempting to read data through a serial connection
from a device. I have no trouble doing so. However, when I
try doing more than just read, I encounter difficulties. It
seems as though I am losing bytes if I try, for example,
plotting the data as I receive it (using drawnow). Within
about 3 or 4 seconds, I lose some bytes and my packets are
corrupted. If I do not plot anything, it seems to work fine
for however long I desire to read the data.
Also, originally I had structured my code with several
functions (6 to be exact) that called on another as the
packet was being read and parsed, and eventually graphed. In
that structure, my packet would corrupt even sooner (within
90 seconds). Then matlab gave me thousands of lines of
errors, all of them pointing to the function calls. I think
what's happening is that matlab is slowing down too much and
it eventually can't keep up with reading the data and
extracting its information all at once. I removed all my
functions (made them all while, if, else statements) and I
acheived much better results, but I still have this issue.
Any advice? I was thinking about multithreading, but I guess
that's not really an option with matlab. At least, not with
my version (R2006a).
Thanks
.
- Follow-Ups:
- reading data from serial connection
- From: Donn Shull
- reading data from serial connection
- Prev by Date: Re: Ellipse Detection with matlab function
- Next by Date: Re: Draining Tank Problem
- Previous by thread: Re: Ellipse Detection with matlab function
- Next by thread: reading data from serial connection
- Index(es):
Relevant Pages
|