15
iterface program coue for CNC machines appears r. It is written in GWBASIC. Lines 10 - 150s Opens the file POS which contains screen positions needed in order to draw the company logo. It draws the logo and then closes the file. (See figure E.l). Lines 160 - 290* Prints the bottom line of the "STANDBY MODE" screen. (See figure E.l). This section also alters the bottom line of the screen once the part program has been located and is ready to be transmitted. The 5-digit code is disDlaved and the words "STANDBY MODE" are repj TRANSMIT MODE Lines 6/0 - 760* This section of code sets the environment for the serial data transfer. In line 700 the serial port on the PC is initialised with a b?ud rate of 300, even ...... parity anti seven bits per byte. Line 720 initialises the two variables XOFF and XON. Line 730 sets a standby interrupt- that is activated whenever a character is received on pin3. The control of the program is passed to line 880 whenever the interrupt occours. Lines 760 - 810* This section of code actually transmits t the character . A character is read from a file into the variable A$. It is then sent to the serial port . ine 790) and also displayed on the screen (line 800). As characters are transmitted, the blocks of the part program scroll up

Lines 160 - 290* Prints the bottom line of the STA NDBY

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

iterface program coue for CNC machines appears r. It is written in GWBASIC.

Lines 10 - 150s Opens the file POS which contains screen positions needed in order to draw the company logo. It draws the logo and then closes the file. (See figure E.l).

Lines 160 - 290* Prints the bottom line of the "STANDBY MODE" screen. (See figure E.l). This section also alters the bottom line of the screen once the part program has been located and is ready to be transmitted. The 5-digit code is disDlaved and the words "STANDBY MODE" are repj

TRANSMIT MODE

Lines 6/0 - 760* This section of code sets the environment for the serial data transfer. In line 700 the serial port on the PC is initialised with a b?ud rate of 300, even

......parity anti seven bits per byte. Line 720 initialises the two variables XOFF and XON. Line 730 sets a standbyinterrupt- that is activated whenever a character is received on pin3. The control of the program is passed to line 880 whenever the interrupt occours.

Lines 760 - 810* This section of code actually transmitstthe character . A character is read from a file into the

variable A$. It is then sent to the serial port . ine 790) and also displayed on the screen (line 800). As characters are transmitted, the blocks of the part program scroll up

