beautypg.com

Measurement Computing Micro488/p User Manual

Page 17

background image

Getting Started

09-26-02

2-7

Now the Micro488/p is ready for operation. Simply set up an infinite loop to check
for user keypresses and to look for serial data in the PC's serial input buffer.

PRINT "Ready!"

DO
IF LOC(1) THEN PRINT INPUT$(LOC(1), 1);

'If anything is in the
'PC's serial input
'buffer
'print it to the screen.

k$ = INKEY$

'Get key press

PRINT #1, k$;

'Send it to the
'Micro488/p

PRINT k$;

'Echo keypress to screen

LOOP

The following is a complete listing of 'DUMBTERM.BAS"

'Micro488/p Dumb Terminal Program
'Copyright 1992 IOtech Inc.

CLS
PRINT "Initializing..."
OPEN "COM1:19200,N,8,2,cs,ds" FOR RANDOM AS #1
t = TIMER
DO WHILE t + .1 > TIMER
LOOP

FOR i = 1 TO 5
PRINT #1, CHR$(13);
t = TIMER
DO WHILE t + .2 > TIMER
LOOP
NEXT i

PRINT #1, "I"
PRINT #1, "EC;0"
PRINT #1, "H;1"
PRINT #1, "X;0"
PRINT #1, "TC;2"
PRINT #1, "TB;4"
t = TIMER