beautypg.com

8 ieee to serial applications – Measurement Computing Micro 488/EX rev.2.1 User Manual

Page 182

background image

Section 7

Peripheral Pass-Thru Operation

7.10

7.8 IEEE to Serial Applications

The following program uses a Micro488/EX 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 Micro488/EX. The character is then sent to the serial device. Any incomming serial
characters are buffered by the Micro488/EX. The Micro488/EX 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 Micro488/EX is 10.

10 ' Open IOtech 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 Micro488/EX
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 Micro488/EX and print it
150 PRINT #1,"ENTER 10 #1" : S$ = INPUT$(1,1) : PRINT
S$;
160 GOTO 120 ' Try for more