PN50 GOO - University of the Witwatersrand

15
% (2-500-00-49r-8 2 113926 AJL01 1988:01:11 07:40:49 ) N5 ( ** TOOL* .fH 2,CENTRE DRILL,LEVEL 11 ** ) JM10 T1001 M06 K15 M40 N20 GOO G90 G94 XO Y60. B354.5 S1000 M03 N25 F50. M17 <ZR=100.> <Z02.> <ZD=2.> N30 <ZA=-514.161> N35 X-245.729 Y-311.444 N40 Z-414.161 N45 G80 N50 GOO P N55 G27 <RETRCT,TOOLNO=1001> N60 GOO N65 B264.5 N70 <ZA— 514.161> N75 X-245.731 Y-306.444 N80 Z-414.161 N85 G81 N90 GOO Y-316.444 N95 G81 N100 GOO N105 G27 <RETRCT,TOOLNO=1001> N110 GOO N.i15 B144.5 N120 <ZA=-514.161> N125 Z-414.161 N130 G81 N135 GOO Y-306.444 N140 G81 N145 GOO N150 G27 <RETRCT,TOOLNO=1001> N155 GOO N160 B24.5 N165 <ZA*-514.161> N170 Z-414.161 N175 G81 N180 GOO Y-316.444 N185 G81 N190 GOO N195 G27 <RETRCT,TOOLNO=1001> N200 GOO N205 ( ** TOOLPATH 3,DRILL 6.5 DIA HOLES,LEVEL 12 ** ) :N210 T2002 M06 N215 S600 MO3 N220 F36. M17 <ZR«100.> <ZC*2.> <ZD*4.> N225 GOO G90 G94 X-245.731 Y-306.444 B24.5 N230 <ZA— 514.161> N235 Z-414.161 N240 G81 N245 GOO Y-316.444 N260 G27 <RETRCT,TOOLNO-2002>

Transcript of PN50 GOO - University of the Witwatersrand

Page 1: PN50 GOO - University of the Witwatersrand

% (2-500-00-49r-8 2 113926 AJL01 1988:01:11 07:40:49 ) N5 ( ** TOOL* .fH 2,CENTRE DRILL,LEVEL 11 ** )JM10 T1001 M06 K15 M40N20 GOO G90 G94 XO Y60. B354.5 S1000 M03 N25 F50. M17 <ZR=100.> <Z02.> <ZD=2.>N30 <ZA=-514.161>N35 X-245.729 Y-311.444 N40 Z-414.161 N45 G80 N50 GOOPN55 G27 <RETRCT,TOOLNO=1001>N60 GOO

N65 B264.5N70 <ZA— 514.161>N75 X-245.731 Y-306.444 N80 Z-414.161 N85 G81N90 GOO Y-316.444 N95 G81 N100 GOON105 G27 <RETRCT,TOOLNO=1001>N110 GOON.i 15 B144.5N120 <ZA=-514.161>N125 Z-414.161 N130 G81N135 GOO Y-306.444 N140 G81 N145 GOON150 G27 <RETRCT,TOOLNO=1001>N155 GOON160 B24.5N165 <ZA*-514.161>N170 Z-414.161 N175 G81N180 GOO Y-316.444 N185 G81 N190 GOON195 G27 <RETRCT,TOOLNO=1001>N200 GOON205 ( ** TOOLPATH 3,DRILL 6.5 DIA HOLES,LEVEL 12 ** ) :N210 T2002 M06 N215 S600 MO3N220 F36. M17 <ZR«100.> <ZC*2.> <ZD*4.>N225 GOO G90 G94 X-245.731 Y-306.444 B24.5 N230 <ZA— 514.161>N235 Z-414.161 N240 G81N245 GOO Y-316.444

N260 G27 <RETRCT,TOOLNO-2002>

Page 2: PN50 GOO - University of the Witwatersrand

