IDL supports a number of different techniques for communicating with the operating system and programs written in other languages. These methods are described, in brief, below.
The simplest (but most limited) way to access programs external to IDL is to use the SPAWN procedure. Calling SPAWN spawns a child process that executes a specified command. The output from SPAWN can be captured in an IDL string variable. In addition, IDL can communicate with a child process through a bi-directional pipe using SPAWN. More information about SPAWN can be found in Using SPAWN and Pipes or in the reference documentation for SPAWN.
IDL also supports the inclusion of Java objects within IDL applications by encapsulating the object or control in an IDL object. Full access to the Java object is available in this manner, allowing you to incorporate features not available in IDL into IDL programs. For more information, see Overview Of Using Java Objects.
UNIX Remote Procedure Calls (RPCs)
UNIX platforms can use Remote Procedure Calls (RPCs) to facilitate communication between IDL and other programs. IDL is run as an RPC server and your own program is run as a client. IDL’s RPC functionality is documented in Remote Procedure Calls.
IDL’s CALL_EXTERNAL function loads and calls routines contained in shareable object libraries. IDL and the called routine share the same memory and data space. CALL_EXTERNAL is much easier to use than either system routines (LINKIMAGE, DLMs) or Callable IDL and is often the best (and simplest) way to communicate with other programs. CALL_EXTERNAL is also supported on all IDL platforms.
While many of the topics in this book can enhance your understanding of CALL_EXTERNAL, specific documentation and examples can be found in The CALL_EXTERNAL Function and the reference documentation for CALL_EXTERNAL.
IDL System Routine (LINKIMAGE, DLMs)
It is possible to write system routines for IDL using a compiled language such as C. Such routines are written to have the standard IDL calling interface, and are dynamically linked, as with CALL_EXTERNAL. They are more difficult to write, but more flexible and powerful. System routines provide access to variables and other objects inside of IDL.
IDL is packaged in a shareable form that allows other programs to call IDL as a subroutine. This shareable portion of IDL can be linked into your own programs. This use of IDL is referred to as Callable IDL to distinguish it from the more usual case of calling your code from IDL via CALL_EXTERNAL or as a system routine (LINKIMAGE, DLM).
This book contains the information necessary to successfully call IDL from your own code.