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 > Fanuc


Fanuc Discuss Fanuc controllers here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 10-25-2009, 07:38 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road
G65 with other G-codes in the same block

If we command G98 G65 ..., on a milling machine, is it always guaranteed that the macro would be called in G98 mode?
Reply With Quote

  #2   Ban this user!
Old 10-25-2009, 02:27 PM
 
Join Date: Mar 2005
Location: Silicon Valley, CA
Posts: 982
psychomill is on a distinguished road

No because "G" is not a valid argument for a macro call. You'll either get an error or it gets ignored.

If you want to make sure you are in G98, just have G98 written in the macro program.
__________________
It's just a part..... cutter still goes round and round....
Reply With Quote

  #3   Ban this user!
Old 10-26-2009, 01:11 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Any G-code after G65 is illegal, because it would be considered an argument. But, before G65, it would be considered a regular G-code. If it is a code like G98, probably there would be no problem. But a movement code may affect the logic, because while the tool is moving, the macro execution would simultaneously start. The best thing would be not to confuse the control (and ourselves), and always command G65 in a separate block.

An excerpt from the Operator's Manual:
"When an M98 block contains another NC command (for example, G01 X100 M98 P_), the subprogram is called after the command is executed. On the other hand, G65 unconditionally calls a macro."
Reply With Quote

  #4   Ban this user!
Old 10-26-2009, 09:02 AM
 
Join Date: Mar 2005
Location: Silicon Valley, CA
Posts: 982
psychomill is on a distinguished road

But, before G65, it would be considered a regular G-code
Not necessarily true for all controls.... and M codes on the same lines as G codes is a different scenario...
However, a bit confused here .... You ask a question but had all the answers????
__________________
It's just a part..... cutter still goes round and round....
Reply With Quote

  #5   Ban this user!
Old 10-26-2009, 11:14 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Originally Posted by psychomill View Post
However, a bit confused here .... You ask a question but had all the answers????
LMAO ….Sinha likes to do that a lot. It’s quite amusing.

Sinha…if you are going to be calling a macro were the G98 is important then why would you want to call it in the macro line? Why not just hard code it in the program so you never have to worry about it again. If you are curious because you may want to switch from G98 G99 but use the same macro then use a variable to specify it instead of hard coding it.

All of my macros I write for milling have data sheets to follow on the designation of the variables. If someone were to use the setup sheet there is no easy way to say “hey make sure you put G98 in the macro call”. It’s not common practice to involve anything other than the program and variable passage in the macro call line so I would highly suggest leaving the macro line alone.

Stevo
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-27-2009, 01:20 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by psychomill View Post
However, a bit confused here .... You ask a question but had all the answers????
Actually, I am not an expert like you people. I am seriously into macros only for the last one year or so. I am still learning it, primarily using the manuals, reading various posts (these are wonderful) and using my intuition. In this process, many a time I need to confirm whether my understanding is correct. Then I pose a question, while still trying to find out the answer myself.

There is one more reason for posing this particular question. I did not find any new post that day. So, I thought we must have someting to discuss! I believe, everybody loves to talk.

So, I may be excused, if you do not like my habit.
Reply With Quote

  #7   Ban this user!
Old 10-27-2009, 01:36 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by stevo1 View Post
if you are going to be calling a macro were the G98 is important then why would you want to call it in the macro line? Why not just hard code it in the program so you never have to worry about it again. If you are curious because you may want to switch from G98 G99 but use the same macro then use a variable to specify it instead of hard coding it.

Stevo
Actually, I wrote a macro for regressive peck drilling, where the specified peck length gets reduced in every subsequent peck, by a specified fraction, up to a minimum specified value. I defined G183 for this macro, indicating that it is a modified form of G83. I made G183 suitable for both G98 and G99, with the same usual behaviour (retraction up to R-point or up to the initial Z-level). We can have G98 G83 ... in the same block. I just wanted to know if G98 G183 ... would do the same thing. The answer is probably YES, but, as you suggested, a macro should be called independently.
Reply With Quote

  #8   Ban this user!
Old 10-27-2009, 04:28 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Originally Posted by psychomill View Post
You'll either get an error or it gets ignored.
You are right.
I verified it on the machine.
A G-code to the right of G65 would alarm out.
A G-code to the left of G65 is ignored.

So, for example, G98 G183 ... is not correct.

M98 has a slightly different behaviour.
If we command G01 W-100 F100 M98 P8000, then the G-code is not ignored. But, the subprogram call does not wait for the motion to be complete.
Reply With Quote

  #9   Ban this user!
Old 10-27-2009, 10:48 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Originally Posted by sinha_nsit View Post
So, I may be excused, if you do not like my habit.
Shinha….you don’t need to apologize. I actually like the questions or suggestions you have as they usually lead me to trying things I have never thought of or simplifying things. I like to learn something new when I can. I just found it comical when Psycho said that. No insult towards you though. Macro’s are great so keep it up and have fun with it.

