beautypg.com

Jpi topspeed modula-2, Logitech modula-2 – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 122

background image

II. SOFTWARE GUIDES - 8. Driver488/DRV

8L. Language-Specific Information

Personal488 User’s Manual, Rev. 3.0

II-107

GET & PUT (for GW-BASIC only)

Users of GW-BASIC and/or Interpreted BASIC can also manipulate two commands not available in
QuickBASIC:

GET

and

PUT

, as detailed in the following paragraphs.

The BASIC

INPUT

and

PRINT

statements communicate with Driver488/DRV one character at a time.

That is, the

PRINT

statement breaks up each command into single characters and transfers those

characters separately to Driver488/DRV, and the

INPUT

statement reads one character at a time from

Driver488/DRV until it detects the carriage-return and line-feed that marks the end of the line. It is
more efficient, especially for long transfers, to read and write blocks of characters. The

GET

and

PUT

statements can be used to gain this improved efficiency.

GET

and

PUT

are normally used to communicate with fixed-length random access files.

Driver488/DRV can be accessed as a random access file:

100 OPEN “\DEV\IEEE” FOR RANDOM AS #3

This opens the third Driver488/DRV name,

IEEE

, for I/O as a random access file with 128-byte

records. (The other two names:

IEEEOUT

and

IEEEIN

, are used for

PRINT

and

INPUT

).

BASIC normally limits the number of opened files to 3. Opening additional files can cause a

TOO MANY FILES

error. If you should get such an error, you might need to save your program, leave

BASIC (with the

SYSTEM

command), and reenter BASIC specifying a

/F:n

parameter. See your

BASIC reference manual for more details.

JPI TopSpeed Modula-2

Use of Direct DOS I/O Devices

Once Driver488/DRV has been installed in your system, it is ready to begin controlling IEEE 488 bus
devices. To show how this is done, we develop a short program, in JPI TopSpeed Modula-2 and
Logitech Modula-2, to control a Keithley Instruments Model 195 digital multimeter. The techniques
used in this program are quite general, and apply to the control of most instruments.

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

IEEEIO.MOD

: Communication routines for Driver488/DRV.

IEEEIO.DEF

: Declaration file for

IEEEIO.MOD

.

The actual demonstration program is contained in

K195DEMO.MOD

. A Modula-2 version of the

keyboard controller program is also included.

Logitech Modula-2

Use of Direct DOS I/O Devices

Once Driver488/DRV has been installed in your system, it is ready to begin controlling IEEE 488 bus
devices. To show how this is done, we develop a short program, in JPI TopSpeed Modula-2 and
Logitech Modula-2, to control a Keithley Instruments Model 195 digital multimeter. The techniques
used in this program are quite general, and apply to the control of most instruments.

In order to simplify programming Driver488/DRV with Modula-2, the following files are provided on
the Driver488/DRV Program disk:

CHARDEV.MOD

: General purpose character device I/O routines.

CHARDEV.DEF

: Declaration file for

CHARDEV.MOD

.

IEEEIO.MOD

: Communication routines for Driver488/DRV.

IEEEIO.DEF

: Declaration file for

IEEEIO.MOD

.

The actual demonstration program is contained in

K195DEMO.MOD

. A Modula-2 version of the

keyboard controller program is also included.