Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Failure to read serial port after ~5000 asynch reads
Date: Mon, 2 Mar 2009 17:23:01 +0000 (UTC)
Organization: Procter &#38; Gamble Co
Lines: 17
Message-ID: <goh4ll$fi3$1@fred.mathworks.com>
References: <gbub92$9sr$1@fred.mathworks.com> <gc0tco$6v3$1@fred.mathworks.com> <gc1479$or1$1@fred.mathworks.com> <gc3a48$bjs$1@fred.mathworks.com> <gc5lra$2en$1@fred.mathworks.com> <gh4fri$6vm$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236014581 15939 172.30.248.37 (2 Mar 2009 17:23:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 2 Mar 2009 17:23:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 69262
Xref: news.mathworks.com comp.soft-sys.matlab:521931


Dave (and Scott) -- I'm suffering a similar behavior where Matlab 2008a fails to read several serial ports after 5000 to 7000 reads of the serial port.  As you've reported, the only way to get the ports to start reading again is exit Matlab.  

In my case I'm using a timer object, but I've experienced the same problems putting the read/write commands to the serial port in a for loop as well. 

If you've found any work arounds or found certain tricks with your own code, I'd be appreciative of any insights.

Thanks,

Geoff

"David Atkinson" <djatkinson54@yahoo.co.uk> wrote in message <gh4fri$6vm$1@fred.mathworks.com>...
> Scott,
> 
> I have experienced the same serial port problem. I have a DSP board taking to the PC using Matlab serial port. My m-file contains a repeating while loop which includes a pause(0.1) to set repetition rate. After starting it appears to run perfectly for a few thousand loops then fails. The number of loops before failure is variable. As you found, the only way to fix is to restart Matlab.  I was originally using R2007b but found it does exactly the same with R2008b.  One observation in my case was that if I only transmit data from PC to the  DSP board then it doesn't fail. So the problem appears to be associated with data coming into Matlab.
> 
> Dave
>