![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fanuc Discuss Fanuc controllers here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
Hello Zoners, I want to be able to send a subprogram, within a main program, without my control separating them into two different programs. I've tried to use the chain command, but that means I have to send one and then send the other. Is it possible for me to send the two or three as a whole all at once. I am attaching a program as an example....... Thanks, Picman 2011: (PROVEN 10-24-2011 18:21:43) :2011(DEFECTOR BOLT FOR MFC MILL SLOT IN TAPERED SHAFT) (MAIN PROGRAM MULTIPLE OFF-SETS SEVERAL JOBS) (REMEMBER TO ALTER P NUMBER IF NEEDED FOR SUB) (LEADWELL/ JOHNFORD MACHINE FANUC 18M) (.219" DIA. DRILL) (TOOL #1) N100G00G80G91G28Z0 N101G90G54 N102M98P2000 N103G00G40G80Z1.0 N104G90G55 N105M98P2000 N106G00G40G80Z1.0 N107G90G56 N108M98P2000 N109G00G40G80Z1.0 N110G90G57 N111M98P2000 N112G00G40G80Z1.0 N119G80G91G28Z0M09 N121G90G0Y-12.0M01 N122M05 N123M00 (.250" HANITA VARI MILL) (TOOL #2) N100G00G80G91G28Z0 N101G90G54 N102M98P2001 N103G00G40Z1.0 N104G90G55 N105M98P2001 N106G00G40Z1.0 N107G90G56 N108M98P2001 N109G00G40Z1.0 N110G90G57 N111M98P2001 N112G00G40Z1.0 N119G80G91G28Z0M09 N121G90G0Y-12.0M01 N122M05 N123M30 O2000 (SUBROUTINE NUMBER OXXXX) (SUBROUTINE) (TOOL #1) N106S1000M03 N107G00X0Y0 N108G43Z1.0H1M08 N109G98G83Z-.6907R.1Q.125F3.5 N110G80 N111M99 O2001 (SUBROUTINE NUMBER OXXXX) (SUBROUTINE) (TOOL #2) N206S4500M03 N207G00X0Y0 N208G43Z1.0H2M08 N209G00Z.1 (PASS #1) N210G01Z-.084F25.0 N211X.677 N212G00Z1.0 N213X0 (PASS #2) N214Z.1 N215G01Z-.168F25.0 N216X.677 N217G00Z1.0 N218X0 (PASS #3) N219Z.1 N220G01Z-.261F25.0 N221X.677 N222G00Z1.0 N223X0 (PASS #4) N224Z.1 N225G01Z-.354F25.0 N226X.677 N227G00Z1.0 N228X0 (PASS #5) N229Z.1 N230G01Z-.447F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #6) N229Z.1 N230G01Z-.54F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #7) N229Z.1 N230G01Z-.633F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #8) N234Z.1 N235G01Z-.675F25.0 N236X.677 N237M99 |
|
#3
| ||||
| ||||
| you say 'send the two or three as a whole all at once' if you mean punch out multiple programs, just delete all the programs in the memory EXCEPT those you want to keep together (or punch unwanted programs then delete) then type..... O-9999 then press PUNCH Everything in the memory will be punched out in one file The outputted file will be one file and it will contain the main and subs. when you read it back in it will be in the control the same as it originally was (i.e. separate programs) |
|
#5
| ||||
| ||||
| read or send from what? a PC? If yes just create the file and include all of the programs. when you read it the CNC will have all of the programs in its memory. It sees the O's and creates a new program for every O. A file can contain multiple programs and the CNC will split them up into separate programs when it reads them in. |
| Sponsored Links |
|
#6
| ||||
| ||||
| i do understand this but, when i punch them back to my pc i want them as a whole. i dont want my machine to separate them. if i could just punch one program back it would make my life a lil bit easier. if it's not possible it's cool. i just thought it would be handy.
__________________ Picman "Never look a bounty hunter in the eyes" |
|
#7
| |||
| |||
| If you punch (send) all the programs back to an external device, frequently a PC, unless steps are taken at the PC to do otherwise, all the programs in the control's memory will be received as one program containing all the individual programs held in the control's memory. In many PC communication applications there is a function available to separate programs from one large program containing many individual programs on the basis of a preset character. With Fanuc controls, its either the character "O" or ":". However, in most cases the many programs being sent from the control will be received as one file. As Ford stated, with no action on your part whatsoever, if you were to send this one long program containing many programs back to the control, the control will split it back into the many individual programs again, and it does this based on the "O" contained in the one large program. If you want to have Sub programs all contained in one program in the way the HAAS control does, then you will have to remove all occurrences of "O"and ":", except for the first at the head of the program, and do as Beege suggested with the GOTO or M99 statements. This method required attention to detail with regards to sequence numbering. Regards, Bill Last edited by angelw; 11-17-2011 at 09:08 PM. |
|
#9
| ||||
| ||||
2011: (PROVEN 10-24-2011 18:21:43) :2011(DEFECTOR BOLT FOR MFC MILL SLOT IN TAPERED SHAFT) (MAIN PROGRAM MULTIPLE OFF-SETS SEVERAL JOBS) (REMEMBER TO ALTER P NUMBER IF NEEDED FOR SUB) (LEADWELL/ JOHNFORD MACHINE FANUC 18M) (.219" DIA. DRILL) (TOOL #1) N100G00G80G91G28Z0 N101G90G54 N102M98P2000 N103G00G40G80Z1.0 N104G90G55 N105M98P2000 N106G00G40G80Z1.0 N107G90G56 N108M98P2000 N109G00G40G80Z1.0 N110G90G57 N111M98P2000 N112G00G40G80Z1.0 N119G80G91G28Z0M09 N121G90G0Y-12.0M01 N122M05 N123M00 (.250" HANITA VARI MILL) (TOOL #2) N100G00G80G91G28Z0 N101G90G54 N102M98P2001 N103G00G40Z1.0 N104G90G55 N105M98P2001 N106G00G40Z1.0 N107G90G56 N108M98P2001 N109G00G40Z1.0 N110G90G57 N111M98P2001 N112G00G40Z1.0 N119G80G91G28Z0M09 N121G90G0Y-12.0M01 N122M05 N123M30 2000 (SUBROUTINE NUMBER OXXXX) (SUBROUTINE) (TOOL #1) N106S1000M03 N107G00X0Y0 N108G43Z1.0H1M08 N109G98G83Z-.6907R.1Q.125F3.5 N110G80 N111M99 2001 (SUBROUTINE NUMBER OXXXX) (SUBROUTINE) (TOOL #2) N206S4500M03 N207G00X0Y0 N208G43Z1.0H2M08 N209G00Z.1 (PASS #1) N210G01Z-.084F25.0 N211X.677 N212G00Z1.0 N213X0 (PASS #2) N214Z.1 N215G01Z-.168F25.0 N216X.677 N217G00Z1.0 N218X0 (PASS #3) N219Z.1 N220G01Z-.261F25.0 N221X.677 N222G00Z1.0 N223X0 (PASS #4) N224Z.1 N225G01Z-.354F25.0 N226X.677 N227G00Z1.0 N228X0 (PASS #5) N229Z.1 N230G01Z-.447F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #6) N229Z.1 N230G01Z-.54F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #7) N229Z.1 N230G01Z-.633F25.0 N231X.677 N232G00Z1.0 N233X0 (PASS #8) N234Z.1 N235G01Z-.675F25.0 N236X.677 N237M99
__________________ Picman "Never look a bounty hunter in the eyes" |
|
#10
| |||
| |||
| Get rid of all sequence numbers except for those at the start of each tool and at the start of what will be your pseudo Sub programs. In my opinion, except where sequence number are mandatory, they only consume memory. In normal circumstances I only use a sequence number at the start of each new tool. In the following example, I've used a variable for the return number. It will give you the flexibility to return to any where in the program from your pseudo subs. Regards, Bill % O1000 (MAIN PROGRAM) N1 G00 G17 G21 G40 G49 G80 G91 G28 Z0.0 G28 Y0.0 T01 M06 S2500 M03 .................... .................... .................... #1=1001 GOTO 2000 (CALL PSEUDO SUBPROGRAM LINE N2000) N1001 (RETURN FROM SUB AND CONTINUE FROM HERE) .................... .................... .................... #1=1002 GOTO 2000 (CALL PSEUDO SUBPROGRAM LINE N2000) N1002 (RETURN FROM SUB AND CONTINUE FROM HERE) .................... .................... .................... #1=1003 GOTO 3000 (CALL PSEUDO SUBPROGRAM LINE N3000) N1003 (RETURN FROM SUB AND CONTINUE FROM HERE) .................... .................... .................... M30 N2000 (PSEUDO SUB 2000) .................... .................... .................... GOTO #1 N3000 (PSEUDO SUB 3000) .................... .................... .................... GOTO #1 % |
| Sponsored Links |
|
#11
| ||||
| ||||
| i've never programmed in that way, but is helpful and interesting. i do appreciate the educational experience. i will try it and if you dont mind, i will let you know how it works out for me. \m/ THANKS
__________________ Picman "Never look a bounty hunter in the eyes" |
|
#12
| |||
| |||
| Following is your program modified so as to jump from Main to Pseudo Sub and return using GOTO statement. There are other ways, this is but one. If this is a real program that you use, test thoroughly before use. I didn't spend much time on it, but I believe it will be OK to use, if it was previously. Care must be taken if restarting the program mid program. Ensure that #1 is set to the correct return line number. Regards, Bill % O2011(DEFECTOR BOLT FOR MFC MILL SLOT IN TAPERED SHAFT) (MAIN PROGRAM MULTIPLE OFF-SETS SEVERAL JOBS) (REMEMBER TO ALTER P NUMBER IF NEEDED FOR SUB) (LEADWELL/ JOHNFORD MACHINE FANUC 18M) (.219" DIA. DRILL) (TOOL #1) N1 G00 G80 G91 G28 Z0 G90 G54 #1 = 1001 GOTO 2000 N1001 G00 G40 G80 Z1.0 G90 G55 #1 = 1002 GOTO 2000 N1002 G00 G40 G80 Z1.0 G90 G56 #1 = 1003 GOTO 2000 N1003 G00 G40 G80 Z1.0 G90 G57 #1 = 1004 GOTO 2000 N1004 G00 G40 G80 Z1.0 G80 G91 G28 Z0 M09 G90 G0 Y-12.0 M01 M05 M00 (.250" HANITA VARI MILL) (TOOL #2) N2 G00 G80 G91 G28 Z0 G90 G54 #1 = 1005 GOTO 2001 N1005 G00 G40 Z1.0 G90 G55 #1 = 1006 GOTO 2001 N1006 G00 G40 Z1.0 G90 G56 #1 = 1007 GOTO 2001 N1007 G00 G40 Z1.0 G90 G57 #1 = 1008 GOTO 2001 N1008 G00 G40 Z1.0 G80 G91 G28 Z0 M09 G90 G0 Y-12.0 M01 M05 M30 N2000 (PSEUDO SUBROUTINE NUMBER 2000) (SUBROUTINE) (TOOL #1) S1000 M03 G00 X0 Y0 G43 Z1.0 H1 M08 G98 G83 Z-.6907 R.1 Q.125 F3.5 G80 GOTO #1 (RETURN TO MIAN PROGRAM) N2001 (PSEUDO SUBROUTINE NUMBER 2001) (SUBROUTINE) (TOOL #2) S4500 M03 G00 X0 Y0 G43 Z1.0 H2 M08 G00 Z.1 (PASS #1) G01 Z-.084 F25.0 X.677 G00 Z1.0 X0 (PASS #2) Z.1 G01 Z-.168 F25.0 X.677 G00 Z1.0 X0 (PASS #3) Z.1 G01 Z-.261 F25.0 X.677 G00 Z1.0 X0 (PASS #4) Z.1 G01 Z-.354 F25.0 X.677 G00 Z1.0 X0 (PASS #5) Z.1 G01 Z-.447 F25.0 X.677 G00 Z1.0 X0 (PASS #6) Z.1 G01 Z-.54 F25.0 X.677 G00 Z1.0 X0 (PASS #7) Z.1 G01 Z-.633 F25.0 X.677 G00 Z1.0 X0 (PASS #8) Z.1 G01 Z-.675 F25.0 X.677 GOTO #1 (RETURN TO MAIN PROGRAM) % Last edited by angelw; 11-18-2011 at 02:06 AM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Absolute Main Program, Incremental Sub | eliot15 | GibbsCAM | 0 | 10-18-2011 04:31 PM |
| Main program vs. subroutine info for Hass VF | fattybean | G-Code Programing | 5 | 01-09-2011 07:18 PM |
| How to subprogram edge find into main program | petrarmb | EDM Machines | 0 | 12-07-2010 04:28 PM |
| Storing Sub-program within main on 21iT? | Jdavis733 | Fanuc | 10 | 02-12-2008 11:56 AM |
| Fanuc output program + subprograms | Mr_T | Fanuc | 9 | 11-29-2005 12:21 AM |