C languages, 9e. c languages, Topics – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 166: Accessing from a c program

II. SOFTWARE GUIDES - 9. Driver488/SUB
9E. C Languages
Personal488 User’s Manual, Rev. 3.0
II-151
program hello;
uses iottp60;
var
ieee : Integer;
{ Device handles }
response : string;
{ Text buffer for Driver488/SUB responses }
rv : Integer ;
{ General purpose return value }
begin
{ Query Driver488/SUB for its hello message }
rv:=ioHello (ieee, response) ;
Writeln (response) ;
end.
Upon execution, the following response is printed on the screen:
-- Driver488 ver 4.0........
To run this program, Driver488/SUB must be installed and resident. Successful operation of this
program proves that the driver is installed and the Driver488/SUB subroutines were properly linked to
the application program. Errors in setting up board parameters like DMA channel and interrupts will
not be detected by this program.
9E. C Languages
Topics
•
Accessing from a C Program...................................................... II-150
•
Establishing Communications .................................................. II-151
•
Confirming Communication ...................................................... II-152
•
Setting Up Event Handling ........................................................ II-152
•
Reading Driver Status................................................................. II-152
•
External Device Initialization................................................... II-153
•
Interrupt Handling ...................................................................... II-153
•
Basic Data Acquisition................................................................ II-154
•
Block Data Acquisition ............................................................... II-154
•
Sample Program ........................................................................... II-155
•
Command Summary .................................................................... II-158
Accessing from a C Program
Note:
Subroutines may be used with all C languages except Aztec C.
Driver488/SUB provides support for Microsoft C, Turbo C and Borland C. To allow for ready access
to all Driver488/SUB functions and type definitions, an include file provides all required declarations.
In addition, one include file must be included in the main module to provide for automatic detection of
certain compiler options and enable the required adjustments within the driver. Note that the header
files (
*.h
) must be included in your program and linked to the proper Driver488/SUB library files, as
described in the previous Sub-Chapter “Getting Started.” The following
#include
directives should
appear near the beginning of the main module.
•
For Borland C compilers:
#include “iot_main.h”
#include “iotbc20.h”
•
For Microsoft compilers:
#include “iot_main.h”