RS232C Interface for DC5
39
17.9 Example of a BASIC program
The range of commands stored in the DC5 can be activated
by this simple program:
REM
command procedure for DC5
REM
enter 1st command
REM
2nd command is passed on to the DC5
CLOSE
OPEN ”COM2:4800,N,8,1,CS0,DS0,CD0” AS #1
loop:
b$ = ” ”
INPUT ”command: ”;b$
if b$ = ”X” then markend
if b$ = ”x” then markend
repeat command:
PRINT #1,b$
PRINT
PRINT ”return message”
PRINT ”– – – – – – – –”
GOSUB enter
GOTO loop
markend:
END
enter:
A$ = ” ”
read loop:
X = ASC (INPUT$(1,#1))
IF X = 10 THEN read end
A$ = A$ + CHR$(X)
GOTO read loop
read end:
print a$
RETURN
Note:
Only capital letters are accepted for commands!
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com