CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-20-2010, 02:43 AM
 
Join Date: Dec 2008
Location: usa
Posts: 13
oreos40 is on a distinguished road
limit on subroutines,only six?

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?
Reply With Quote

  #2   Ban this user!
Old 12-20-2010, 03:07 AM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by oreos40 View Post
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?
Post your code so we can see how you've structured your program. Practically speaking, there's no limit to the number of times a sub can be called, only a limit to the number of levels of nesting of sub programs.

Regards,

Bill
Reply With Quote

  #3   Ban this user!
Old 12-21-2010, 10:07 PM
 
Join Date: Dec 2008
Location: usa
Posts: 13
oreos40 is on a distinguished road

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
Reply With Quote

  #4   Ban this user!
Old 12-21-2010, 11:34 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by oreos40 View Post
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
Is the program in your Post a Cut and Paste from your actual program? If so, there is an “O” character instead of a Zero as shown in red. Otherwise, I can’t see any problem with your code that should make it fall over. Repeatedly calling the sub program in the manner that you have is an accepted method, and I can’t see any reason why your program would fall through after completing 6 calls.

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.
Reply With Quote

  #5   Ban this user!
Old 12-22-2010, 07:48 AM
 
Join Date: Dec 2008
Location: usa
Posts: 13
oreos40 is on a distinguished road

that was a typo on my part it is not in the program on the control. I will try your suggestion with the L9 and the offset in Y at the end of the sub
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-22-2010, 09:45 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

I have seen a similar problem on an emulated Fanuc control.
Do you have original or emulated Fanuc?
Reply With Quote

  #7  
Old 12-22-2010, 10:13 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

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)
Reply With Quote

  #8   Ban this user!
Old 12-22-2010, 12:17 PM
 
Join Date: Dec 2008
Location: usa
Posts: 13
oreos40 is on a distinguished road

it is a fanuc control not an emulator why would it do six calls and not the remaining three then. I wont have a chance to try this till the fourth of january.
Reply With Quote

  #9   Ban this user!
Old 12-22-2010, 01:25 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

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
Reply With Quote

  #10   Ban this user!
Old 12-22-2010, 03:02 PM
 
Join Date: Dec 2008
Location: usa
Posts: 13
oreos40 is on a distinguished road

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.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 12-23-2010, 12:40 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Nesting should not be an issue. If you nest more than allowed, it would alarm out. It is not that the control would ignore extra subs.

Which control version you have?
Reply With Quote

  #12   Ban this user!
Old 12-23-2010, 08:24 AM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

What model Fanuc is this?
Reply With Quote

Reply

Tags
fanuc programing, programing trouble, subroutines




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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




All times are GMT -5. The time now is 07:51 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361