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 04-05-2011, 10:24 PM
 
Join Date: Aug 2004
Location: usa
Posts: 71
qmas99 is on a distinguished road
TLO macro

O9010(TOOL CHANGE)
G0G91G30Z0
G91G30X0Y0
#100=#100+1
DO1
M6T#100
G90G53X15.Y-2.8
#3006=1(TAKE TLO ON 3IN BLOCK)
G10L10P#100R#5023
#100=#100+1
END1
M99
I have tool change macro above, set to G100, question:
Instead of setting #100=1 or set #100 manually every time I run G100, I want to run G100 T10, is there any system variable that can get #10 to put in #100.
Thanks
Reply With Quote

  #2   Ban this user!
Old 04-06-2011, 12:56 AM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by qmas99 View Post
O9010(TOOL CHANGE)
G0G91G30Z0
G91G30X0Y0
#100=#100+1
DO1
M6T#100
G90G53X15.Y-2.8
#3006=1(TAKE TLO ON 3IN BLOCK)
G10L10P#100R#5023
#100=#100+1
END1
M99
I have tool change macro above, set to G100, question:
Instead of setting #100=1 or set #100 manually every time I run G100, I want to run G100 T10, is there any system variable that can get #10 to put in #100.
Thanks
I'm not quite sure what you want to do exactly, except that you're setting the TLO with the Macro program. I'm not sure why you increment #100 by 1 at the start of the program and in the DO1 routine. Are you calling O9010 repeatedly from your main program? There is no Conditional statement associated with the DO1 routine, accordingly, there is no need for it.

If you only need to load a tool number into #100 and therefore access the corresponding offset for that tool, the T parameter will be passed to #20 in the Macro program.

O9010(TOOL CHANGE)
G0G91G30Z0
G91G30X0Y0
#100=#20
DO1
M6T#100
G90G53X15.Y-2.8
#3006=1(TAKE TLO ON 3IN BLOCK)
G10L10P#100R#5023
#100=#100+1 (Not sure why you increment #100 here)
END1
M99

Alternatively, System variable #4120 is the Modal information for T.

Regards,

Bill
Reply With Quote

  #3   Ban this user!
Old 04-06-2011, 06:40 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

Looks like he uses this loop to quickly set his tool lengths before he starts running.

Now he wants to start it from a specific tool.

To reiterate what angelw said :-

Replace that

#100=#100+1.
(at the start)

with: -

