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 >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
216 lines
100 ifq=0thenq=1:load"ma.messlabor",8,1
110 data0,1,2,3,4,5,6,7,8,9,"[193]","[194]","[195]","[196]","[197]","[198]"
120 dim a$(15),m(15),n(15),o(15)
130 printchr$(8):printchr$(14):poke650,128
140 poke 49281,0
150 fori=0to15:reada$(i):m(i)=1:n(i)=0:next
160 we=49285
170 :
180 rem * start hauptprogramm *
190 gosub1240:fl=0:gosub1280
200 ifpeek(49280)=0thenifz$="[133]"thenz$=""
210 ifz$="[133]"thengosub1390:z$="":goto190
220 ifz$="[137]"then1160:rem * grundeichen
230 ifz$="[139]"then1860:rem * speichern
240 ifz$="[138]"then2030:rem * laden
250 :
260 rem * messloop *
270 sys49152+3:fl=1
280 c1=peek(49289)
290 c2=peek(49290)
300 c3=peek(49291)
310 tz=c1*(c2+c3*256):rem *takt- zyclen/sekunde
320 mo=peek(49282):rem *nr. steckplatz
330 ke=peek(49283):rem *modulkennung
340 getz$:ifz$="[137]"then1160
350 mw=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22):rem *messwert
360 print"[155]";:fori=1tomo:print:next
370 if peek(49280)=0then200:rem *kein modul aktiv
380 on ke goto420,500,560,640,690,200,200,750,800,820
390 goto200
400 :
410 rem *1 = luftfeuchte *
420 ifm(mo)=1theno(mo)=15000:m(mo)=3800
430 a=o(mo)-mw:a=(a/m(mo))*100:a=int(a*10)/10
440 ifa<0then850
450 ifa>=100thena=100
460 print"[155]"tab(14)a
470 goto200
480 :
490 rem *2 = strom *
500 ifmw<=10then850
510 ifmw>=4096then860
520 z=(mw/4096*5):z=z/2:a=z*m(mo):gosub980
530 goto200
540 :
550 rem *3 = temperatur *
560 ifmw<=10then850
570 ifmw>=4096then860
580 a=((mw/4096*5)-(2.25+m(mo)))*100
590 a=a+.05:a=int(a*10)/10
600 printtab(14)a
610 goto200
620 :
630 rem *4 = frequenz *
640 ifmw<1then850
650 a=mw:gosub980
660 goto200
670 :
680 rem *5 = spannung *
690 ifmw<=10then850
700 ifmw>=4096then860
710 a=mw/4096*5:gosub980
720 goto200
730 :
740 rem *8 = widerstand *
750 if mw<1then850
760 z=(mw/tz)/(.7*220e-9):a=z*m(mo):gosub980
770 goto200
780 :
790 rem *9 = kapazitaet *
800 if mw<1then850
810 z=(mw/tz)/(.7*39000):a=z*m(mo):gosub980
820 goto200
830 :
840 rem * ueber- und unterlauf *
850 printtab(14)" ------":goto200
860 printtab(14)" ++++++":goto200
870 :
880 rem * fehlbedienung *
890 poke53280,2:print"[147][150] modul muss grundjustiert werden"
900 print"-------------- <[198]7> -------------"
910 poke198,0:wait198,1:get z$:ifz$<>"[136]"then910
920 return
930 :
940 poke53280,2:print"[150][198]alsche [205]oduldaten geladen ?"
950 n(mo)=0:m(mo)=1:o(mo)=0:goto900
960 :
970 rem * zahlenformatierung *
980 ifa<.000000001thenf=-12:f$="p":goto1050
990 ifa<.000001thenf=-9:f$="n":goto1050
1000 ifa<.001thenf=-6:f$="u":goto1050
1010 ifa<1thenf=-3:f$="m":goto1050
1020 ifa<1000thenf=0:f$="":goto1050
1030 ifa<1000000thenf=3:f$="[203]":goto1050
1040 ifa<1000000000thenf=6:f$="[205]"
1050 a=a/(10^f)
1060 a=a+.0005:a=int(a*1000)/1000
1070 t=14:a$=str$(a)
1080 a$=str$(a):fori=1tolen(a$)
1090 ifmid$(a$,i,1)="."thent=t-i+4
1100 next
1110 printtab(t)a;tab(22)""f$"[155]"
1120 return
1130 :
1140 :
1150 rem * grundeichung *
1160 poke49281,1:gosub1230:gosub1330
1170 sys49152+3
1180 getz$:ifz$="[136]"thenpoke49281,0:goto190
1190 goto1170
1200 :
1210 :
1220 rem * initialisieren *
1230 sys49152:print"[151] [150] 64er [205]essplatz [197]ichen[146]":goto1250
1240 sys49152:print"[151] [158] 64er [205]essplatz [205]essen[146]"
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]"
1260 print"[159]";:fori=1to15:printa$(i):next
1270 return
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]"
1290 print"[158][198]1 = [197]ichen 1 [215]ert [198]2 = [199]rundeichung"
1300 print"[198]4 = [204]aden [198]6 = [211]peichern"
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]"
1320 return
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]"
1340 print"[158][198]7 = zurueck zur [205]essung"
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]"
1360 return
1370 :
1380 rem * einzelwert eichen *
1390 ifke=5then890:rem *volt *
1400 ifn(mo)=0then1420:rem *neue eichung
1410 ifn(mo)<>kethen940:rem *daten falsch
1420 ifke=1then1510:rem *feuchte*
1430 print"[145]>"
1440 print"[154]"
1450 a1=a:print"[201][211][212]"a1:input"[145][211][207][204][204]";a1
1460 ifke=3then1710:rem * temperatur
1470 ifke=4then1750:rem *frequenz*
1480 m(mo)=a1/z*(10^f):n(mo)=ke:return
1490 :
1500 rem * feuchteeichung *
1510 sys49152:poke49281,1:poke252,8:poke253,6
1520 print"[147][158]1. [203]ondensator mit 156.9 p[198] einstecken"
1530 print" danach <[210][197][212][213][210][206]>"
1540 poke49282,mo-1:sys49152+3:poke252,8:poke253,6
1550 get z$:ifz$=chr$(13)then1580
1560 ifz$="[136]"thenpoke49281,0:return
1570 goto1540
1580 t1=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22)
1590 sys49152:poke252,8:poke253,6
1600 print"[147]2. [203]ondensator mit 112.7 p[198] einstecken"
1610 print" danach <[210][197][212][213][210][206]>"
1620 poke49282,mo-1:sys49152+3:poke252,8:poke253,6
1630 get z$:ifz$=chr$(13)then1660
1640 ifz$="[136]"thenpoke49281,0:return
1650 goto1620
1660 t2=peek(we)+peek(we+1)*256+peek(we+2)*65536+peek(we+3)*(2^22)
1670 m(mo)=t2-t1:n(mo)=ke:o(mo)=t2:poke49281,0:return
1680 print"[147]t2-t1 t2"t1,t2:fori=0to15:printm(i),o(i):next
1690 :
1700 rem * temperatureichung *
1710 m(mo)=((mw/4096*5)-2.25)-(a1/100):printm(mo):return
1720 a=((mw/4096*5)-(2.25+m(mo)))*100
1730 :
1740 rem * frequenzeichung *
1750 a=((a1*(10^f)/mw))*tz:printc1;c2;c3
1760 a=a-(c1*9)
1770 b=a/c1:ifb>65535thenc1=c1+1:b=b+9:goto1770
1780 ifb<32767thenc1=c1-1:b=b-9:goto1770
1790 c3=int(b/256):c2=b-(c3*256):printc1;c2;c3
1800 poke49289,c1:poke49290,c2:poke49291,c3:return
1810 :
1820 :
1830 rem * speichern *
1840 rem format m(0-15) o(0-15) n(0-15) c1 c2 c3
1850 :
1860 poke53280,15
1870 print"[147][158][196]aten speichern! nur '$' = directory"
1880 input"filename";n$
1890 ifn$=""thenz$="":goto190
1900 ifn$="$"thenn$="":sys49152+6:goto1880
1910 n$=n$+",s,w"
1920 open1,8,2,n$
1930 fori=0to15:print#1,str$(m(i)):next
1940 fori=0to15:print#1,str$(o(i)):next
1950 fori=0to15:print#1,str$(n(i)):next
1960 print#1,str$(c1)
1970 print#1,str$(c2)
1980 print#1,str$(c3)
1990 close1:z$="":goto190
2000 :
2010 rem * laden *
2020 :
2030 poke53280,11
2040 print"[147][158][196]aten laden! nur '$' = directory"
2050 input"filename";n$
2060 ifn$=""thenz$="":goto190
2070 ifn$="$"thenn$="":sys49152+6:goto2050
2080 n$=n$+",s,r"
2090 open1,8,2,n$
2100 fori=0to15:input#1,a$:m(i)=val(a$):next
2110 fori=0to15:input#1,a$:o(i)=val(a$):next
2120 fori=0to15:input#1,a$:n(i)=val(a$):next
2130 input#1,a$:c1=val(a$)
2140 input#1,a$:c2=val(a$)
2150 input#1,a$:c3=val(a$)
2155 ifc1=0then2200
2156 ifc1>255then2200
2157 ifst<>64then2200
2160 poke49289,c1:poke49290,c2:poke49291,c3
2170 close1:z$="":goto190
2180 :
2190 rem ladefehler
2200 poke53280,2:poke53281,2:print"[147][158][204]adefehler":poke198,0:wait198,1:goto2220
2220 close1:z$="":goto190