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

Home » Public Forums » archive » Passing file LUN to C routine
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: Passing file LUN to C routine [message #35068 is a reply to message #34993] Wed, 07 May 2003 02:56 Go to previous messageGo to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
Ben Tupper wrote:

> Hello,
>
> I have IDL interfaced (via DLM in C) with a frame grabber for collecting
> video. I want to pass a file's LUN to C (repeatedly) so that the C
> routine can write the most recent frame to to the file. My idea is to
> place IDL in an interruptable loop (widget timer); in each iteration the
> C routine is passed the LUN, writes the image and then returns a flag
> such as the number of bytes written to IDL. Later I'll poke around with
> the images by using an ASSOCiated variable within IDL.
>
> It's a reasonable plan that is rapidly going amuck; what I have tried so
> far causes IDL to crash. I have been using the IDL_FileStat() function
> to get the required FILE pointer for C. The compiler doesn't C complain
> about the setup; but it kills IDL when I run it. Methinks
> IDL_FileStat isn't my friend anymore.
>
> So ...
>
> (1) How do I properly convert the LUN in IDL into a FILE pointer? (I
> guess the question maybe better phrased as how do I get IDL to give me
> the FILE pointer associated with the LUN I pass?) I think I need this
> because the C routine fwrite requires it.

I've never used IDL_FileStat, but I note in the docs it says you have to set
the IDL_F_STDIO flag or it returns a NULL pointer. This would certainly
crash your DLM.

>
> (2) Is this creating an unstable situation by leaving the file open all
> the time until some condition is met in IDL?
>
> (3) Would I be better off passing the filename to C and having C
> open-write-close for each iteration?
>

You could do that, but why not get your DLM open the file and pass back the
FILE pointer to IDL and then pass that on subsequent calls?

> Thanks,
> Ben

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: bug(s) in IDL5.6?
Next Topic: RFC 1: Common functions for beginners

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

Current Time: Sat Nov 29 15:30:05 PST 2025

Total time taken to generate the page: 0.01012 seconds