![]() | |
| 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
| ||||
| ||||
Hey guys, I'm not familiar with macros, but I was wondering if some one could help figure this out. This a macro program for a tool setting cycle for a yasnac mx3 control. I would like to apply it to a fanuc 11m control, also I would like to make pre-stage the next tool and make for 30 tools as oppossed to 20. I punched it in and it worked for up until the m0, than it alarmed out saying something wrong with the IF statement. Here it is. G65P8600T1.B0. O8600 IF[[[#20NE#0]+[#2NE#0]]NE2.0]#3000=5001(MUST SET T AND B) G94G80G64G40G17G0 G91G28Z0 G49H0D0 WHILE[#20LT21.0]DO1 M1 T#20 G91G28Z0 M6 M0 IF[#5023LT0]#[12000+#20]=[5023-#2] #20=#20+1.0 G91G28Z0 END1 M30 |
|
#2
| ||||
| ||||
| Chuy, Here's one that works on a range of tools. G65 P9800 S3. E12. Will set tools 3 thru 12. % :9500(AUTO TOOL LENGTH SET) #101=#19 (STORE STARTING T#) #103=#8 (STORE ENDING T#) G0G91G28Z0M19 N1T#101M06 (LOAD NEXT T# IN SPINDLE) #3006=102(JOG TOOL TO Z ZERO) #[2200+#101]=#5023 (STORE GEOM OFFSET) #[2000+#101]=0 (SET WEAR OFFSET TO 0) G91G28Z0M19 #101=#101+1 (INCREMENT T#) IF[#101GT#103]GOTO2 (CHECK IF T# > ENDING T#) GOTO1 (LOOP UNTIL ENDING T# HAS BEEN SET) M99 % |
|
#4
| |||
| |||
I didn't even try to follow this all the way through, but I know you need the newer Fanuc Macro B for IF THEN statements. The older Macro B only does IF GOTO (the newer Macro B is common). The syntax is... IF[#5023LT0]THEN#[12000+#20]=[5023-#2] instead of IF[#5023LT0]#[12000+#20]=[5023-#2] maybe IF[#5023LT0]THEN[#[12000+#20]=[5023-#2]] Anyway, you need a THEN in there. Try that. |
|
#7
| ||||
| ||||
| Well, then, try this one. % :9500(AUTO TOOL LENGTH SET) #101=#19 (STORE STARTING T#) #103=#8 (STORE ENDING T#) G0G91G28Z0M19 N1T#101M06 (LOAD NEXT T# IN SPINDLE) #3006=1(JOG TOOL TO Z ZERO) #[2000+#101]=#5023 (STORE GEOM OFFSET) G91G28Z0M19 #101=#101+1 (INCREMENT T#) IF[#101GT#103]GOTO2 (EXIT IF T# > ENDING T#) GOTO1 (LOOP UNTIL ENDING T# HAS BEEN SET) N2M99 % |
|
#10
| ||||
| ||||
| It worked! the machine is a kitamura and it can't have a t# and m6 on the same line, so I broke the two lines. is there a way to make it pre-stage and put the tool in waiting pocket? it advances the next tool in the magazine but doesn't load it..or is that the limitation of the control? Thanks again for your help! :9500(AUTO TOOL LENGTH SET) #101=#19 (STORE STARTING T#) #103=#8 (STORE ENDING T#) G0G91G28Z0M19 N1T#101(LOAD NEXT T# IN SPINDLE) M06 #3006=1(JOG TOOL TO Z ZERO) #[2000+#101]=#5023 (STORE GEOM OFFSET) G91G28Z0M19 #101=#101+1 (INCREMENT T#) IF[#101GT#103]GOTO2 (EXIT IF T# > ENDING T#) GOTO1 (LOOP UNTIL ENDING T# HAS BEEN SET) N2M99 |
| Sponsored Links |
|
#11
| |||
| |||
:9500(AUTO TOOL LENGTH SET) #101=#19 (STORE STARTING T#) #103=#8 (STORE ENDING T#) G0G91G28Z0M19 N1 M06 (LOAD NEXT T# IN SPINDLE) #101=#101+1 (INCREMENT T#) IF[#101GT#103]GOTO2 (EXIT IF T# > ENDING T#) T#101 (LOAD NEXT T# WAITING) #3006=1(JOG TOOL TO Z ZERO) #[2000+#101]=#5023 (STORE GEOM OFFSET) G91G28Z0M19 GOTO1 (LOOP UNTIL ENDING T# HAS BEEN SET) N2M99 |
![]() |
| 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 on setting up a macro | mgb1974 | G-Code Programing | 11 | 04-17-2008 09:31 AM |
| Renishaw tool setting | djbarren | General Metal Working Machines | 8 | 11-14-2007 07:27 AM |
| g65 macro mx3 setting | firecat69 | General Metal Working Machines | 2 | 04-30-2007 09:16 AM |
| Setting tool height | is300driver | General Metalwork Discussion | 12 | 11-14-2006 06:28 PM |
| Tool setting probe | JFettig | Mach Software (ArtSoft software) | 18 | 03-12-2005 07:33 AM |