Re: How to call an IDL procedure from a DLM [message #47708 is a reply to message #47706] |
Thu, 23 February 2006 08:47   |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
On Thu, 23 Feb 2006 08:26:54 -0500, Haje Korth wrote:
> Maurizio,
> What you are trying to do is an interesting concecpt, but I don't think DLMs
> are intended to work this way. At least I have never run across an example
> for such use. Isn't the whole purpose of DLMs, call_external, etc. to call
> code that is specifically NOT implemeneted in IDL? Why would you bother
> writing a DLM if the functionality is already present in IDL?
I'm thinking that he is doing part of his DLM processing in C, and then
gets to a point where it would be Really Nice to call an IDL routine to
finish it up because the IDL routine is at-hand and might be a pain to
translate into C or whatever.
It should be possible to refactor the code though to do some things in C
and then return the intermediate results to IDL, where he can then call
the IDL code. I can't speculate further without knowing more about the
problem.
> My guess is that you probably have to go out and find an external C or
> FORTRAN library that does what you want, e.g. Numerical Recipes. RSI manuals
> often specify the source of their external algorithms. Or, if the algortihm
> is written in IDL, you can just translate it.
>
> This may just be well above my head, so maybe Karl has some input on
> this. If this should really work, I would be interested in seeing an
> example. I would be afraid that each of these calls need to start an
> independent IDL session, thus leading to significant slowdown.
You are on the right track. It isn't so much starting a new session, but
rather reentering the interpreter that is causing the problem.
I think redesigning the DLM as hinted above is the best approach. One way
to "call IDL" from a DLM would be to spawn a new IDL process. But that
would involve passing data back and forth via files or pipes/sockets and I
think that's going to be more involved than refactoring the DLM.
Karl
>
> Cheers,
> Haje
>
> "Maurizio Tomasi" <tomasi@lambrate.inaf.it> wrote in message
> news:dthqki$eh1$1@muffin.area.ba.cnr.it...
>> Last week I posted a request for help, since my DLM produced a number
>> of "Stopped on unknown instruction" errors. After some debugging, I
>> found that the problem resides in IDL_ExecuteStr, which is not usable
>> in DLMs since it has been meant to be used only with Callable IDL.
>>
>> However, I still need to call an IDL procedure from my DLM. I looked
>> for a IDL_CallProc function, but I have had no success. Does somebody
>> know if there is a way to do this?
>>
>> Thank you very much,
>> Maurizio Tomasi.
|
|
|