home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_37.arc / PCDADS-1.FIG < prev    next >
Text File  |  2000-01-06  |  5KB  |  109 lines

  1. 100 REM PC-DADS Ver. 1.1 for two floppy drive system with NO hard disk
  2. 101 REM PCDADS1C.BAS 11/22/86 Russ Eberhart
  3. 110 CLS:KEY OFF:ST=0
  4. 120 PRINT:PRINT "PC DATA Acquisition, Display and Storage (PC-DADS) v. 1.1"
  5. 130 PRINT:PRINT "Copyright 1986, JHU Applied Physics Laboratory":PRINT
  6. 140 PRINT:PRINT "NOTE: This program version requires RAM disk on drive C"
  7. 150 PRINT       "      Data are recorded on diskette in drive B:"
  8. 160 PRINT:PRINT
  9. 170 PRINT "Connect first calibration voltage to all input channels, then press any key..."
  10. 180 IF INKEY$="" THEN 180
  11. 190 R1(1)=1/STICK(0):R1(2)=1/STICK(1):R1(3)=1/STICK(2):R1(4)=1/STICK(3)
  12. 200 PRINT:PRINT "First set of calibration readings taken"
  13. 210 INPUT "Enter value in volts of first calibration voltage";V1:PRINT
  14. 220 PRINT "Connect second calibration voltage to all input channels, then press any key..."
  15. 230 IF INKEY$="" THEN 230
  16. 240 R2(1)=1/STICK(0):R2(2)=1/STICK(1):R2(3)=1/STICK(2):R2(4)=1/STICK(3)
  17. 250 PRINT:PRINT "Second set of calibration readings taken"
  18. 260 INPUT "Enter value in volts of second calibration voltage";V2
  19. 270 DV=V2-V1
  20. 280 FOR I=1 TO 4:F(I)=(R2(I)-R1(I))/DV:OF(I)=R2(I)-(V2*F(I))
  21. 300 NEXT
  22. 310 PRINT:PRINT "PC-DADS System is now calibrated"
  23. 320 PRINT:PRINT "                    *****     MAIN MENU     *****"
  24. 330 PRINT:PRINT "     1. Four-channel data display, single screen at a time"
  25. 340 PRINT:PRINT "     2. Continuous four-channel data display"
  26. 350 PRINT:PRINT "     3. Acquire and record data set, display on screen;"
  27. 360 PRINT       "        saving to disk is then optional for each data set"
  28. 370 PRINT:PRINT "     4. Acquire and record data sets at selected intervals,"
  29. 380 PRINT       "        save to disk automatically"
  30. 390 PRINT:PRINT "     5. Execute SHELL command to operating system; type EXIT"
  31. 400 PRINT       "        to return to PC-DADS Main Menu"
  32. 410 PRINT
  33. 420 INPUT "Enter choice:";MC
  34. 430 ON MC GOTO 460, 450, 610, 880, 860
  35. 440 GOTO 320
  36. 450 ST=1
  37. 460 PRINT "Channels one and two will appear in the lower half of the screen,"
  38. 470 PRINT "Channels three and four will appear in the upper half."
  39. 480 PRINT "A beep will signal that a trace is complete; if you are in single"
  40. 490 PRINT "trace mode, you may then press any key to start another trace."
  41. 500 PRINT "Press CRTL-BRK to exit program."
  42. 510 PRINT:PRINT "Press any key to start data display..."
  43. 520 IF INKEY$="" THEN 520
  44. 530 GOSUB 2000
  45. 550 FOR I%=40 TO 639
  46. 560 PSET(I%,187-8*((1/STICK(0))-OF(1))/F(1)):PSET(I%,139-8*((1/STICK(1))-OF(2))/F(2)):PSET(I%,91-8*((1/STICK(2))-OF(3))/F(3)):PSET(I%,43-8*((1/STICK(3))-OF(4))/F(4))
  47. 570 NEXT
  48. 590 BEEP
  49. 600 IF INKEY$="" AND ST=0 THEN 600 ELSE 530
  50. 610 CLS:PRINT"Press any key to start taking data..."
  51. 620 IF INKEY$="" THEN 620 ELSE 630
  52. 630 CLS:PRINT"Taking data..."
  53. 640 OPEN "c:data.dat" FOR OUTPUT AS #1
  54. 650 PRINT #1, F(1);F(2);F(3);F(4);OF(1);OF(2);OF(3);OF(4)
  55. 660 T1$=TIME$
  56. 670 FOR I=1 TO 600
  57. 680 PRINT #1, STICK(0);STICK(1);STICK(2);STICK(3)
  58. 690 NEXT
  59. 700 T2$=TIME$:PRINT #1, DATE$,T1$,T2$
  60. 710 CLOSE
  61. 720 GOSUB 2000
  62. 730 OPEN "c:data.dat" FOR INPUT AS #1
  63. 740 INPUT #1, F1,F2,F3,F4,OF1,OF2,OF3,OF4
  64. 760 FOR I%=40 TO 639
  65. 770 INPUT #1, S0,S1,S2,S3
  66. 780 PSET(I%,187-8*((1/S0)-OF1)/F1):PSET(I%,139-8*((1/S1)-OF2)/F2):PSET(I%,91-8*((1/S2)-OF3)/F3):PSET(I%,43-8*((1/S3)-OF4)/F4)
  67. 800 NEXT
  68. 810 CLOSE:BEEP
  69. 820 LOCATE 1,1:INPUT"Do you want to save these data to diskette";SV$
  70. 830 IF SV$="Y" OR SV$="y" THEN 840 ELSE 610
  71. 840 SHELL "copy c:data.dat b:data.dat"
  72. 850 CLS:GOTO 320
  73. 860 SCREEN 0:SHELL
  74. 870 SCREEN 2:CLS:GOTO 320
  75. 880 CLS:INPUT "How many points per data set";PPS
  76. 890 PRINT:INPUT"How many data sets per day";DSD
  77. 900 OPEN "c:dataset.dat" FOR OUTPUT AS #1
  78. 910 PRINT #1, F(1);F(2);F(3);F(4);OF(1);OF(2);OF(3);OF(4);PPS;DSD
  79. 920 CLOSE:CLS
  80. 930 SHELL "copy c:dataset.dat b:dataset.dat"
  81. 940 CLS:PRINT "Press any key to take first data set"
  82. 950 IF INKEY$="" THEN 950 ELSE 960
  83. 960 CLS:OPEN "c:dataset.dat" FOR OUTPUT AS #1
  84. 970 TS$=TIME$:TS=TIMER:PRINT"Taking data..."
  85. 980 FOR I=1 TO PPS
  86. 990 PRINT #1, STICK(0);STICK(1);STICK(2);STICK(3)
  87. 1000 NEXT
  88. 1010 TE$=TIME$:PRINT #1, DATE$,TS$,TE$
  89. 1020 CLOSE:CLS:PRINT"Saving data to diskette file on drive B:"
  90. 1030 SHELL "copy b:dataset.dat+c:dataset.dat"
  91. 1040 CLS:PRINT"Waiting to take next data set..."
  92. 1050 TE=TIMER
  93. 1060 IF TE < TS THEN TE=TE+86400!
  94. 1070 IF TE-TS > 86400!/DSD THEN 960 ELSE 1050
  95. 2000 SCREEN 2:CLS
  96. 2010 FOR I=40 TO 639 STEP 30
  97. 2020 FOR J=195 TO 11 STEP -8:PSET(I,J)
  98. 2030 NEXT J:NEXT I
  99. 2040 K=25
  100. 2050 FOR H=1 TO 4
  101. 2055 BV=-2
  102. 2060 LOCATE K,1:PRINT H;:LOCATE K-1,2:PRINT "H";:LOCATE K-2,2:PRINT "C";
  103. 2070 FOR L=K TO K-5 STEP -1
  104. 2080 BV=BV+1:LOCATE L,3:PRINT BV;
  105. 2090 NEXT L
  106. 2100 K=K-6
  107. 2110 NEXT H
  108. 2120 RETURN
  109.