home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
basic
/
mklapi09.zip
/
TEST.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-02-28
|
2KB
|
68 lines
DEFINT A-K, M-Z
DEFLNG L-M
' $INCLUDE: 'MARKLIN.INC'
SPEED% = 2400
PORT% = 2
RC% = 1
RELAX% = 32
BRANCH% = 34
STRAIGHT% = 33
SWITCH% = 253
SNSMAX% = 3
DIM cnt&(9)
' ----------------------------
RC = MKLOPEN(PORT%, SPEED%)
PRINT "Returncode MKLOPEN=",RC%;
PRINT "TIME=", MKLMSECS&
MKLPOLL (SNSMAX%)
FOR I% = 0 TO 1
RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
RC = MKLPUTC(RELAX%)
PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
NEXT
rc = mklflush
if rc <> 0 then
PRINT "Flush not complete: ";rc%;" bytes purged"
end if
FOR I% = 0 TO 1
RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
RC = MKLPUTC(RELAX%)
PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
NEXT
'Expect commands be discarded when 'stop' issued without preceding mklflush!
rc = mklstop
'FOR I% = 0 TO 1
' RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
' RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
' RC = MKLPUTC(RELAX%)
' PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
'NEXT
sleep 1
rc = mklgo(2)
sleep 1
FOR I% = 0 TO 1
RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
RC = MKLPUTC(RELAX%)
PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
NEXT
rc = mklflush
if rc <> 0 then
PRINT "Flush not complete: ";rc%;" bytes purged"
end if
'Expect result of last poll not completed when mklclose issued
MKLCLOSE
print ""
print " Commands accepted: ";mklstats(1)
print " S88 reads issued: ";mklstats(2)
print "Commands discarded: ";mklstats(3)
print " Bytes transmitted: ";mklstats(4)
print " Bytes received: ";mklstats(5)
print " Bytes purged: ";mklstats(6)
print ""
for i=7 to 15
print "counter";i;"="; mklstats&(i)
next i