#100=#4120 (saves current spindle tool)
IF[#20NE#0]THEN #100=#20 (overwrites it with the T# if you specified it)

If you want this loop to repeat (when setting up, for example), alter to a WHILE[ ] DO command so that it will repeat forever (until RESET anyway)

Then, if you only want a mid-batch 'one shot' tool length check (ie when you specify a T), at the end of your loop, put something like: -

IF[#20NE#0]GOTO10 (jumps out of loop if you specified T)
#100=#100+1.
END1
N10 M99


DP
Reply With Quote

  #4   Ban this user!
Old 04-06-2011, 02:26 PM
 
Join Date: Aug 2004
Location: usa
Posts: 71
qmas99 is on a distinguished road

Originally Posted by angelw View Post
I'm not quite sure what you want to do exactly, except that you're setting the TLO with the Macro program. I'm not sure why you increment #100 by 1 at the start of the program and in the DO1 routine. Are you calling O9010 repeatedly from your main program? There is no Conditional statement associated with the DO1 routine, accordingly, there is no need for it.

If you only need to load a tool number into #100 and therefore access the corresponding offset for that tool, the T parameter will be passed to #20 in the Macro program.

O9010(TOOL CHANGE)
G0G91G30Z0
G91G30X0Y0
#100=#20
DO1
M6T#100
G90G53X15.Y-2.8
#3006=1(TAKE TLO ON 3IN BLOCK)
G10L10P#100R#5023
#100=#100+1 (Not sure why you increment #100 here)
END1
M99

Alternatively, System variable #4120 is the Modal information for T.

Regards,

Bill
Thanks Bill,
yes #100=#20 does the trick, works with G100T#
I want to use it in MDI to do TLO, that is why #100+1
Reply With Quote

  #5   Ban this user!
Old 04-06-2011, 05:15 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by qmas99 View Post
Thanks Bill,
yes #100=#20 does the trick, works with G100T#
I want to use it in MDI to do TLO, that is why #100+1

That still doesn't explain why the #100+1. The current structure of your DO Loop will only run the one time because there is no conditional statement for it to do else-wise. If you included a WHILE[] conditional statement as suggested by Kiwi, then the loop would repeat as long as the WHILE[] statement tested true. For example, you could specify a range in your G100 call and the DO loop would repeat while #100 was less than, or equal to the upper limit of the range.

G100 T? U?


#100=#20
IF[#21EQ#0]THEN #21=#100 (if the upper range is not specified, set it to the lower range so the loop only sets the one tool)

WHILE[#100 LE #21] DO1
#100 = #100 + 1
END1


Regards,

Bill
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-06-2011, 06:36 PM
 
Join Date: Aug 2004
Location: usa
Posts: 71
qmas99 is on a distinguished road

When DOm is specified without specifying the WHILE statement, an infinite loop ranging from DO to END is produced. (got from the operator's manual). #100+1 keep adding up untill I hit RESET.
QM
Reply With Quote

  #7   Ban this user!
Old 04-06-2011, 07:12 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by qmas99 View Post
When DOm is specified without specifying the WHILE statement, an infinite loop ranging from DO to END is produced. (got from the operator's manual). #100+1 keep adding up untill I hit RESET.
QM
You're so right. I've never used a DO loop with out some condition, just for the reason of good structure and controlling the Loop.

Because you have the tool change inside the DO loop, don't you get an alarm if #100 exceeds the maximum number of tools available in the magazine? If yes, then your method would rely on the operator to be aware and abort using Reset before that occurs, as opposed to controlling if either 1, or to a maximum tool number should be set.

Regards,

Bill

DO1
M6T#100
G90G53X15.Y-2.8
#3006=1(TAKE TLO ON 3IN BLOCK)
G10L10P#100R#5023
#100=#100+1
END1
M99
Reply With Quote

  #8   Ban this user!
Old 04-06-2011, 08:38 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

You learn something new everyday (I always used to put WHILE[#0EQ#0]...).

I think the message to the operator when you exceed the maximum tool should be . . . (WHY DONT YOU GO AND DO1...)



DP
Reply With Quote

  #9   Ban this user!
Old 04-07-2011, 03:00 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

An isolated DO1, without a matching WHILE statement, should give syntax error.

If a subprogram (O9000) is called by a T-code, the value specified with T automatically gets stored in #149, for use inside the subprogram.
Reply With Quote

  #10   Ban this user!
Old 04-07-2011, 04:00 AM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by sinha_nsit View Post
An isolated DO1, without a matching WHILE statement, should give syntax error.

If a subprogram (O9000) is called by a T-code, the value specified with T automatically gets stored in #149, for use inside the subprogram.
Hi Sinha,
QM is correct with regards to the DO statement. This was new to me, as I've always used a conditional statement to control the loop. Following is a direct cut and paste from the Fanuc manual.

When DO m is specified without specifying the WHILE statement, an
infinite loop ranging from DO to END is produced.


Regards,

Bill
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 04-07-2011, 04:16 AM
 
Join Date: Feb 2006
Location: india
Posts: 1,187
sinha_nsit is on a distinguished road

Right.
Actually, isolated END 1 is not permitted, IIRC. There was a mix up.
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
need help wana make macro for getting tool change by giving tool pot no on vmc instea ghevari Parametric Programing 0 02-14-2010 12:26 PM
Need Help!- M6 tool change macro at6c Mach Mill 0 08-08-2009 07:41 AM
Help for tool change macro on OM VMC Namnp2007 Fanuc 3 08-12-2008 11:18 AM
Tool Change Macro cncdiag Mazak, Mitsubishi, Mazatrol 0 03-26-2007 02:20 PM
A sample tool change macro. gar Haas Mills 17 08-22-2005 05:13 PM




All times are GMT -5. The time now is 01:13 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