Dil Interfacing Subroutines; Linking Dil Routines; Calling Dil Routines From Pascal - HP 9000 Series 300 Tutorials Manual

Device i/o and user interfacing hp-ux concepts and tutorials
Hide thumbs Also See for HP 9000 Series 300:
Table of Contents
OIL Interfacing Subroutines
As mentioned previously, Device I/O Library (DIL) subroutines provide
a means for directly accessing peripheral devices through HP-IB and/or
GPIO interfaces connected to your computer system. Some routines are
general-purpose and can be used with any interface supported by the library,
while others provide control of only certain specific HP-IB or GPIO interfaces.
Linking OIL Routines
DIL routines can be called from C, Pascal, or FORTRAN programs. However,
the
-I
f1.ag must be given when invoking the C, Pascal, or FORTRAN compiler,
cc (1), pc (1), or fc
(1).
Otherwise, library subroutines are not automatically
linked with your program. To link DIL subroutines to a compiled C program,
invoke the C compiler as follows:
cc program.c -ldvio
Similarly, for a Pascal program, use:
pc program.p
-ldvio
and for a FORTRAN program, use:
fc program.f -ldvio
In all three cases, the -I option is passed to the HP-UX linker, causing it to
link any DIL routines called by the program being compiled. To determine
the exact location of DIL library on your HP-UX system, refer to the
corresponding hardware-specific appendix in this tutorial.
Calling OIL Routines from Pascal
You must provide an external declaration for each DIL subroutine called from
a Pascal program. An external declaration consists of the subroutine heading,
including a formal parameter list and result type, followed by the Pascal
EXTERNAL
directive. For example, the C description of open(2) is:
int
open(path. oflag)
char *path;
int of lag;
Interfacing Concepts
1-3

Hide quick links:

Table of Contents
loading

This manual is also suitable for:

Hp 9000 series 800

Table of Contents