home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MKLAPI09.ZIP / TEST.BAS < prev    next >
BASIC Source File  |  1993-02-28  |  2KB  |  68 lines

  1. DEFINT A-K, M-Z
  2. DEFLNG L-M
  3. ' $INCLUDE: 'MARKLIN.INC'
  4. SPEED% = 2400
  5. PORT% = 2
  6. RC%   = 1
  7. RELAX% = 32
  8. BRANCH% = 34
  9. STRAIGHT% = 33
  10. SWITCH% = 253
  11. SNSMAX% = 3
  12. DIM cnt&(9)
  13. ' ----------------------------
  14. RC = MKLOPEN(PORT%, SPEED%)
  15. PRINT "Returncode MKLOPEN=",RC%;
  16. PRINT "TIME=", MKLMSECS&
  17. MKLPOLL (SNSMAX%)
  18. FOR I% = 0 TO 1
  19.   RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  20.   RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  21.   RC = MKLPUTC(RELAX%)
  22.   PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  23. NEXT
  24. rc = mklflush
  25. if rc <> 0 then
  26.   PRINT "Flush not complete: ";rc%;" bytes purged"
  27. end if
  28. FOR I% = 0 TO 1
  29.   RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  30.   RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  31.   RC = MKLPUTC(RELAX%)
  32.   PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  33. NEXT
  34. 'Expect commands be discarded when 'stop' issued without preceding mklflush!
  35. rc = mklstop
  36. 'FOR I% = 0 TO 1
  37. '  RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  38. '  RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  39. '  RC = MKLPUTC(RELAX%)
  40. '  PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  41. 'NEXT
  42. sleep 1
  43. rc = mklgo(2)
  44. sleep 1
  45. FOR I% = 0 TO 1
  46.   RC = MKLPUTC(SWITCH% * 256 + BRANCH%)
  47.   RC = MKLPUTC(SWITCH% * 256 + STRAIGHT%)
  48.   RC = MKLPUTC(RELAX%)
  49.   PRINT "Switchpoint (";SWITCH%;") branch/straight/off (";i%;")"
  50. NEXT
  51. rc = mklflush
  52. if rc <> 0 then
  53.   PRINT "Flush not complete: ";rc%;" bytes purged"
  54. end if
  55. 'Expect result of last poll not completed when mklclose issued
  56. MKLCLOSE
  57. print ""
  58. print " Commands accepted: ";mklstats(1)
  59. print "  S88 reads issued: ";mklstats(2)
  60. print "Commands discarded: ";mklstats(3)
  61. print " Bytes transmitted: ";mklstats(4)
  62. print "    Bytes received: ";mklstats(5)
  63. print "      Bytes purged: ";mklstats(6)
  64. print ""
  65. for i=7 to 15
  66.   print "counter";i;"="; mklstats&(i)
  67. next i
  68.