1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
10 'XFMR - 27 JAN 91 rev.13 APR 97
20 IF EX$=""THEN EX$="EXIT"
30 CLS:KEY OFF
40 COLOR 7,0,1
50 UL$=STRING$(80,205)
60 ER$=STRING$(80,32)
70 U1$="##,###.##"
80 U2$="##,####"
90 U3$="#,####"
100 T$=" TRANSFORMER RATIOS"
110 '
120 '.....start
130 CLS
140 COLOR 15,2
150 PRINT T$;TAB(57);;"by George Murphy VE3ERP ";
160 COLOR 1,0:PRINT STRING$(80,223);
170 COLOR 7,0
180 PRINT " Press number in < > to select transformer type:"
190 PRINT UL$;
200 PRINT "  < 1 >  POWER"
210 PRINT "  < 2 >  IMPEDANCE MATCHING - Impedances known"
220 PRINT "  < 3 >  IMPEDANCE MATCHING - turns ratio known"
230 PRINT UL$;
240 PRINT "    or press < 0 > to exit....."
250 Z$=INKEY$:IF Z$="" THEN 250
260 IF Z$="0"THEN CLS:RUN EX$
270 IF Z$="1"THEN 320
280 IF Z$="2"THEN 760
290 IF Z$="3"THEN 1000
300 GOTO 250
310 '
320 '.....power transformers
330 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
340 PRINT " POWER TRANSFORMER:"
350 PRINT UL$;
360 INPUT " ENTER: PRIMARY voltage..........................";EP
370 IF EP=0 THEN LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1:GOTO 360
380 GOSUB 430
390 INPUT " ENTER: SECONDARY voltage........................";ES
400 IF ES=0 THEN LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1:GOTO 390
410 GOSUB 430
420 '
430 IF EP * ES THEN 460
440 RETURN
450 '
460 R=EP/ES               'turns ratio
470 '
480 '.....input current
490 IF IP=0 THEN INPUT " ENTER: PRIMARY current in amps (if known).......";IP
500 GOSUB 570
510 IF ISEC=0 THEN INPUT " ENTER: SECONDARY current in amps (if known).....";ISEC
520 GOSUB 570
530 IF VA=0 THEN INPUT " ENTER: Maximum Volt-Ampere rating (if known)....";VA
540 GOSUB 570
550 GOTO 490
560 '
570 IF IP>0 OR ISEC>0 OR VA>0 THEN 610
580 LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1
590 RETURN
600 '
610 IF IP THEN ISEC=IP*R:VA=EP*IP:GOTO 650
620 IF ISEC THEN IP=ISEC/R:VA=EP*IP:GOTO 650
630 IF VA THEN IP=VA/EP:ISEC=VA/ES:GOTO 650
640 '
650 '.....display results
660 VIEW PRINT 5 TO 24:CLS:VIEW PRINT:LOCATE 5
670 PRINT" Primary voltage.......................";USING U1$;EP;:PRINT " volts"
680 PRINT" Primary current.......................";USING U1$;IP;:PRINT " amps"
690 PRINT" Turns ratio...........................";USING U1$;R;:PRINT ":1"
700 PRINT" Secondary voltage.....................";USING U1$;ES;:PRINT " volts"
710 PRINT" Secondary current ....................";USING U1$;ISEC;:PRINT " amps"
720 PRINT" Maximum Volt-Ampere capacity..........";USING U1$;VA;:PRINT " VA"
730 PRINT UL$;
740 GOTO 1280
750 '
760 '.....impedance matching transformers - impedances known
770 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
780 PRINT " IMPEDANCE MATCHING TRANSFORMER:"
790 PRINT UL$;
800 INPUT " ENTER: Primary impedance........................";ZP
810 IF ZP=0 THEN LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1:GOTO 800
820 LOCATE CSRLIN-1:PRINT SPC(7);:LOCATE CSRLIN,50:PRINT USING U1$;ZP;:PRINT" ê"
830 INPUT " ENTER: Secondary impedance......................";ZS
840 IF ZS=0 THEN LOCATE CSRLIN-1:PRINT ER$;:LOCATE CSRLIN-1:GOTO 830
850 LOCATE CSRLIN-1:PRINT SPC(7);:LOCATE CSRLIN,50:PRINT USING U1$;ZS;:PRINT" ê"
860 I=SQR(ZP/ZS)
870 INPUT " ENTER: Number of PRIMARY turns (if known).......";TP
880 IF TP THEN TS=TP/I:GOTO 910
890 INPUT " ENTER: Number of SECONDARY turns (if known).....";TS
900 IF TS THEN TP=TS*I:GOTO 910
910 VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
920 PRINT TAB(9);;"Primary/Secondary turns ratio............";USING U1$;I;
930 PRINT ":1"
940 IF TP*TS=0 THEN 970
950 PRINT TAB(9);;"Number of PRIMARY turns..................";USING U3$;TP
960 PRINT TAB(9);;"Number of SECONDARY turns................";USING U3$;TS
970 PRINT UL$;
980 GOTO 1280
990 '
1000 '.....impedance matching transformers - turns known
1010 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
1020 PRINT "IMPEDANCE MATCHING TRANSFORMER:"
1030 PRINT UL$;
1040 INPUT " ENTER: Number of PRIMARY turns (if known).......";TP
1050 LOCATE CSRLIN-1:PRINT SPC(7);:LOCATE CSRLIN,50:PRINT USING U3$;TP
1060 INPUT " ENTER: Number of SECONDARY turns (if known).....";TS
1070 LOCATE CSRLIN-1:PRINT SPC(7);:LOCATE CSRLIN,50:PRINT USING U3$;TS
1080 IF TP*TS THEN R=TP/TS:GOTO 1120
1090 IF TP*TS=0 THEN VIEW PRINT 5 TO 24:CLS:VIEW PRINT:LOCATE 7
1100 INPUT " ENTER: Primary/Secondary turns ratio (if known).";R
1110 IF R=0 THEN 1000
1120 VIEW PRINT 7 TO 24:CLS:VIEW PRINT:LOCATE 7
1130 PRINT TAB(9);;"Primary/Secondary turns ratio............";USING U1$;R;
1140 PRINT ":1"
1150 INPUT " ENTER: Primary impedance (if known).............";ZP
1160 IF ZP THEN ZS=ZP/R^2:GOTO 1190
1170 INPUT " ENTER: Secondary impedance (if known)...........";ZS
1180 IF ZS THEN ZP=ZS*R^2:GOTO 1190
1190 VIEW PRINT 8 TO 24:CLS:VIEW PRINT:LOCATE 8
1200 IF ZP*ZS=0 THEN 1250
1210 PRINT TAB(9);;"Primary impedance........................";USING U1$;ZP;
1220 PRINT " ê"
1230 PRINT TAB(9);;"Secondary impedance......................";USING U1$;ZS;
1240 PRINT " ê"
1250 PRINT UL$;
1260 GOTO 1280
1270 '
1280 '.....end
1290 GOSUB 1330
1300 GOTO 120   'start
1310 END
1320 '
1330 'PRT
1340 KEY OFF:GOSUB 1410:LOCATE 25,5:COLOR 0,2
1350 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
1360 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
1370 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 1370 ELSE GOSUB 1410
1380 IF Z$="3"THEN RETURN
1390 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
1400 IF Z$="2"THEN LPRINT CHR$(12) ELSE 1340
1410 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
