home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 84 / 64er_Magazin_Sonderheft_84_19xx_Markt__Technik_de_Side_A.d64 / messlabor (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  216 lines

  1. 100 ifq=0thenq=1:load"ma.messlabor",8,1
  2. 110 data0,1,2,3,4,5,6,7,8,9,"[193]","[194]","[195]","[196]","[197]","[198]"
  3. 120 dim a$(15),m(15),n(15),o(15)
  4. 130 printchr$(8):printchr$(14):poke650,128
  5. 140 poke 49281,0
  6. 150 fori=0to15:reada$(i):m(i)=1:n(i)=0:next
  7. 160 we=49285
  8. 170 :
  9. 180 rem * start hauptprogramm *
  10. 190 gosub1240:fl=0:gosub1280
  11. 200 ifpeek(49280)=0thenifz$="[133]"thenz$=""
  12. 210 ifz$="[133]"thengosub1390:z$="":goto190
  13. 220 ifz$="[137]"then1160:rem * grundeichen
  14. 230 ifz$="[139]"then1860:rem * speichern
  15. 240 ifz$="[138]"then2030:rem * laden
  16. 250 :
  17. 260 rem * messloop *
  18. 270 sys49152+3:fl=1
  19. 280 c1=peek(49289)
  20. 290 c2=peek(49290)
  21. 300 c3=peek(49291)
  22. 310 tz=c1*(c2+c3*256):rem *takt- zyclen/sekunde
  23. 320 mo=peek(49282):rem *nr. steckplatz
  24. 330 ke=peek(49283):rem *modulkennung
  25. 340 getz$:ifz$="[137]"then1160
  26. 350 mw=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22):rem *messwert
  27. 360 print"[155]";:fori=1tomo:print:next
  28. 370 if peek(49280)=0then200:rem *kein modul aktiv
  29. 380 on ke goto420,500,560,640,690,200,200,750,800,820
  30. 390 goto200
  31. 400 :
  32. 410 rem *1 =  luftfeuchte *
  33. 420 ifm(mo)=1theno(mo)=15000:m(mo)=3800
  34. 430 a=o(mo)-mw:a=(a/m(mo))*100:a=int(a*10)/10
  35. 440 ifa<0then850
  36. 450 ifa>=100thena=100
  37. 460 print"[155]"tab(14)a
  38. 470 goto200
  39. 480 :
  40. 490 rem *2 =  strom *
  41. 500 ifmw<=10then850
  42. 510 ifmw>=4096then860
  43. 520 z=(mw/4096*5):z=z/2:a=z*m(mo):gosub980
  44. 530 goto200
  45. 540 :
  46. 550 rem *3 =  temperatur *
  47. 560 ifmw<=10then850
  48. 570 ifmw>=4096then860
  49. 580 a=((mw/4096*5)-(2.25+m(mo)))*100
  50. 590 a=a+.05:a=int(a*10)/10
  51. 600 printtab(14)a
  52. 610 goto200
  53. 620 :
  54. 630 rem *4 =  frequenz *
  55. 640 ifmw<1then850
  56. 650 a=mw:gosub980
  57. 660 goto200
  58. 670 :
  59. 680 rem *5 =  spannung *
  60. 690 ifmw<=10then850
  61. 700 ifmw>=4096then860
  62. 710 a=mw/4096*5:gosub980
  63. 720 goto200
  64. 730 :
  65. 740 rem *8 =  widerstand *
  66. 750 if mw<1then850
  67. 760 z=(mw/tz)/(.7*220e-9):a=z*m(mo):gosub980
  68. 770 goto200
  69. 780 :
  70. 790 rem *9 =  kapazitaet *
  71. 800 if mw<1then850
  72. 810 z=(mw/tz)/(.7*39000):a=z*m(mo):gosub980
  73. 820 goto200
  74. 830 :
  75. 840 rem * ueber- und unterlauf *
  76. 850 printtab(14)" ------":goto200
  77. 860 printtab(14)" ++++++":goto200
  78. 870 :
  79. 880 rem * fehlbedienung *
  80. 890 poke53280,2:print"[147][150] modul muss grundjustiert werden"
  81. 900 print"-------------- <[198]7> -------------"
  82. 910 poke198,0:wait198,1:get z$:ifz$<>"[136]"then910
  83. 920 return
  84. 930 :
  85. 940 poke53280,2:print"[150][198]alsche [205]oduldaten geladen ?"
  86. 950 n(mo)=0:m(mo)=1:o(mo)=0:goto900
  87. 960 :
  88. 970 rem * zahlenformatierung *
  89. 980 ifa<.000000001thenf=-12:f$="p":goto1050
  90. 990 ifa<.000001thenf=-9:f$="n":goto1050
  91. 1000 ifa<.001thenf=-6:f$="u":goto1050
  92. 1010 ifa<1thenf=-3:f$="m":goto1050
  93. 1020 ifa<1000thenf=0:f$="":goto1050
  94. 1030 ifa<1000000thenf=3:f$="[203]":goto1050
  95. 1040 ifa<1000000000thenf=6:f$="[205]"
  96. 1050 a=a/(10^f)
  97. 1060 a=a+.0005:a=int(a*1000)/1000
  98. 1070 t=14:a$=str$(a)
  99. 1080 a$=str$(a):fori=1tolen(a$)
  100. 1090 ifmid$(a$,i,1)="."thent=t-i+4
  101. 1100 next
  102. 1110 printtab(t)a;tab(22)""f$"[155]"
  103. 1120 return
  104. 1130 :
  105. 1140 :
  106. 1150 rem * grundeichung *
  107. 1160 poke49281,1:gosub1230:gosub1330
  108. 1170 sys49152+3
  109. 1180 getz$:ifz$="[136]"thenpoke49281,0:goto190
  110. 1190 goto1170
  111. 1200 :
  112. 1210 :
  113. 1220 rem * initialisieren *
  114. 1230 sys49152:print"[151] [150]  64er [205]essplatz                [197]ichen[146]":goto1250
  115. 1240 sys49152:print"[151] [158]  64er [205]essplatz                [205]essen[146]"
  116. 1250 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  117. 1260 print"[159]";:fori=1to15:printa$(i):next
  118. 1270 return
  119. 1280 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  120. 1290 print"[158][198]1 = [197]ichen 1 [215]ert [198]2 = [199]rundeichung"
  121. 1300 print"[198]4 = [204]aden         [198]6 = [211]peichern"
  122. 1310 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  123. 1320 return
  124. 1330 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  125. 1340 print"[158][198]7 = zurueck zur [205]essung"
  126. 1350 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  127. 1360 return
  128. 1370 :
  129. 1380 rem * einzelwert eichen *
  130. 1390 ifke=5then890:rem *volt    *
  131. 1400 ifn(mo)=0then1420:rem *neue eichung
  132. 1410 ifn(mo)<>kethen940:rem *daten falsch
  133. 1420 ifke=1then1510:rem *feuchte*
  134. 1430 print"[145]>"
  135. 1440 print"[154]"
  136. 1450 a1=a:print"[201][211][212]"a1:input"[145][211][207][204][204]";a1
  137. 1460 ifke=3then1710:rem * temperatur
  138. 1470 ifke=4then1750:rem *frequenz*
  139. 1480 m(mo)=a1/z*(10^f):n(mo)=ke:return
  140. 1490 :
  141. 1500 rem *  feuchteeichung  *
  142. 1510 sys49152:poke49281,1:poke252,8:poke253,6
  143. 1520 print"[147][158]1. [203]ondensator mit 156.9 p[198] einstecken"
  144. 1530 print"         danach <[210][197][212][213][210][206]>"
  145. 1540 poke49282,mo-1:sys49152+3:poke252,8:poke253,6
  146. 1550 get z$:ifz$=chr$(13)then1580
  147. 1560 ifz$="[136]"thenpoke49281,0:return
  148. 1570 goto1540
  149. 1580 t1=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22)
  150. 1590 sys49152:poke252,8:poke253,6
  151. 1600 print"[147]2. [203]ondensator mit 112.7 p[198] einstecken"
  152. 1610 print"         danach <[210][197][212][213][210][206]>"
  153. 1620 poke49282,mo-1:sys49152+3:poke252,8:poke253,6
  154. 1630 get z$:ifz$=chr$(13)then1660
  155. 1640 ifz$="[136]"thenpoke49281,0:return
  156. 1650 goto1620
  157. 1660 t2=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22)
  158. 1670 m(mo)=t2-t1:n(mo)=ke:o(mo)=t2:poke49281,0:return
  159. 1680 print"[147]t2-t1     t2"t1,t2:fori=0to15:printm(i),o(i):next
  160. 1690 :
  161. 1700 rem * temperatureichung *
  162. 1710 m(mo)=((mw/4096*5)-2.25)-(a1/100):printm(mo):return
  163. 1720 a=((mw/4096*5)-(2.25+m(mo)))*100
  164. 1730 :
  165. 1740 rem * frequenzeichung *
  166. 1750 a=((a1*(10^f)/mw))*tz:printc1;c2;c3
  167. 1760 a=a-(c1*9)
  168. 1770 b=a/c1:ifb>65535thenc1=c1+1:b=b+9:goto1770
  169. 1780 ifb<32767thenc1=c1-1:b=b-9:goto1770
  170. 1790 c3=int(b/256):c2=b-(c3*256):printc1;c2;c3
  171. 1800 poke49289,c1:poke49290,c2:poke49291,c3:return
  172. 1810 :
  173. 1820 :
  174. 1830 rem * speichern *
  175. 1840 rem format m(0-15) o(0-15) n(0-15)                 c1 c2 c3
  176. 1850 :
  177. 1860 poke53280,15
  178. 1870 print"[147][158][196]aten speichern! nur '$' = directory"
  179. 1880 input"filename";n$
  180. 1890 ifn$=""thenz$="":goto190
  181. 1900 ifn$="$"thenn$="":sys49152+6:goto1880
  182. 1910 n$=n$+",s,w"
  183. 1920 open1,8,2,n$
  184. 1930 fori=0to15:print#1,str$(m(i)):next
  185. 1940 fori=0to15:print#1,str$(o(i)):next
  186. 1950 fori=0to15:print#1,str$(n(i)):next
  187. 1960 print#1,str$(c1)
  188. 1970 print#1,str$(c2)
  189. 1980 print#1,str$(c3)
  190. 1990 close1:z$="":goto190
  191. 2000 :
  192. 2010 rem * laden *
  193. 2020 :
  194. 2030 poke53280,11
  195. 2040 print"[147][158][196]aten laden!     nur '$' = directory"
  196. 2050 input"filename";n$
  197. 2060 ifn$=""thenz$="":goto190
  198. 2070 ifn$="$"thenn$="":sys49152+6:goto2050
  199. 2080 n$=n$+",s,r"
  200. 2090 open1,8,2,n$
  201. 2100 fori=0to15:input#1,a$:m(i)=val(a$):next
  202. 2110 fori=0to15:input#1,a$:o(i)=val(a$):next
  203. 2120 fori=0to15:input#1,a$:n(i)=val(a$):next
  204. 2130 input#1,a$:c1=val(a$)
  205. 2140 input#1,a$:c2=val(a$)
  206. 2150 input#1,a$:c3=val(a$)
  207. 2155 ifc1=0then2200
  208. 2156 ifc1>255then2200
  209. 2157 ifst<>64then2200
  210. 2160 poke49289,c1:poke49290,c2:poke49291,c3
  211. 2170 close1:z$="":goto190
  212. 2180 :
  213. 2190 rem ladefehler
  214. 2200 poke53280,2:poke53281,2:print"[147][158][204]adefehler":poke198,0:wait198,1:goto2220
  215. 2220 close1:z$="":goto190
  216.