![]() | |
| 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
| |||
| |||
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 |
|
#2
| |||
| |||
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 |
|
#3
| ||||
| ||||
| 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 |
|
#4
| |||
| |||
yes #100=#20 does the trick, works with G100T# I want to use it in MDI to do TLO, that is why #100+1 |
|
#5
| |||
| |||
| 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 |
| Sponsored Links |
|
#7
| |||
| |||
| 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 |
|
#9
| |||
| |||
| 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. |
|
#10
| |||
| |||
| 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 |
| Sponsored Links |
![]() |
| 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 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 |