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: Thu, 2 Oct 2008 20:15:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 40
Message-ID: <gc3a48$bjs$1@fred.mathworks.com>
References: <gbub92$9sr$1@fred.mathworks.com> <gc0tco$6v3$1@fred.mathworks.com> <gc1479$or1$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 1222978504 11900 172.30.248.37 (2 Oct 2008 20:15:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 2 Oct 2008 20:15:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869596
Xref: news.mathworks.com comp.soft-sys.matlab:493373


"Scott Burnside" <no@spam.com> wrote in message <gc1479$or1$1@fred.mathworks.com>...
> "Trent Jarvi" <tjarvi?hox.?%wrote in message <gc0tco$6v3$1@fred.mathworks.com>...
> > 
> > "Scott Burnside" <no@spam.com> wrote in message 
> > news:gbub92$9sr$1@fred.mathworks.com...
> > > Running R2007a on WinXP with Instrument Control Toolbox 2.4.2 I am 
> > > encountering serial port read failures after approx. 5000 read operations 
> > > connected to a TrueTime XL-DC GPS Time and Frequency Reciever.
> > >
> > > I've used continuous asynchronous, manual asynchronous (with readasync). 
> > > I've tried flow control. All methods manifest the same problem, there is 
> > > no output after about 5000 reads. It looks like Matlab's interface to the 
> > > UART driver is locking up. Serialbreak doesn't work.
> > >
> > > Nothing short of closing MATLAB and starting a new instance will clear 
> > > this up.
> > >
> > > Is this a known problem with 2007a? I find hints of this in the support 
> > > literature but I would like to be more certain before I spend the money to 
> > > upgrade.
> > >
> > 
> > Hi Scott
> > 
> > AFIAK, this is not a known problem in 2007a.  It may be a manifestation of 
> > something else.   Do you have minimal example code that can reproduced the 
> > problem?
> > 
> 
> Trent thanks for replying. I've gotten a trial version of 2008a and am testing with that overnight. Right away it started out by droping every other read operation so its clear I had to much going on in the loop between reads and the 2007a serial interface was trying to cope unsucsessfully. The 2008a serial interface seems more robust but I won't know for sure until I see this run overnight.
> 
> If I continue to have problems I will post some representative code. Thanks again for your help.
> 
> Scott

Ok this is worked for about 10-hours total now using R2008a. The thing is that I'm not sure if it 2008a that fixed that problem or the fact that I trimmed alot of the bloated code in the read loop. I guess I should go back and test against R2007a again just to be sure. I'll post back with that result. 

The program reads Agilent N9020a Spectrum Analyzer marker peak search frequency and amplitutde at 10 samples-per-second over Ethernet. The data are time tagged with UTC 1-pulse-per-second time stamps taken over the serial port from a TruTime XL-DC GPS/Rubidium Time Standard. The intersecond tics are derived from the internal high resolution counter. I'm using a mex file for that (hat.mexw32 from the FEX). The resulting timestamps are accurate to within 2 ms of absolute UTC time. I'll likely post this code to the FEX after some refinement and much more testing.

Scott