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

Home » Public Forums » archive » Re: Aynchronous IO and Widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Aynchronous IO and Widgets [message #5422 is a reply to message #5412] Thu, 21 December 1995 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <4b653h$58p@merkurius.lu.se>, Struan Gray <struan.gray@sljus.lu.se>
writes:
> I want to use IDL to control instruments in the lab but also want to avoid
> inflicting long waiting times on my users. I've read the manual and played
> with some simple widget building and recognise that IDL is not meant to be
> threaded, and in particular wants each routine to finish before starting the
> next one.
>
> The problem is I want to collect data from rather slow devices which
> buffer a few kB before sending it to the data-taking computer. I'm sure I
> could bodge something together using a seperate program and files on disk or
> ramdisk, but this would be slow and klunky on my platform and anyway I'd
> prefer to have something fully integrated.
>
> What I had in mind was to use a stub widget which would use CALL_EXTERNAL
> to call an asynchronous I/O routine written in C whose completion routine
> would then insert an event into the IDL event queue, telling the instrument
> control base widget that the data was ready to collect. The main program
> could get on with plotting and analysing earlier data until the transfer was
> complete.

I have not yet tried the stub widget method, inserting events into the IDL
event queue, although it is on my list of things to do. However, you can
emulate this behavior without too much trouble.

- Make one of your base widgets generate timer events to enter an IDL "polling"
routine. This routine polls the C code (via CALL_EXTERNAL) several times
per second to see if the device is ready. The C code need not actually poll
the device if asynchronous I/O is supported - it can simply maintain
a flag indicating that the device has asynchronously reported that data
are available.

- If there is data ready your timer event routine can read it directly, or it
can send an event to another IDL widget informing it that there is data
ready.

I have used this method for many projects of exactly the type you describe.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Anyone know about: esrg_idl.tar
Next Topic: Re: Q: Getting the position of the last character printed by xyouts

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

Current Time: Sat Oct 11 10:37:36 PDT 2025

Total time taken to generate the page: 0.16191 seconds