beautypg.com

KEPCO BIT 232F User Manual

Page 70

background image

G-2

BIT 232 2/28/00

VIEW PRINT 1 TO 23 ‘ Print between lines 1 & 23.

‘ Open communications (9600 baud, no parity, 8-bit data,

‘ 1 stop bit, 256-byte input buffer):

OPEN “COM2:9600,N,8,1,RS,CS,DS” FOR RANDOM AS #1 LEN = 256

‘ Check the RS 232 interface if characters are waiting (EOF(1) is

‘ true) and get them

IF NOT EOF(1) THEN

‘ LOC(1) gives the number of characters waiting:

SendChar$ = INPUT$(LOC(1), #1)

END IF

ComString$ = “*idn?”

SendCmmdWready ComString$

ComString$ = “*rst”

SendCmmdWready ComString$

ComString$ = “*tst?”

SendCmmdWready ComString$

ComString$ = “syst:err?”

SendCmmdWready ComString$

DO ‘ Main communications loop.

KeyInput$ = INKEY$ ‘ Check the keyboard.

IF KeyInput$ = Quit$ THEN ‘ Exit the loop if the user

EXIT DO ‘ pressed ALT+q.

ELSEIF KeyInput$ <> ““ THEN ‘ Otherwise, if the user has pressed a key

SendWecho KeyInput$

END IF ‘ character typed to the modem.

PRINT KeyInput$; ‘ then print.

‘ Check the modem. If characters are waiting (EOF(1) is

‘ true), get them and print them to the screen:

IF NOT EOF(1) THEN

‘ LOC(1) gives the number of characters waiting:

CharInput$ = INPUT$(LOC(1), #1)

Filter CharInput$ ‘ Filter out line feeds and

PRINT CharInput$; ‘ backspaces, then print.

END IF

LOOP

CLOSE ‘ End communications.

CLS

END

This manual is related to the following products: