beautypg.com

Quickbasic, 8g. quickbasic, Use of the character command language – Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual

Page 80: Initialization of the system, Topics

background image

II. SOFTWARE GUIDES - 8. Driver488/DRV

8G. QuickBASIC

Personal488 User’s Manual, Rev. 3.0

II-65

SUBROUTINE OpenIeee
Open(1,File=’\dev\ieeeout’,Status=’OLD’,
1 Access=’SEQUENTIAL’)
Open(2,File=’\dev\ieeein’,Status=’OLD’,
1 Access=’SEQUENTIAL’,Form=’BINARY’)
END
SUBROUTINE FlushIeee
Rewind 1
Rewind 2
END
FUNCTION StrLen(String,MaxLen)
Character String*127
StrLen=MaxLen-1
DO 10 i=1,MaxLen-2
If (String(i:i) .eq. CHAR(13) .and.
1 String(i+1:i+1) .eq. CHAR(10)) then
StrLen=i-1
Goto 20
EndIf
10 Continue
20 Continue
END

Use of the Character Command Language

Several versions of Microsoft QuickBASIC are currently popular: 2.0, 3.0, 4.0, and 4.5. While they
vary considerably in their user interface and performance, they are virtually identical when it comes to
controlling Driver488/DRV. Two demonstration programs are included for QuickBASIC:

195DEMO.BAS

and

195DEMO4.BAS

.

195DEMO.BAS

is compatible with versions 2.0 and higher of

QuickBASIC, while

195DEMO4.BAS

requires version 4.0 or version 4.5. These examples can be found

on the Driver488/DRV disk in the

\QB

directory.

To execute the demo program, start QuickBASIC with the

QB /L

command. The

/L

parameter tells

QuickBASIC to load the default library containing the

ABSOLUTE

subroutine. This

/L

parameter is not

needed in version 4.0 using

195DEMO4.BAS

. Also, in earlier versions of QuickBASIC, such as 2.0, the

EVENT TRAPPING

and

CHECKING BETWEEN STATEMENTS

compiler options must be turned on for the

program to compile and execute correctly.

Initialization of the System

Any program using Driver488/DRV must first establish communications with the Driver488/DRV
software driver. In BASIC and most other languages this is accomplished using an

OPEN

statement.

Communication both to and from Driver488/DRV is required. In BASIC, this means that two files

8G. QuickBASIC

Topics

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

Initialization of the System.......................................................... II-64

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

Taking Readings............................................................................. II-66

Buffer Transfers ............................................................................. II-67

BASIC VARPTR & SADDR ........................................................... II-68

Interrupt Handling ........................................................................ II-68

Sample Program ............................................................................. II-70