N280 Z-414.161 N285 GP1N290 GOO Y-306.444 N295 G91 N300 GOON305 G27 <RETRCT,TOOLNO=2002>N310 GOO N315 B144.5 N320 <ZA— 514.16J>N325 Z-414.161 N330 G81N335 GOO Y-316.444 N340 G91 N345 GOON350 G27 <RETRCT,TOOLNO=2002>N355 GOON36Q ( ** TOOLPATH 4,DRILL 8 DIA HOLES,^ 'VEL 13 ** ) ;N365 T3003 M06 N370 S400 M03N375 F28. M17 <ZR=100.> <ZC=2.> <ZD=4.>N380 GOO G90 G94 X-245.731 Y-316.444 B144.5 N385 <ZA— 514.16i>N390 Z-414.161 N39S G81 N400 GOON405 G2 <RETRCT,TOOLNO=3003>N410 GOo N415 B24.5 N420 <ZA“-514.161>N425 Z-414.161 N430 G81 N435 GOON440 G27 <PETRCT,TOOLNO=3003>N445 GOO N450 B264.5 N455 <ZA=-514.161>N460 Z-414.161 N465 G81 N470 GOON475 G27 <RETRCT,TOOLNO=3003>N480 GOON485 ( ** TOOLPATH 5,DRILL 6.2 DIA HOLE,LEVEL 14 ** :N490 T4004 M06N495 GOO G90 G94 X-245.731 Y60. B354.5 S600 M03N500 F36. M17 <ZR*iOO.> <ZC“2.> <iu=4.> N505 <ZA*-514.161>N510 X-245.729 Y-311.444 N515 Z-414.161 N520 G81 N525 GOON530 C27 <RETRCT,TOOLNO*4004>N535 GOON540 G27 <RETRCT>N545 M30

Page 3: PN50 GOO - University of the Witwatersrand
Page 4: PN50 GOO - University of the Witwatersrand

112

routine is written in GWBASIC. The routine isThe BTR Furcalled by the following MS-DOS batch file called "PUNCH" s

ECHO OFF CLSGWBASIC PUNCHCOPY C:\POST\PUNOUT C:\BTR\AA132.NCP COPY C:\POST\PUNOUT B:\AA132

When the NC programmer enters the word "PUNCH" into the PC containing the BTR Database and Utilities, the above MS-DOS batch file executed. The first, two lines simply clear the screen. The third li.i3r (GWBASIC PUNCH), envokes the GWBASIC BTR Punch routine. The routine itself will be explained further on in this section, but the method used to actually copy files onto the BTR Database, copy files onto floppy disc, print files and to convert files to the correct format needs to be explained here

As mentioned in section 7.2, the original NC part program may originate from one of thre * different sources. FigureJ.l illustrates the process the NC part program needs to gc

. . . . . .through depending on it's source.

The GWBASIC BTR Punch routine will edit the MS-DOS batchfile that invoked it and insert the relevant DOS commands to do the converting, copying and printing according to the source of the NC part program. When the G* tS'C BTR Punch routine terminates, the MS-DOS batch file will continue and perform the now revised commands, (line 4 onwards), placed

Page 5: PN50 GOO - University of the Witwatersrand

SOURCE :POST PROCESSORS

SOURCEmpbr »pe

FILE ON HARO CISK AS :C :\F O S l\P U N O J T

ACTUAL ASCII NC M R T PROORAIk IN CORRECT FORMAT THAT CAN BE USED ON SHOP FLOOR

FLOPPY DISK PRINTER

Fig J.1 NC Part Program Sequence during BTR Punch Routine

there by the GWBASIC DTR Punch routine during execution of the previous command. For example, assume the NC programmer s*. cified the following :

Auxiliary SystemsFile Name to

AA289at $s|is yes

Store on Dbase Copy to Floppy Print required

Page 6: PN50 GOO - University of the Witwatersrand

114MMThe GWBASIC BTR Punch routine would edit the MS-DOS batch

file that invoked it and alter it as follows :

ECHO OFF CLSGWBASIC PUNCH CNVRT_UVCOPY C:\POST\PUNOUT C:\BTR\AA289.NCP COPY C:\POST\PUNOUT B:\AA2E9 PRINT C:\POST\PUNOUT ECHO ON CLS

During execution of line three above, the lines 4 to 9 are inserted according to the process described in figure J.land the input supplied by the NC programmer.

3fc‘-

The GWBJ-.3IC BTR Punch routine program code appears in Appendix

Lines 1C-20 s This section of the code displays prompts on the screen and allows the user to specify the source of the NC part program. If the source is the tape reader, the Asynchronous Communications Subroutine, (lines 810-1440), is invoked.

Lines 180-430 * Phis section prompts the user to specify a file name in order to store the NC part program in the

The filename is checked to see if it is thea?.-*'- - Q?. Irequired 5 digits long. If the filename already exists on the database, the user is prompted for confirmation t< overwrite the existing file.

1 ! '

Page 7: PN50 GOO - University of the Witwatersrand

Lines 440-500 * Allows the user to option.

Lines 510-64ft * Allows the user to sj

ULnea 650-800 * This section edits the MS-DOS batch fxle "PUNCH.BAT" according to the input supplied by the user. The lines 790 and 800 terminate this GWR\SIC program.

Lines 810-870 * This section serves no purpose but to separate the Asynchronous Subroutine from the rest of the code. The routine is a standard GWBASIC RS-232 communication subroutine for operation under MS-DOS.

Lines 880-1010 : This section prompts the user tor trvformat of the paper tape. (Either ASCII RS-358 or EIA RS

Wh'244-A).

Lines

Lines 1090-1110 * This section used further on.

Line 1120 * Specifies the line number of the

Page 8: PN50 GOO - University of the Witwatersrand

statement of the GWBASIC COM trap routine associated withchannel number 1.

Lines 1130-1140 * Opens and initializes communications channel 1 with the speed of 4800 bits per second and even parity and 7 data bits or odd parity and 8 data bits depending on the format of the paper tape. (See. line 1010).\ i’'•"to.1Lines 1150-1160 * Opens a file called "READERIN".Charact' rs received from the tape reader are placed in this file.

Line 1170 s Checks to see if characters are pending on the receive buffer. If no characters are pending, contij1 is transferred to st* -emeT»t 1240, otherwise to the following statement (line 1180).

Line 1180 * Checks if the number of characters in the receive buffer is greater than 50. If the number is greater than 50, it sends an X0FF$ characte- to the channel to stop transmission. . -v: •

Lines 1190-1200 : If the number of characters in thereceive buffer is less than or egual to 50, characters aneread from the receive buffer and written to the file

• v-

B B H H v ♦ •

“READERIN’• ' V

■ 9 K .

Lines 121C-1230 : Checks if there are still characters on- * 'C--

Page 9: PN50 GOO - University of the Witwatersrand

1180. If not, an X0N$ character is sent (if an X0FF$ wassent before) and control is transferred to statement 1170.

Lines 1240-1260 s A FOR/NEXT loop ia activated to wait until characters arrive in the receive buffer. If nocharacter arrives within the specified number of iterations, control is transferred to statement 1270 which terminates the session, if characters do arrive, control istransferred to statement

Lines 1270-1280 : These lines close the file "READERIN” and transfer control to line 1400 to terminate the session.

Lines 1290-1390 t These lines form the COM trap routine. Statement 1320 checks if characters are pending in the

-

receive buffer. If no character is pending a RETURN is executed. If two characters are pending, the transmissionf characters is enabled, (statement 1360) and the routine is exited (RETURN). Two characters in the receive buffer means that both an XON$ and an XOFF$ have jeen received. If only one character is pending the transmission of characters is disabled (if this character is XOFFS} or

Page 10: PN50 GOO - University of the Witwatersrand
Page 11: PN50 GOO - University of the Witwatersrand

*

119

U

O

10 LOCATE 2,28 20 COLOR 0,430 PRINT " BTR PUNCH ROUTINE 40 COLOR 7,0 50 LOCATE 6,6 60 COLOR 7,170 PRINT "DO YOU WANT TO PUNCH A UNIVAC FILE80 LOCATE 7,6 „90 PRINT " OR A POST PROCESSOR FILE - P100 LOCATE 8,6110 PRINT " OR READ IN FROM THF. TAPE READER - 120 LOCATE 8,50 130 PRINT "IP]~

.. 140 LOCATE 8,50 150 INPUT "[",C$160 IF C$ = "T" THEN GOSUB 880 170 IF C$ * "t" THEN GOSUB 880 180 COLOR 7,0 190 GOTO 240200 PLAY "T180 05 P8 L6 E-"210 LOCATE 10,56 220 COLOR 20,0230 PRINT " INVALID FILENAME250 LOCATE 10,6260 PRINT "ENTER FILENAKE TO STORE ON HARD DISC 270 LOCATE 10,50 280 INPUT ">",A<290 IF LEN(A$) <> 5 THEN GOTO 200 300 ON ERROR GOTO 410 310 FC = •C:\BTR\"+A$+".NCP"120 OPEN "I",#1,F$330 CLOSE #1340 PLAY "T180 05 P8 L6 E- 330 LOCATE 10,56 360 COLOR 4,0370 PRINT " OVERWRITE ? [Y]380 LOCATE 10,73 390 INPUT "[",E$400 IF E$-"N" THEN GOTO 240 410 COLOR 7,0 420 LOCATE 10,60 4 30 PRINT "440 LOCATE 12,6 450 COLOR 7,1460 PRINT "DO YOU WANT A PRINTOUT OF THE NC PROGRAM" 470 LOCATE 12,50 480 PRINT "[N]“490 LOCATE 12,50 500 INPUT "t",D$510 LOCATE 14,6520 PRINT "DO YOU WANT ";A$;" ON A FLOPF/ DISK ?530 LOCATE 14,50 540 PRINT "(YJ- 550 LCCATE 14,50 560 INPUT "[".J$

Page 12: PN50 GOO - University of the Witwatersrand

570 IF (J$="") OR (J$="Y") THEN GOTO 580 ELSE GOTO 6C0580 LOCATE 14,6 „590 PRINT "PLACE DISC IN DRIVE B: AND CLOSE DOOR 600 IF (D$="Y") THEN GOTO 610 ELSE GOTO 650 610 LOCATE 1.5,6620 PRINT ’PREPARE PRINTER IF NEEDED - PUSH ENTER 630 LOCATE 15,50 640 INPUT "[READY]",B$650 OPEN "0",#1,"PUNCH.BAT"660 PRINT #i,"ECHO OFF"670 PRINT #1,"CLS"680 PRINT #1,"GWBASIC PUNCH"690 IF C$="U" THEN PRINT #1,"CNVRT_UV"700 IF C$»"u* THEN PRINT *1,"CNVRT_UV"710 IF C$**T" THEN PRINT *x,"CNVRT_TR"720 IF C$="t" THEN PRINT #1,"CNVRT_TR"730 PRINT #1,"COPY C:\POST\PUNOUT CJ\Si *\'?(J$ = " ") THEM

NCP""COPY740 IF (J$®"Y") OR

Cs \POST\PUNOUT fls";A$750 IF (D$="Y") THEN PRINT #1,"PRINT C:\POSTxPUNOUT 760 PRINT #1,"ECHO ON"770 PRINT #1,"CLS 780 CLOSE #1 790 SYSTEM 800 END 810 REM820 REM ******************************************** 830 REM840 REM ASYNCHRONOUS COMMUNICATION SUBROUTINE850 REM *********860 REM **********************************870 REM 880 LOCATE 6,6 890 COLOR 7,1 900 PRINT "910 LOCATE 7,6 920 PRINT "930 LOCATE 8,6 940 COLOR 7,950 PRINT "960 COLOR 7,1 970 LOCATE 7,50 980 PRINT "[E]"990 LOCATE 7,50 1000 INPUT "(",H$1010 IF H$ * "I" THEN H$ * "E,7" ELSE H$1020 LOCATE 8,6 __1030 PRINT " PREPARE THE TAPE READER - PUSH ENTER1040 LOCATE 8,50

IS THE TAPE ISO OR EIA

”N, 8

Page 13: PN50 GOO - University of the Witwatersrand

1211120 1130 1140 1150 1160 1170 1180 1190 1200 1210 1220 1230 1240 1250 1260 1270 1280 1290 1300 1310 1320 1330 1340 1350 1360 1370 1380 1390 1400 1410 1420 1430 1440

ON COM(l) GOSUB 1300 COKFIL$="COM1.4800,-+H$OPEN COMFILS AS 1 DSKFILf=“READERIN"OPEN DSKFIL$ FOR OUTPUT AS 3 IF EOF(1) THEN GOSUB 1240IF LOC(1)>50 THEN PAUSE*TRUESPRINT #l,XOFF$ A$«INPUTS(LOC(l),l)PRINT#3,A$;IF LOC(1)>0 THEN 1180IF PAUSE THEN PATJSE-FALSE:PRINT #l,XON$; GOTO 1170 FOR I-l TO 5000 IF NOT EOF(1) THEN RETURN NEXT I CLOSE #3 RETURN 1400 REMREM *** XON/XOFF RECEIVING ROUTINE ***REMIF EOF(1) THEN RETURN B$-INPUT$(LOC(1),1)IF LEN(B$S2 THEN 136C IF B$=XOFF$ THEN 1380 XFLAG-1 RETURN XFLAG-0 RETURN LOCATE 8,50 COLOR 2,0PRINT "TAPE READING COMPLETEDCLOSE #1 GOTO 240

Page 14: PN50 GOO - University of the Witwatersrand
Page 15: PN50 GOO - University of the Witwatersrand

Author Hill Mark Jeffrey Name of thesis The networking of NC and CNC machines to facilitate the electronic transfer of CAD/CAM data. 1989

PUBLISHER: University of the Witwatersrand, Johannesburg

©2013

LEGAL NOTICES:

Copyright Notice: All materials on the Un i ve r s i t y o f the Wi twa te r s rand , Johannesbu rg L ib ra ry website are protected by South African copyright law and may not be distributed, transmitted, displayed, or otherwise published in any format, without the prior written permission of the copyright owner.

Disclaimer and Terms of Use: Provided that you maintain all copyright and other notices contained therein, you may download material (one machine readable copy and one print copy per page) for your personal and/or educational non-commercial use only.

The University of the Witwatersrand, Johannesburg, is not responsible for any errors or omissions and excludes any and all liability for any errors in or omissions from the information on the Library website.