home *** CD-ROM | disk | FTP | other *** search
- DEFINT A-K, M-Z
- DEFLNG L-M
- ' $INCLUDE: '\c2\mklapi\mklapi.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 "Port=";PORT%;"Returncode MKLOPEN=";RC%;"TIME=";MKLMSECS&
- if rc = 0 then
- 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
- mklsleep(1000)
- rc = mklgo(2)
- mklsleep(1000)
- 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
- mklsleep(1000)
- MKLCLOSE
- end if
- 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
-