Microsoft c, 8e. microsoft c, Use of the character command language – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 69: Initialization of the system, Topics

Advertising
background image

8E. Microsoft C

II. SOFTWARE GUIDES - 8. Driver488/DRV

II-54

Personal488 User’s Manual, Rev. 3.0

Use of the Character Command Language

In order to simplify programming Driver488/DRV with C, the following files are provided on the
Driver488/DRV program disk:

IEEEIO.C:

Communications routines for Driver488/DRV

IEEEIO.H:

Header file, contains declarations from

IEEEIO.C

IEEEDEMO.C:

Example file showing use of

fputs

and

fgets

with Driver488/DRV (included

with Microsoft C only)

CRITERR.ASM:

Critical error handler assembly language source file (included with Microsoft C

and Turbo C only)

CRITERR.OBJ:

Object file produced from

CRITERR.ASM

(included with Microsoft C and Turbo

C only)

CRITERR.H:

Header file, contains declarations for using

CRITERR.ASM

The actual demonstration program is contained in

195DEMO.C

.

All files for Microsoft C are in the

\MSC

directory.

To execute the demonstration program, the files must be compiled and then linked. The following
DOS commands perform these steps:

C> msc 195demo;
C> msc ieeeio;
C> link 195demo ieeeio;

Finally, the demonstration program is run by typing

195DEMO <Enter>

. Notice that the critical error

handler

CRITERR.ASM

is not required for the demonstration program. Its use is described later in

“CRITERR.ASM (Microsoft C & Turbo C),” one of the last topics in this Sub-Chapter.

The above command assumes that you have Microsoft C and that the files have been copied into the
appropriate directory for use with your C compiler. Notice that the program uses a small data model
because it uses less than 64K of code and data.

Initialization of the System

Any program using Driver488/DRV must first establish communications with the Driver488/DRV
software driver. In C, this is accomplished using the

OPEN

statement. Communication both to and

from Driver488/DRV is required. Thus, the file must be opened for both reading and writing (

RDWR

).

8E. Microsoft C

Topics

Use of the Character Command Language ............................... II-53

Initialization of the System .......................................................... II-53

Configuration of the 195 DMM .................................................... II-56

Taking Readings ............................................................................. II-56

Buffer Transfers.............................................................................. II-56

Interrupt Handling ........................................................................ II-57

IEEEIO.C .......................................................................................... II-59

CRITERR.ASM (Microsoft C & Turbo C) ................................... II-61

Sample Program ............................................................................. II-62

Advertising