Yes macro calls will act different then subprogram calls. Now what I was trying to get at before was I would not suggest using G98G183 just because it is not the norm and if someone does not know that it has to be specified in the macro call line then having a small R-plane with tall clamps can be a major problem. Not to mention as you stated it does not work.

I like to teach my guys that they don’t have to worry about the macro it will repeat without error. It’s the darndest thing that a machine will only do what you tell it to do. They are very disciplined.

If you are using a G183 to call your drill macro then I ass u me that you have variables that you are passing along to the macro?
G183A()B()C()E()V() etc to specify the specifics of what you want to machine. (correct)

I would suggest that you make another variable in the macro line that specifies G98 or G99 and label it as so. For example use R(). So in the call line G183A()B()R98. Now in your macro program specify it in your canned cycle line as G#18.

Another thing I like to do is use my custom codes for more specific things per machine rather than calling a machining macro. You will find out down the road that the more macros you write will be tailored specific and you will think you need to use a custom code like G183 but you will soon find that you will run out of the allowable amount of custom codes. What I am working on now requires 4 different ways of using a bolt circle canned cycle so 4 programs are needed. I also have C-bores, threadmilling, tapping, etc that also require 4 programs each. You can see that I will never have enough custom codes for that. That is why sticking with the G65P() is the better way to go for me. I then make a book describing each program and the variable usage with it. This book is at the machine. Straight forward and to the point with no confusion.

Stevo
Reply With Quote

  #10   Ban this user!
Old 10-28-2009, 12:26 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Do all control versions allow only 10 custom G-codes?

I find that usually controls give more options than it is ever needed. Be it total number of local/common variables, or 4-level nesting of macros/subprograms, or 3-level nesting of WHILE loop, or max permissible spindle speed/feedrate/stroke length etc. On this scale, at least 100 new G-codes should have been allowed!

I did not include 98/99 in the argument list, because I wanted to make G183 similar to G83.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-29-2009, 09:59 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Sinha,
Most of my experience is on Fanuc so I cannot speak for other controls and the amount of custom codes you can have. With Fanuc yes there are options that can be turned on thru the parameters to give you more “variables” and “macroB” programming ect. There is no option to give the user more custom codes. Also you are only allowed to nest up to 3 WHILE loops and no option to expand this.

Originally Posted by sinha_nsit View Post
I did not include 98/99 in the argument list, because I wanted to make G183 similar to G83.
G83 is a drilling canned cycle and really has no relevance of a custom macro. Your custom macro is what you make it. If you want to make the G183 the same as G83 you can do so it is all about how you program your code. I don’t know how you are coding your macro but is sounds to me like you are using a G83 line along with depth pick etc inside your actual macro program. If you are also using the G83 line in the G183 macro program then you can still make them the same.

These are just examples of the call and sub. Lets say G83 calls program 9001 and G183 calls 9002.
Z=drill depth, R=return plane, Q=pick size, D=return point G98 or G99

O0001(MAIN)
G83Z1.R.1Q.1D98
M30

O9001(macro sub)

G0Z3.
G83G#7Z-#26R#23Q#17

M99
In this example your return point will be using G98 “initial level”. If you change your D=99 then it will use the “R-level” of .1

Now using the G183

O0001(MAIN)
G183Z1.R.1Q.1D98
M30

O9002(macro sub)

G0Z3.
G83G#7Z-#26R#23Q#17

M99

Again I am not sure how your macro is structured but this is the basic idea of what I am refering to.

Stevo
Reply With Quote

  #12   Ban this user!
Old 10-30-2009, 03:02 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Basically I want that every subsequent peck length is smaller than its previous value, e.g., <peck length> = <peck length> * 0.9, till it becomes smaller than a specified minimum peck length, when its value is clamped and not reduced further.

This is not possible by having G83 inside the macro. Of course, we can divide the hole into several parts, and call G83 separately for each part, with the desired peck lengths for each part.

So, I designed G183 using G00 and G01 only, imitating most of the features of G83. Of course. G183 would not be a canned cycle like G83.
Reply With Quote

Reply




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
G/M/S/T codes in the same block sinha_nsit Fanuc 1 07-08-2008 05:05 AM
417 & 427 codes chetohead General CNC (Mill and Lathe) Control Software (NC) 0 04-30-2008 02:40 PM
M-codes and G-codes 4 Matsuura ES-1000V maximusek G-Code Programing 2 11-27-2007 06:41 AM
RS232 program block by block smoregrava General CNC (Mill and Lathe) Control Software (NC) 3 12-22-2005 12:52 AM
g-codes pimp215 General Metalwork Discussion 11 03-07-2005 01:43 PM




All times are GMT -5. The time now is 01:47 AM.





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