585,737 active members*
4,498 visitors online*
Register for free
Login
Results 1 to 18 of 18
  1. #1
    Join Date
    Mar 2003
    Posts
    271

    Trying to make this work- G code

    Hey guys,
    Maybe someone out here can figure this one out. I have a program that is suppose to move my x axis 4 inches one way and then back again 50 times! But I cant seem to get it to repeat? Anybody have any ideas?

    F10
    G20 G90
    M98 P1234 Q50
    o1234
    G1 x4
    G1 x0
    m99
    My little piece of the web!
    http://users.adelphia.net/~wjdupont


  2. #2
    Join Date
    Apr 2003
    Posts
    1079
    I don't understand g-code that well, but I'll tell you what I know!
    Firstly, you cannot have 2 g's on the same line, so you will have to seperate G20 and G90.
    Secondly, I have just looked through the turbocnc manual, and it does not mention M98 and M99. In the turbocnc example (sample.cnc) the writer uses M60 and M62 to call sub-routines, so maybe this should be used instead.
    Like I said, I do not know g-code, I have only read the instructions!

  3. #3
    Join Date
    Apr 2003
    Posts
    1876

    Re: Trying to make this work- G code

    Originally posted by WOODKNACK

    F10
    G20 G90
    M98 P1234 Q50
    o1234
    G1 x4
    G1 x0
    m99
    the "O"1234 is for a seperate program.
    Do this;

    Code:
    %
    O1
    F10.
    G20 G90
    M98 P1234 Q50
    M30
    
    O1234
    G91
    G1X4.
    X-4.
    M99 
    %
    Assuming you're on a Fanuc compatable, make it just like that. You don't have decimal points on your feeds and X moves either.

    The G90 and G20 are ok on the same line, G20 is (likely, depending on the control,) Inch programming, the G90 is Aboslute.

    :edit:
    If you're typing this in at the controller, you'll need to remove the "%"'s, and seperate the program. Create a new program, using 1234 as the number, and put the "lower" code in that program.
    :/edit:

    'Rekd teh B.U.M.A.

  4. #4
    Join Date
    Mar 2003
    Posts
    271
    Still cant get it to work. Stops at m30 code?
    My little piece of the web!
    http://users.adelphia.net/~wjdupont


  5. #5
    Join Date
    Apr 2003
    Posts
    1079
    Rekd, when you say it's ok to have the two g's on the same line, are you talking about TurboCNC, or g-code in general? Also, I have re-read the instructions, and I have also noticed this:
    ************
    Code letters:
    ************
    Blah, blah....

    D,L,H,Q Future Use
    etc...
    So does this mean that the Q values are not implemented yet?

  6. #6
    Join Date
    Mar 2003
    Posts
    4826
    You have to read the manual

    There is no way we could possibly guess what gcodes and associated parameters will work unless you can quote the relevant pages from your manual. Computers are very unforgiving of syntax errors!
    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)

  7. #7
    Join Date
    Apr 2003
    Posts
    1876
    Rekd, when you say it's ok to have the two g's on the same line, are you talking about TurboCNC, or g-code in general? Also, I have re-read the instructions, and I have also noticed this
    that's on a fanuc or most fanuc compatables.

    Try replacing the "Q" with an "L" and see if that works.
    Matt
    San Diego, Ca

    ___ o o o_
    [l_,[_____],
    l---L - □lllllll□-
    ( )_) ( )_)--)_)

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  8. #8
    Join Date
    May 2003
    Posts
    146
    What Rekd Said
    Wee aim to please ... You aim to ... PLEASE.

  9. #9
    Join Date
    Mar 2003
    Posts
    271
    nope! no go. like I said it doesnt seem to be on that line. its the M30 line that it stops at.
    My little piece of the web!
    http://users.adelphia.net/~wjdupont


  10. #10
    Join Date
    Apr 2003
    Posts
    1876
    :edit:
    Keep in mind, you need two programs to do this. The first program, O1, calls the second program, O1234 via M98 P1234 L50 (The L50 repeats 50 times.)

    The M30 is the end of all programs. The M99 is the end of sub program, with loopback to the calling program, O1 in this case. When it stops at the M30, has it gone thru the 2 X moves?
    :/edit:

    Do you have a sample program? Perhaps a sample with sub programs or sub routines?

    'Rekd

  11. #11
    Join Date
    Mar 2003
    Posts
    271
    No this is just something I found on the internet and was trying to get it going in turbocnc..
    Attached Thumbnails Attached Thumbnails sad-smiley-043.gif  
    My little piece of the web!
    http://users.adelphia.net/~wjdupont


  12. #12
    Join Date
    Mar 2003
    Posts
    2139
    stops and says what? Any error?

    Eric
    I wish it wouldn't crash.

  13. #13
    Join Date
    Apr 2003
    Posts
    1079
    Ooh, ooh, me again!
    More from the instructions:
    ************
    M60 Jump to subroutine
    ************
    Jump to line number given and save return address.
    Usage:

    N020 M60 #10 ;Jumps to line 10. Use a unique N code when calling subs.

    ************
    M62 Return from subroutine
    ************
    Back to most recent M60 call.
    Usage:

    M62 ;Will jump back to line N020 and execute next line in the above example.

    See sample.cnc for a simple subroutine example. Please note that when using
    subroutines, you'll need a unique N code on each calling line so that the
    program knows where to go back to.
    Therefore you will need to modify Rekd's code in order to run it, adding the line numbers for the sub-routine.
    And if that doesn't work, then setup the machine just for one run, and use the automated production option, and set it for 50 runs.

  14. #14
    Join Date
    Mar 2003
    Posts
    2139
    Yep what kong said would be easier. 50 times.

    Eric
    I wish it wouldn't crash.

  15. #15
    Join Date
    Mar 2003
    Posts
    271
    ok guys ill give that a try. Thanks. This is so much fun!!!!
    I feel like im :drowning: in gcode! LOL
    My little piece of the web!
    http://users.adelphia.net/~wjdupont


  16. #16
    Join Date
    May 2003
    Posts
    146
    Rekd, when you say it's ok to have the two g's on the same line, are you talking about TurboCNC, or g-code in general?
    Normally, in fanuc compatible G code, multible G codes are fine as long as they are not in conflict (ie from the same group) such as G1 and G3.

    Multiple M codes on the same line is usually trouble.

    CAM teh Fanucer T and the "MG's"
    Wee aim to please ... You aim to ... PLEASE.

  17. #17
    Join Date
    Mar 2003
    Posts
    4826
    It sounds like the subroutine calls are more in what I would call "Bandit style", where the subroutine is nested inside the main program, preferably after the M30, but not necessarily if you can include an unconditional jump in the main program by commanding a line number on the next line after the M60.

    The number associated with the M60 is the sub call address, there is no seperate "big O" program number involved.
    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)

  18. #18
    Join Date
    Mar 2003
    Posts
    499

    Macro...

    Do you have the capability?
    If so there you go. Yell if you need help.
    PEACE

Similar Threads

  1. How do you make Bridgeport execute program?
    By Bill Gillen in forum Bridgeport / Hardinge Mills
    Replies: 10
    Last Post: 06-14-2005, 02:26 PM
  2. parametric programming
    By Karl_T in forum CamSoft Products
    Replies: 21
    Last Post: 05-24-2005, 08:58 PM
  3. Time to make it work
    By DESERT RAT in forum DIY CNC Router Table Machines
    Replies: 8
    Last Post: 02-22-2005, 02:30 PM
  4. Work Holding Methods
    By InventIt in forum DIY CNC Router Table Machines
    Replies: 13
    Last Post: 09-14-2004, 09:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •