8-Bit Software Online Conversion
Electrical Phases - Listing
10REM > ElecPh
20REM Show Electrical Supply Phases
30:
40MODE 1:os%=FNfx(0,1)
50IFINKEY-1:os%=32
60IFos%=32:MODE 2:h%=200 ELSE MODE 1:
h%=256:VDU23,1;0;0;0;0,19,3,6,0,0,0
66MODE1
70IFos%=32:VDU 29,0;1024-800;28,0,24,
39,0
80t=65.33:ON ERROR IFFNerr:END
85t=40
90PROCplot
100END
110:
120DEFFNerr:COLOUR3:IFERR=17:PROCmenu:
=FALSE
130PRINTTAB(0,30);:REPORT:PRINT" at li
ne ";ERL
140=TRUE
150:
160DEFPROCmenu:CLS:PRINTSPC(9)"Supply
Phase Comparison"'
170PRINTSPC5"1: 200v RMS"SPC5"6: 200v
Peak"
180PRINTSPC5"2: 220v RMS"SPC5"7: 220v
Peak"
190PRINTSPC5"3: 230v RMS"SPC5"8: 230v
Peak"
200PRINTSPC5"4: 240v RMS"SPC5"9: 240v
Peak"
210PRINTSPC5"5: 250v RMS"SPC5"0: 250v
Peak"
220PRINT'SPC5"X: Exit"
230PRINT'SPC5"Press a key: ";:REPEATA$
=GET$:UNTILINSTR("1234567890*Xx",A$)
240IFA$="X" OR A$="x":END
250IFA$="*":REPEATINPUTLINE"*"A$:OSCLI
A$:UNTILA$=""
260IFA$="1":t=56.75
270IFA$="2":t=62.5
280IFA$="3":t=65.33
290IFA$="4":t=67.9
300IFA$="5":t=70.75
310IFA$="6":t=40.128
320IFA$="7":t=44.195
330IFA$="8":t=46.195
340IFA$="9":t=48.01
350IFA$="0":t=50
360ENDPROC
370:
380DEFFNR:COLOUR1:=""
390DEFFNY:COLOUR2:=""
400DEFFNB:COLOUR3:=""
410:
420DEFFNr(x)=t*SINRAD(2*x-180)
430DEFFNb(x)=FNr(x+120)
440DEFFNy(x)=FNr(x+240)
450:
460DEFPROCplot:CLS:PRINTSPC(9)"Supply
Phase Comparison"
470i%=h%DIV2:j%=h%*4-i%:REM h%=256/200
, i%=128/100, j%=896/700
480GCOL 0,3:FOR Y=0 TO 3
490MOVE 96,i%+h%*Y:DRAW 1280,i%+h%*Y
500MOVE 96,i%+h%*Y-115:DRAW 96,i%+h%*Y
+115
510NEXT
520PRINTTAB(0,11)FNY"Y"FNB"-B"TAB(0,19
)"B-"FNR"R"TAB(0,27)"R"FNB"-"FNY"Y";FNB;
530PRINTTAB(4,7)"3ph Peak: 000v RMS:
000v Ave: 000v"
540PRINTTAB(4,8)"1ph Peak: 000v RMS:
000v Ave: 000v"
550:
560p1=0:p3=0
570FOR X=96 TO 1140 STEP3
580r=FNr(X):b=FNb(X):y=FNy(X)
590GCOL 0,1:PLOT 69,X,r+j%
600GCOL 0,2:PLOT 69,X,y+j%
610GCOL 0,3:PLOT 69,X,b+j%
620:
630GCOL0,1:PLOT69,X,5*i%+b-y
640GCOL0,2:PLOT69,X,3*i%+y-r
650GCOL0,3:PLOT69,X,i%+r-b
660:
670COLOUR1:PRINTTAB(36,2);INT(5*r);" "
;
680COLOUR2:PRINTTAB(36,3);INT(5*y);" "
;
690COLOUR3:PRINTTAB(36,4);INT(5*b);" "
;
700:
710COLOUR1:PRINTTAB(36,11);INT(5*(b-y)
);" ";
720COLOUR2:PRINTTAB(36,19);INT(5*(y-r)
);" ";
730COLOUR3:PRINTTAB(36,27);INT(5*(r-b)
);" ";
740:
750IFr>p1:p1=r:PRINTTAB(14,8);INT(5*p1
);TAB(25,8);INT(5*p1*.7071);TAB(36,8);IN
T(5*p1*.67);
760IFr-b>p3:p3=r-b:PRINTTAB(14,7);INT(
5*p3);TAB(25,7);INT(5*p3*.7071);TAB(36,7
);INT(5*p3*.67);
770REM IFINKEY-1:REPEATUNTILNOTINKEY-1
780NEXT
790REPEATUNTIL0
800:
810DEFFNfx(A%,X%):LOCAL Y%:Y%=X%DIV256
:=(USR&FFF4 AND&FFFF00)DIV256