Measurement Computing Serial488A User Manual

Page 59

Advertising
background image

4.10

4.8 IEEE to Serial Applications

The following program uses a Serial488A as an interface to a serial instrument

or host computer. The IEEE controller is an IBM PC running GWBasic with the
IOtech Personal488™ controller package. Communications are provided under direct
interaction from the keyboard.

In this program example, key presses are detected and sent via the IEEE bus to

the Serial488A. The character is then sent to the serial device. Any incomming serial
characters are buffered by the Serial488A. The Serial488A is polled by the controller
for any data in the serial input buffer. When data is detected, it is read by the
controller one character at a time and printed on the PC's screen. The IEEE address of
the Serial488A is 10.

10 ' Open Driver488 Files and initialize
20 OPEN "\DEV\IEEEOUT" FOR OUTPUT AS 1
30 IOCTRL #1,"BREAK"
40 PRINT #1,"RESET"
50 OPEN "\DEV\IEEEIN" FOR INPUT AS 2
60 ' Look for PC Key Press
70 K$ = INKEY$
80 IF K$="" THEN GOTO 110
90 ' Output Key Press to Serial488A
100 PRINT #1,"OUTPUT 10;";K$;
110 ' Test for Serial data
120 PRINT #1,"SPOLL 10" : INPUT #2,SPOLL
130 IF NOT (SPOLL AND 16) THEN GOTO 70
140 ' Enter One Byte From Serial488A and print it
150 PRINT #1,"ENTER 10 #1" : S$ = INPUT$(1,1) : PRINT
S$;
160 GOTO 120 ' Try for more

Advertising
This manual is related to the following products: