comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Non-blocking read
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Non-blocking read [message #75617] Wed, 16 March 2011 08:35
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
In case others are wondering, the correct name of the routine is FILE_POLL_INPUT (not FILE_POLL_UNIT as I wrote), and the TIMEOUT value is a keyword not a parameter. --Wayne
Re: Non-blocking read [message #75619 is a reply to message #75617] Wed, 16 March 2011 07:33 Go to previous message
David Grier is currently offline  David Grier
Messages: 35
Registered: July 2010
Member
On 3/15/11 9:49 PM, wlandsman wrote:
> On Tuesday, March 15, 2011 8:22:38 PM UTC-4, David Grier wrote:
>
>> I'm using OPENW, WRITEU and READU to interact with a piece of equipment
>> through a serial port. Everything's fine unless there's an error
>> condition on the read. If the read fails, then the IDL session hangs
>> irretrievably. I'd like to use a non-blocking read so that failure
>> yields no value and some error condition that I can check.
>
> Would it help to use
> if FILE_POLL_UNIT( unit, 0) then readu,...
>
> My IDL session hangs about 1 in a 1000 times when trying to read an internet socket.
> I've tried using the above code snippet, but I don't know yet if it works, because
> I the failures occur so unpredictably. (And once the IDL session does hang, one
> loses any diagnostics.) -Wayne

Brilliant! I never would have found this routine, and it does just what
I need.

Many thanks Wayne.

David
Re: Non-blocking read [message #75622 is a reply to message #75619] Tue, 15 March 2011 18:49 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Tuesday, March 15, 2011 8:22:38 PM UTC-4, David Grier wrote:

> I'm using OPENW, WRITEU and READU to interact with a piece of equipment
> through a serial port. Everything's fine unless there's an error
> condition on the read. If the read fails, then the IDL session hangs
> irretrievably. I'd like to use a non-blocking read so that failure
> yields no value and some error condition that I can check.

Would it help to use
if FILE_POLL_UNIT( unit, 0) then readu,...

My IDL session hangs about 1 in a 1000 times when trying to read an internet socket. I've tried using the above code snippet, but I don't know yet if it works, because I the failures occur so unpredictably. (And once the IDL session does hang, one loses any diagnostics.) -Wayne
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: sky is falling, again ?
Next Topic: Atmospheric trajectories

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:16:07 PDT 2025

Total time taken to generate the page: 0.00428 seconds