beautypg.com

Programming examples……25, Programming examples, Caution – Measurement Computing Digital488/80A User Manual

Page 31

background image

Programming Examples

The Digital488/80A 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 Digital488/80A (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 Digital488/80A and becoming familiar with the commands and their
actions.

To Run the Keyboard Controller Program

CAUTION

This programming example will not work properly if the HVCX1 option is installed.
Remove the HVCX1 board and replace it with the jumper board to run this example.


1. First, verify that the rear-panel DIP switch S1 is set for Dual Primary addressing mode (factory

default), and for IEEE 488 bus primary address 8 (factory default).

2. Connect an IEEE 488 cable from the IEEE 488 connector on the Digital488/80A to the IEEE 488

connector on the Personal488 PC/IEEE 488 controller interface card.

3. Turn on the Digital488/80A by depressing the rear-panel power switch. All of the front-panel LED

indicators should light up for approximately one second while the Digital488/80A performs an internal
ROM and RAM self-check. At the end of this self-check all of the LED indicators should turn off
except for POWER.

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.

Digital488/80A User’s Manual

Digital488/80A Power & Assembly 25