T-4U32t \ nil? <-5W?2< \HIM i*i X-3HS224 *-44-4!i-KTWf-fciaat! *1M X-MS224 » - m 8 2 ( n M t l ?-4 .> 3 2 **iu «: *- « r -4(j, “"l!-' WTVT'M f̂ W " *114 f-«fc£ B f f.190* ,

* \t wHj1 : - ■ i ., <

M5224 j - « ,2 3 2 « \34K24 J-tti3M

Fig E.1 The STANDBY MODE Screen

The TRANSMIT MODE Screen

Line 830 - 870* This section of code terminates the data transmission session. It closes all the files and de­activates the serial port on the PC. It also passes control to line 10 of the* program where the company logo is redrawn. This section of code is the last section to run during each data transmission session.

Line 880 - END* This sec cion controls the XON/XOFF receiving routine th.,nt allows software handshaking to take place. When a character is received on pin3 by the PC, the control of the program is passed to line 880. Here the character is read by the PC, and if it is an XOFI' characterthe variable XFLAG is set to 0. (Line 950). Control is then passed back via the RETURN statement in line 960 and the program continues. When line 780 is reached, (just befo.e a character is transmitted each time), the program is placed

.

into an endless loop. It remains in this endless loop until an XOFF character is received on pin3 and the variab.1 a XFLAG is set to 1. The serial transmit routine thencontinues

10 OPEN "POS" FOR INPUT AS 2 20 KEY OFF 30 CLS40 DEFINT A-Z 50 INPUT# 2,NUM60 IF NUM"0 THEN INPUT# 2,ROW:GOTO 7070 INPUT# 2,NUM80 COL=NUMSO LOCATE ROW,COL100 PRINT CHR$(219)110 INPUT# 2,NUM120 IF NUM=0 GOTO 60130 IF NUM=1 GOTO 140 ELSE GOTO 20140 LOCATE 25,1150 CLOSE 2160 FOR I - 1 TO 60170 PRINT CHR$(205);JdO NEXT I190 PRINT CHR$(1);200 COLOR 31,0210 PRINT " STANDBY MODE ";220 COLOR 15,0230 PRINT CHR$(1^;CHR$(205);CHR$(205);240 LOCATE 25,3 25C COLOR 0,15260 PRINT " PUSH ENTER TO ACTIVATE270 LOCATE 14,23:PRINT "COMPANY LOGO NORMALLY APPEARS HERE 280 LOCATE 10,40 290 INPUT " ",A$300 COLOR 7,0310 LOCATE 13,20:PRINT "320 LOCATE 14,20:PRINT "330 LOCATE 15,20:PRINT "340 LOCATE 16,20:PRINT "350 ON ERROR GOTO 420 360 LOCATE 14,20370 PRINT " ENTER PART NUMBER TO TRANSMIT 380 PRINT CHR$(16);390 INPUT " ",DSKFIL$400 OPEN DSKFIL$ FOR INPUT AS 3 410 GOTO 510 420 LOCATE 15,20 430 PRINT "440 COLOR 16,7450 PRINT "CANNOT FIND";460 COLOR 7,0470 PRIN*' * " ;CHR$( 16); " ";480 PRINT DSKFIL$490 CLOSE 500 RESUME 360 510 LOCATE 15,20 520 PRINT "530 LOCATE 25,1 540 FOR I - 1 TO 60 550 PRINT CHR$(205);560 NEXT I

570 PRIHT CHR$(1);580 COLOR 31,0590 PRINT " TRANSMIT MODE ";600 COLOR 15,0CIO PRINT CHR$(1);CHR$(205);CHR$(205) ;620 LOCATE 25,3 630 COLOR 0,15640 PRINT " FILE: ";DSKFIL$;" "J

680 RSM ********* SERIAL TRANSMIT ROUTINE 690 REM700 COMFIL$“"COM1*300,E,7"710 ''PEN COMFIL$ AS 17 20 XOFF$-CHR$(19)*XON$=CHR$(17730 ON COM(l) GOSUB 880740 COM(x) ON7*0 XFLAG-1760 WHILE NOT EOF(3)770 A$»INPOT$(l,3)780 WHILE XFLAG-OtWEHD790 PRINT #1 (A$), *jaKeMs&.800 PRINT A$;810 FOR I - 1 TO 60:NEXT I820 WEND830 COM(l) OFF840 PRINT *1,CHR$(26)850 CLOSE *1 860 CLOSE 870 GOTO 10890 REM ********* XON/XGF? Rf.CSfV V J 900 REM •drrfe910 IF EOF(') THEN RETURN 920 B$“INPUT$ (LO«J( 1), i)930 IF LEN(B$)-2 THEN 950940 IF B$«XOFF$ THEN 970950 XFLAG-1960 RETURN970 XFLAG-0980 RETURN

In order to run the BTR Interface for CNC machine an IBM PC/XT/AT or compatible machine with 640K memory and afloppy disk drive is required. The monitor may be color ort "■monochrome. (~he BTR Interface screen displays are in

Sv- .monochrome only.) Perform the Following Instructions :

1) Place the floppy disk marked *BTR Interface for NC machines" in the floppy drive and close the door. Remove any printer/potter/modem cable from the serial port at the rerr of the system unit.

2) Turn on the machine and wait until the screen display in figure G.l is displayed. Press ENTER/RETURN to activate the program.

codes and press ENTER/RETURN

4) To end the session, switch off the machine andremove the floppy disk

POSITION

