beautypg.com

KEPCO BIT 232F User Manual

Page 72

background image

G-4

BIT 232 2/28/00

‘ ========================= Send Command =====================

‘ Send command line using SendWecho

‘ ============================================================

SUB SendCommand (SendCmmd$) STATIC

FOR K = 1 TO LEN(SendCmmd$)

Istr$ = MID$(SendCmmd$, K, 1)

SendWecho Istr$

PRINT Istr$; ‘ then print.

NEXT K

Istr$ = CHR$(13)

SendWecho Istr$

PRINT Istr$

END SUB

‘ ========================= Send with Echo ===================

‘ Send character and wait for the character to be echoed back

‘ ============================================================

SUB SendWecho (SendChar$) STATIC

PRINT #1, SendChar$; ‘ send the pressed key

FOR J = 1 TO 100

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

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

IF NOT EOF(1) THEN

SendChar$ = INPUT$(1, #1)

Filter SendChar$ ‘ Filter out backspace

EXIT FOR

END IF

‘ If timeout expire return empty string

SendChar$ = ““

NEXT J

END SUB

This manual is related to the following products: