587,103 active members*
4,097 visitors online*
Register for free
Login

Thread: writing code

Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    44

    writing code

    SO I am new to CNC.I set up a two axis system(soon to be three axis). I would like to write some code to move the x axis and y axis a short distance(say 5" and 2")and later the z axis.
    I have the Mack 3 demo loaded on a system.I have invoked some of the wizards and the motors move and the screens reflect this.
    What do I do next? How do I write G code? Is there some place in Mack that explains this? ........ thanks......joe

  2. #2
    Join Date
    Apr 2008
    Posts
    47
    Hello Joe
    To write code, my suggestion would be to open Mach 3, on the bottom of the first screen there is a "G code" button and an "M" code button if you open either one of these, it'll explain what each "G" gode does.

    IE G20= Inch mode
    G90=Absolute mode

    When I started writing code, I just started with a simple box. then as I read diffrent threads and diffrent places on the web (www.CNC cookbook.com) I started to improve my code.

    for a box say 3"X3" it would be

    g20 g90 g64(inches, absolute,continance mode with allowance)

    g00x0y0z0(Starting point, tells the machine this is zero)
    F4 (Feed Rate)
    M6T2(M6 tool change, Which tool to change too)

    g01 z-.010 (Cut depth)

    g01 x3 (Move "X" 3 inches to the positive)
    g01 y3 (Move "Y" 3 inches to the positive)
    g01 x0 (Move "X" back to the start)
    g01 y0 (Move "Y" back to start)

    g00z.2 (Move "Z" up .2 inches above where the "Z" zero is)
    m30 (Program end and rewind to beginning of program)

    From here you can add "G41 or G42" these are offsets which either follow to the left or right of the line you cutting.

    one nice thing with Mach 3 you don't actually have to do any cuts. the graphics window will show your project, also if your machine is turned off and you "Start" the program/project the cursor will move around the project.

    I hope this helped, by the way this gets very addicting.
    Brian
    "If everyone is thinking alike somebody's not thinking!"
    HAAS TM-3P and a HAAS OM-2

Similar Threads

  1. writing code and proving out
    By camtd in forum G-Code Programing
    Replies: 1
    Last Post: 12-05-2010, 02:36 AM
  2. G Code Program writing
    By Tool Guy 1234 in forum G-Code Programing
    Replies: 1
    Last Post: 04-24-2010, 12:33 AM
  3. writing G code
    By 300magnum in forum Australia, New Zealand Club House
    Replies: 2
    Last Post: 09-11-2008, 04:31 AM
  4. imagine writing the code for this!!!!
    By bearracecars in forum Waterjet General Topics
    Replies: 9
    Last Post: 02-19-2007, 10:46 PM

Posting Permissions

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