% (93A04-0007-401 2 786667 AJU02 1988:01:20 N1 Ml 8 N2 G66 N3 G90N4 GOO XO YO ZO N5 Y-3S9460 N6 T0101 MO6N7 ( **** TOOLPATH NO 1 ****N8 ( **** FIXTURE TO REMAi ’ IN STAGE N9 ( **** FROM TAPE ONE **** )N10 /***♦ LOAD 80 DIA SHELL END MILL,NME 061,L = 115 ****) N11 (**** ROUGH MILL FRAME THICKNESS TO 39 MM STAGE 2****' N12 S24 M15N13 GOO X-484897 Y-381782 M03 N14 Z-212794 N15 G01 Z-219794 F5000 N16 X-495374 Y-389266 F1400 M08 N17 Y-462320 N18 X-1321686 N19 Y-3892S6 N20 Z-197794 F10000 N21 GOO X-482806 Y-382305 N22 Z-212794 N23 G01 Z -224794 F5000 N24 X-495374 Y-389266 F1400 N25 Y-462320 N26 X-1217454N27 X-1308743 Y-462466 Z-217794 N28 X-1303o„. Y-385001 N29 Z-212794 F10000 N30 GOO X-479814 Y-379573 N31 G01 Z-229794 F5000 N32 X-495374 Y-389266 F1500 N33 Y-462320 N34 X-960661 N35 Y-494374 N36 Y-389266 N37 X-1097260 N38 Y-494374 N39 Y-462320 N40 X-1217454 N41 X-1333491 Z-217794 N42 Y-389266 N43 Z-212794 F1000 N44 GOO X-479814 Y-380067 N45 G01 Z-233794 F5000 N46 X-495374 Y-389266 F1500 N47 Y-462320 N48 X-960661 N49 Y-494374 N50 Y-389266 N51 X-1095260 F500C N52 Y-494374 F1500 N53 Y-4623 N54 X-1217^54

N56 Z-197794 F1000GHfe

1O

i

JN57 M09 N58 GOO ZO N59 MO5 N60 Y-369461 H61 T0202 M06 N62 ( **** TOOLPATH NO 2 ***“ )N63 ( **** LOAD 30 DIA SLOT DRILL,NMS 127,L = 150 N64 ( **** CREATE ENTRY IN POCKETS FOR RIPPER **** N65 S25 M15 N66 MO3N67 GOO X-1197232 Y-462466 M08 N68 Z-197794 N69 G01 Z-215794 F1200 N70 GOO Z-177794 N71 X-1106444 N72 Z-197754 N73 G01 Z-223794 N74 GOO Z-177794 N75 X-986053 N76 Z-197794 N77 G01 Z-211294 N78 GOO Z-177794 N79 X-946580 Y-463453 N80 Z-197794 N81 G01 Z-215794 N82 GOO Z-177794 N83 X-861713 N84 Z-197794 N85 G01 Z-215794 N86 GOO Z-177794 N87 X-803491 Y-462466 N88 Z-197794 N89 G01 r-215794 N90 GOO Z-177794 N91 X-728387 N92 Z-197794 N93 G01 Z-214294 N94 GOO Z-177794 N95 X-591324 Y-462960 N96 Z-196794 N97 G01 Z-221794 N98 GOO Z-196794 N99 MO9 N100 ZON101 (♦*** TOOLPATH NO 20 **** ,N102 (♦*** REMOVE EXCESS MATL FROM POCKET 8-STAGE 1 N103 GOO X-369080 Y-462303 N104 Z-252794 N105 G01 Z-267794 F5000 N106 Y-462320 F1000 N107 X-362724N108 G02 X-345224 Y-444820 1-345224 J-462320 N109 X-327724 Y-462320 1-345224 J-462320 N110 X-345224 Y-479320 1-345224 J-462320 Nlll X-362724 Y-462320 1-345224 J-462320

**** j )

107

N112 N113 N114 N115 N116 N117 N118 N119 N120 N121 N122 N123 N124 N123 N126 N127 N128 N129 N130 N131 N132 N133 K134 N135 N136 N137 N138 N139 N140 N141 N142 N143 N144 N145 N146

G01 X-368217 Y-462627 Z-275794 F5000 Y-462320 F1000 X-362724G02 X-345224 Y-444820 1-345224 J-462320 X-327724 Y-462320 1-345224 J-462320 X-345224 Y-479820 1-345224 J-462320 X-362724 Y-462320 1-345224 J-462320 G01 X-364120 Y-480527 X-364013 Y-482673 X-3620^7 Y-482560 X-355222 Y-482146 X-347802 Y-481655 X-341308 Y-481173 X-334750 Y-480649 X-331724 Y-480380 X-322065 Y-462195 F3500 X-329182 Y-446668 X-329009 Y-444497 X-334750 Y-443991 X-341308 Y-443467 X-347802 Y-442985 X-355222 Y-442494 X-358724 Y-442276 X-359591 Y-446344 Z-237794 F10000 GOO X-257581 Y-462519 ^-252794G01 2-272794 F100C Z-237794 F5000 HO 9GOO ZO MO 5 XO YO M30

F10C0

I f e

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.