[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Talking with my C data



In article <364B0D74.A8A16470@astro.wesleyan.edu>,
  eric@astro.wesleyan.edu wrote:
> Howdy,
>
> I would like to write IDL code to manage the taking and displaying of
> the data. Should I use call_external or linkimage? Is there a speed
> difference or just a level of complexity difference?
> I've got to believe this is done frequently and I will continue to look
> through the RSI documentation and David Fanning's great book, but at
> this point I haven't figured it all out.
>
> Thanks for any help.
>
> Eric
>

Hi Eric and All,	I have been working with CALL_EXTERNAL successfully
for two or so months now. One thing that should be emphasized, that I missed
initally, was that  when you re-compile your C-programs, it is necessary to
exit IDL. This is real annoying when trying to debug, but seems to speed
things up once the program works.  Also a debugging help is to have an
independent C program for testing the C program, and then write another C
program with the proper IDL connections.  This way one knows where the
problem is.

	I have no problems reading data files and displaying them.  But I am
currently having real problems with a data file that is being written by a
C-program called with CALL_EXTERNAL.  I've got an independent C program which
runs fine, but when I run it in IDL, something doesn't work.  I haven't
written the newsgroup about it because I have trouble describing what is
going on, as it sometimes works, and sometimes doesn't.  There is no
information being exchanged with IDL, so it is not a parameter passing
problem.  (Please see past newsgroup discussion if you want to hear about
those problems) I have two data files with data.  One set has data written as
an array of bytes and the other written with an array of integers.  The one
with the integers does not get corrupted, but the one with the bytes does. 
It seems like the file is being overwritten somehow but not all the data is
being erased when it is opened (fopen()).  My independent C program is
calling the same write module, so I think that it is not a C error.	  I'm
going to try to write the byte file as integer and see if that does anything.
 Maybe linkimage is a solution but I'm just not ready for it yet. Maybe
someone else has seen this problem.   Any other questions, or sample code
(not beautiful but functional), I'll gladly post on the newsgroup. 
Especially the passing of parameters and filenames, I think I can help.

Rose



-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own