![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I have a fanuc control on a router. I have a set of 9 profiles that are the same I thought I could enter the g code for one and then set that as a subroutine and jest move the start points for each. When the program runs it will run the first six and then move to each location for the last three but only briefly stops at each location and then moves to the next, finaly ending the list for calls for the subs it will finish the rest of the program and stop. why wont it cut the last three parts? |
|
#2
| |||
| |||
Regards, Bill |
|
#3
| |||
| |||
| This is a program to cut some small wooden men. I have 9 to a set they are numbered 1-9 I have not tackled the engraving yet I will get back to that when the rest of this runs. My thoughts are to number the programs 0901-0909 for the engraving and to use the sub of 0900 for cutting them out. I will engrave the same number on each one in a set of 9 because it is easy to toss them into corresponding buckets rather than sorting the numbers afterward for individual sets as I have mentioned things go great untill it reaches the seventh rep on the sub and then it skips through to the end and shuts down. O0901 MO6 S 5000 M3 G90 G0 X-11. Y-22. Z-8. M98 P0900 G90 G0 X-11. Y-19.688 M98 P0900 G90 G0 X-11. Y-17.376 M98 P0900 G90 G0 X-11. Y-15.064 M98 P0900 G90 G0 X-11. Y-12.752 M98 P0900 G90 GO X-11. Y-10.44 M98 P0900 G90 G0 X-11. Y-8.128 M98 P0900 G90 G0 X-11. Y-5.816 M98 P0900 G90 G0 X-11. Y-3.504 G54 G40 G49 G28 X0Y0Z0 M15 M30 O0900 G91 G01 Z-0.75 X0.3125 Y-0.3107 G03 X0.25 Y-0.25 I0.25 J0. G01 X0.2777 G03 X0.25 Y0.25 I0. J0.25 X-0.1661 Y0.2355 I-0.25 J0. G01 X-0.0624 Y0.0222 X0.0173 Y0.1629 G03 X0.0014 Y0.0264 I-0.2486 J0.0264 X-0.0837 Y0.1866 I-0.25 J0. G01 X-0.2148 Y.1914 X0.2759 Y0.089 G03 X0.1797 Y0.2399 I-0.0703 J0.2399 X-0.25 Y0.25 I-0.25 J0. G01 X-0.3841 X0.0624 Y0.0222 G03 X0.1661 Y0.2355 I-0.0839 J0.2355 X-0.0694 Y0.1728 I-0.25 J0. X-0.2667 Y0.2247 I-1.1742 J-1.1234 X-0.2792 Y0. I-0.1396 J-0.2074 X-0.2667 Y-0.2247 I0.9075 J-1.348 X-0.0694 Y-0.1728 I0.1806 J-0.1728 X0.1661 Y-0.2355 IO.25 J0. G01 X0.0624 Y-0.0222 X-0.3841 GO3 X-0.25 Y-0.25 I0. J-0.25 X0.1797 Y-0.2339 I0.25 J0. G01 X0.2759 Y-0.0809 X-0.2148 Y-0.1914 GO3 X-0.0837 Y-0.1866 I0.1663 J-0.1866 X0.0014 Y-0.0264 I0.25 J0. G01 X0.0173 Y-0.1629 X-0.0624 Y-0.0222 G03 X-0.1661 Y-0.2355 I0.0839 J-0.2355 X0.25 Y-0.25 I0.25 J0. X0.2777 G03 X0.25 Y0.25 I0. J0.25 G01 Y0.3107 G01 X0.3125 G00 Z0.75 M99 |
|
#4
| |||
| |||
I haven’t waded through your incremental sub program, but if the tool ended where it started in X and Y, you could add at the end of the sub program the Y pitch of the parts, and call the sub from the main program in the following way to have the sub repeat 9 times, but there would be an extra Y 2.312 move at the end of machining the 9 parts. If your control has the User Macro option, you could achieve your desired result more eloquently using a Macro statement. Give calling the sub program and have it repeat 9 times a go to see if that works. O0901 MO6 S 5000 M3 G90 G0 X-11. Y-22. Z-8. M98 P0900 L9 G54 G40 G49 G28 X0Y0Z0 M15 M30 X-0.0624 Y-0.0222 G03 X-0.1661 Y-0.2355 I0.0839 J-0.2355 X0.25 Y-0.25 I0.25 J0. X0.2777 G03 X0.25 Y0.25 I0. J0.25 G01 Y0.3107 G01 X0.3125 G00 Z0.75 Y 2.312 (Y shift for next part) M99 Regards, Bill Last edited by angelw; 12-22-2010 at 02:06 AM. |
|
#7
| ||||
| ||||
| It sounds like a controller bug where it thinks these are nested subs for some reason. Maybe you need more lines between each sub call in the main program? For example, you could write in the main: M98 P.... G90 G00 Z-8.0 (this is your apparent clearance plane) G00 X Y M98 P....
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#9
| |||
| |||
| I see a lot of O (ohs) instead of zeros. Can you maybe cut and paste the “actual” program that is not working? It’s a small point but possible that it is mistyped. I would also do something like Hu suggested. I would try putting an M1 after each sub and then turn your optional stop on (if you have one). Then once it stops put the machine in single block to see where the program is jumping to and what it is actually buffering and running. It may not be making it to the sub or it might be. By adding spaces or EOB they may help you see things that you would not normally see. It could be an issue with look ahead. It does not seem like it is or you would have this problem earlier however if for some reason it is seeing all 9 M98P900 at one time it could be thinking it is nesting them. IIRC you would typically get an alarm if you tried nesting to many programs but who knows at this point. Don’t know but am very curious to the solution. Stevo |
|
#10
| |||
| |||
| I have not way to output the actual program at this point. again why would it do the first six and skip the rest. I have single blocked the routine through when it reaches the sub for the seventh it moves to the start point for number seven and waits when I hit the cycle start it moves to the start point for number eight when I hit the cycle start it moves to the start for number 9 one mor cycle start and it goes to x0y0z0 and the spidle shuts off. I'll try the suggestions when I get back to the shop. |
| Sponsored Links |
![]() |
| Tags |
| fanuc programing, programing trouble, subroutines |
| 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 |
| Need Help!- Edgecam Subroutines | John Holmes | EdgeCam | 4 | 08-31-2009 10:26 PM |
| Need Help!- with subroutines | Thad Swarfburn | G-Code Programing | 0 | 06-24-2009 08:37 PM |
| Arguments for Subroutines (G65) | theragust | Milltronics | 5 | 10-17-2007 10:04 AM |
| EMC and Subroutines? | watchman | LinuxCNC (formerly EMC2) | 9 | 06-17-2007 02:30 PM |
| Oi subroutines help | mishikwest | Fanuc | 1 | 08-01-2006 05:17 PM |