![]() | |
| 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 |
|
#2
| |||
| |||
| I think what you can use depends on your controller. Sometimes if you end a program with M99 the controller will go back and start at the top, and do this endlessly; some controllers will give an alarm telling you it is an endless loop. The best way in my opinion is just put the code to be repeated in a subroutine and then use an L count in the subroutine call; etc etc M97 P1000 L5 etc etc M30 N1000 Code being repeated etc etc M99 You can simply repeat the section of code. I program on Haas and it is so easy to duplicate blocks of code I will do this when I am feeling too lazy to set up the subroutine format. But if you simply repeat the block of code many times then want to edit it you have many places to edit; with the subroutine approach you edit at one place.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#3
| ||||
| ||||
| Since G codes don't have anything to do with "tape function", probably you would need an M code, like M99. You might be able to use a WHILE/DO loop, or an IF/GOTO or a straight GOTO statement. The M98 subprogram call would work for L times, but it wouldn't be an endless loop. The only G code might be a G65 macro call that would refer to a program that had M99P10 at the end (where 10 is the line number just before that macro call). Then you'd also be stuck in a loop. Of course it does depend on which control you are using. |
|
#5
| |||
| |||
| Thx for the info....Beege the M98 sounds simple since I dont actually need it to be endless. so it would just be (M98 #) where # = numer of repeats? btw, the controller is a xylotex and yes Geof its pulling an alarm with M99 |
| Sponsored Links |
|
#6
| |||
| |||
| Typically, the M98 calls the subprogram/subroutine. On my Mitsubishi controls, the format is: M98 Pppp Hhhh Ll ppp=external subprogram number (omit if subroutine is at end of current program) hhh= line number of the subroutine l= number of times to repeat The subroutine would start at line hhh and the signal to finish and return the original block is M99. Some machines have proprietary loop/repeat codes. |
|
#9
| |||
| |||
| According to the Mach3 website, Geof's code above is close except he has M97 instead of M98 and instead of using "N1000" it should be O1000. Note that O1000 starts with the letter "O", not the numeral zero. Plagarizing Geof: etc etc M98 P1000 L5 etc etc M30 O1000 Code being repeated etc etc M99 According to the Mach3 website, line O1000 cannot contain anything other than a comment (sub 1000, for example). I get all that from http://www.machsupport.com/docs/Mach3Mill_1.84.pdf looking at page 138 of 157 of the PDF file (10-34 in Mach3 pages). |
|
#10
| |||
| |||
|
Imitation; the most sincere form of flattery. Thank you. ![]() The M97/M98 thing is why I have learnt to put the comment about it depending on your controller. I program on Haas and use M97 which is an internal subroutine call, M98 jumps you out to a different program. Does Mach use M98 as an internal call requiring the M99 return?
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
| Sponsored Links |
|
#11
| |||
| |||
![]() On my Mitsubishi machines, there is no M97. M98 is the only available command. M98 P H L I J P = external program number. If no P is specified, the control searches within the current program. H = line number. I don't know why Mits uses H instead of N. If going to an external program P, no H is required. L = repeat. Number of times to repeat the sub. If no L specified, the sub is executed once. I, J = allow for rotation of the sub as it is repeated. For example, making a gear involves the code for single tooth that is repeated enough times to rotate the 360 degrees. |
|
#12
| |||
| |||
|
Go on, cut me some slack ![]() That rotation feature looks handy. Haas does it a different way.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
![]() |
| 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 |
| g code for repeat the previous move | woffler | G-Code Programing | 6 | 03-26-2008 10:07 PM |
| How Do I Repeat? | TZ250 | Dolphin CADCAM | 2 | 03-04-2008 05:11 AM |
| Repeat command on TL-1? | Haeusser | Haas Lathes | 4 | 07-31-2007 05:31 PM |
| Need help on G75.1 pattern repeat | wayne mitchell | G-Code Programing | 1 | 03-16-2005 02:49 PM |
| Repeat g-code with y offset | tpaulson | G-Code Programing | 19 | 11-29-2004 01:36 PM |