![]() | |
| 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 everybody. My company has a Haas VF2SS and I'm new to g-code and am wondering how to use a subroutine on a mill patern. I'm trying to write a code for one mill patern about the origin and then move the mill patern using subroutines to 3 locations. My question is: How do I write the code? Absolute or Incremental? Right now I have it writen in Absolute and I'm trying to move the subroutine in absoulte. Something like this: G00 G55 G90 X-1. Y0; M97 P1000; G00 G55 G90 X-.2 Y0; M97 P1000; G00 G55 G90 X.9 Y0; M97 P1000; M30; N1000; G00 G91 X0 Y0; G00 Z.25; G01 Z-.25 F10.; G01 X-1. Y-2. F20.; G02 X1. R1.; G01 Y2.; G02 X-1. R1.; G01 Y-2.; G01 Z.25 F100.; M99; Do I need to rewrite this Subroutine in Incremental? Thanks in advance for your help!
__________________ jettawagonautocross.blogspot.com |
|
#2
| ||||
| ||||
| Easiest way is to use a unique workshift for each location. Run the first part at G54, second one at G55, third at G56. This makes it easy to adjust the datum of each pattern simply by studying the values in the offset register and adjusting the X and/or Y values to reflect how far the patterns are from each other. You might also research the usage of G52, as this permits setting a datum at any point you like, then jumping to a subroutine written in absolute and the absolute code will regard the G52 as the absolute zero until it is cancelled. I call that an advanced technique because I have not used it myself yet
__________________ First you get good, then you get fast. Then grouchiness sets in. (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#3
| |||
| |||
| Write it in absolute and either use three work zeroes, G54, G55, G56 each located for the positions of three parts as Hu suggests or use G52 also as Hu suggests. It is six of one half a dozen of the other really; G52 sets a supplementary work zero with reference to your main work zero. EDIT: Hu's reply wasn't there when I clicked on REPLY; obviously great minds think alike.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#5
| |||
| |||
| On the flip side ,... there's nothing wrong with your original thought process of using an incremental sub either. You can simply position your pattern where ever you want based on one work offset. You don't need to keep calling the workoffset either. And you still maintain the same adjustability as G52 or other methods... There are a number of ways to accomplish the same task... Hu's offset method allows to adjust from Work offset page. The others are updated by positioning in the program.. You can also set your positions to variables and simulate Work offset page function but that may be 'advanced' for now as well....
__________________ It's just a part..... cutter still goes round and round.... |
| Sponsored Links |
|
#6
| ||||
| ||||
| YES!!! That worked!!! I used G55 as the center of my part. In MDI, I moved over the distances to the center of each patern and called them G56, G57 and G58 respectivly in OFFSETS and ran the program in the GRAPHICS screen. It looks great! Thanks again for your help! Allan
__________________ jettawagonautocross.blogspot.com |
|
#7
| |||
| |||
| hi all , i just wonder about the sub rotine start (M97) ??? in the program that vw bmx already written!!!!! as i know it should be M98 to call sub program , if there is another code (M code ) to call sub programme pls let me know thnx all |
|
#8
| |||
| |||
The M97 is a local Sub Routine call. The local sub is included in the main program and is located after the M30 and before the % at the end of the program file and always ends with a M99 In "M97 P1000" the P1000 is the first line number of the Sub as in VWbmx's example. This may be a Haas only feature. I don't know if Fanuc controls use local subs. I like to use G97 local subs because all the code for a part is included in one file. It makes backup a lot easier. |
|
#9
| |||
| |||
|
It's a Haas thing. Very convenient as mentioned above you have all the code in one file. Haas also allows almost unlimited nesting of subroutines.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. |
|
#10
| |||
| |||
YASNAC = YES MAZATROL = YES MITSUBISHI = YES OTHERS= ??? Although it's not M97 on the other controls but the way it works is all the same...
__________________ It's just a part..... cutter still goes round and round.... |
| Sponsored Links |
|
#11
| |||
| |||
| im studying programming and just wondered how sub routine G97 for hass worked with rgards to drilling, i center drill, drill and ream several different holes. is this possible in sub-routine, if so how would it be inputted? regards |
|
#12
| |||
| |||
| I seem to recall I used M97 (I think this is what you mean but you typed G97) in a drill canned cycle. I was spotting, drilling and tapping and had all the hole coordinates in a subroutine which I called after setting up the canned cycle. I will play with one of my machines and see if it works I could be remembering it incorrectly. EDIT: Yes it works here is how to set up the program (with some stuff missing of course). Blah Blah Spot Drill G82 Z-.2 F? R? L0 M97 P1000 G80 Blah Blah Drill G83 Z-2. Q? F? R? L0 M97 P1000 G80 Blah Blah Tap G84 Z-.2 F? R? L0 M97 P1000 G80 Blah Blah M30 N1000 All the hole coordinates M99 Some things to note: The L0 in the canned cycle command means that the machine does not perform the cycle until it reads the first set of coordinates in the subroutine. SETTING 28; CAN CYCLE ACT W/O X/Y has to be turned ON so you can omit the X and Y coordinates in the canned cycle line.
__________________ An open mind is a virtue...so long as all the common sense has not leaked out. Last edited by Geof; 02-22-2009 at 10:02 AM. |
![]() |
| 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 |
| Example of a Subroutine? | donl517 | Fadal | 14 | 06-27-2007 10:05 AM |
| Offsets: Changing between absolute and incremental | MotorCityMinion | Haas Mills | 11 | 03-04-2007 10:57 AM |
| Absolute or Incremental | mikede | Haas Mills | 1 | 02-03-2007 05:02 PM |
| Need help with subroutine | 2_jammer | General CAM Discussion | 1 | 01-17-2005 10:46 PM |
| Absolute and Incremental | ACME | G-Code Programing | 3 | 09-04-2004 05:45 PM |