beautypg.com

Programming examples, Kybdctrl.bas program, To run the keyboard controller program – Measurement Computing DAC488 v.1 User Manual

Page 25: Amples……19

background image

DAC488 User’s Manual

DAC488 Power & Assembly 19

Programming Examples

The DAC488 programming examples use the Personal488 PC/IEEE 488 controller interface and the BASIC
Keyboard Controller (KBC) program. This KBC program

KYBDCTRL.BAS

is included on the disk and is

listed below.

KYBDCTRL.BAS Program

10 ' Personal488 Keyboard Controller Program
20 '
30 ' For use with the IOtech Personal488
40 ' IEEE 488 interface
50 '
100 OPEN "\DEV\IEEEOUT" FOR OUTPUT AS #1
110 IOCTL#1,"BREAK"
120 PRINT#1,"RESET"
130 OPEN "\DEV\IEEEIN" FOR INPUT AS #2
140 '
150 ON ERROR GOTO 300
160 PRINT#1,"ERROR OFF"
170 '
180 LINE INPUT "CMD> ",CMD$
190 PRINT#1,CMD$
200 '
210 IF IOCTL$(2)<>"1" THEN 180
220 PRINT INPUT$(1,2);
230 GOTO 210
290 '
300 ' Error Handler
310 '
320 IOCTL#1,"BREAK"
330 PRINT#1,"STATUS"
340 INPUT#2,ST$
350 PRINT CHR$(7);"Error #";MID$(ST$,15,2);": ";MID$(ST$,27)
360 RESUME NEXT

The Keyboard Controller (KBC) program allows direct communication with the DAC488 (or any IEEE 488
device on the bus) via the keyboard, and displays any responses on the screen. This program is a
convenient method of exercising the DAC488 and becoming familiar with the commands and their actions.

To Run the Keyboard Controller Program

1. First, set the rear-panel DIP switch for bus address 9.

2. Connect an IEEE 488 cable from the IEEE 488 connector on the DAC488 to the IEEE 488 connector

on the Personal488 PC/IEEE 488 controller interface card.

3. Turn on the DAC488 by depressing the rear-panel power switch.

4. From the MS-DOS prompt on your computer screen, run the Keyboard Controller Program

KYBDCTRL.BAS

and verify that the

CMD>

prompt appears on the screen.

This manual is related to the following products: