584,841 active members*
4,467 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2012
    Posts
    13

    G-code and floating point numbers?

    I am working on an excel software tool for adding corners to tool paths for our drag knife tool. This program is functioning with shopbot code already. I am just sort of learning g-code in making the translation.

    I have created a macro that will import g-code G00 and G01 commands. I have been using a sample code someone sent me as a test piece for import. It appears to contain floating point numbers. See these lines:

    N210G1Z0.0000F60.0
    N220G1X2.5831F180.0

    I'm assuming that 0.0000F60.0 represents 0.0000 X 10^-60
    Please let me know if I am wrong on this.

    Unfortunately excel would represent that number as 0.0000E-60 and I don't see an easy way of interpreting this floating point format with excel. Does anyone have experience with this? Can you make any suggestions?

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    I'm assuming that 0.0000F60.0 represents 0.0000 X 10^-60
    Please let me know if I am wrong on this.
    N210G1Z0.0000F60.0

    Means move to Z 0.0000 at a feedrate of 60 inches per minute.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  3. #3
    Join Date
    Jul 2012
    Posts
    13
    Quote Originally Posted by ger21 View Post
    N210G1Z0.0000F60.0

    Means move to Z 0.0000 at a feedrate of 60 inches per minute.
    Thanks.

  4. #4
    Join Date
    May 2004
    Posts
    4519
    Quote Originally Posted by ger21 View Post
    N210G1Z0.0000F60.0

    Means move to Z 0.0000 at a feedrate of 60 inches per minute.
    +1

    G-code works on Word Address format. Each letter and the following number makes one Word. Think of the letters as variables, sort of like in algebra. Then you can assign numerical values to those variables.

    N=210
    G=1
    Z=0.0000
    F=60.0

  5. #5
    Join Date
    Jul 2012
    Posts
    13
    Quote Originally Posted by txcncman View Post
    +1

    G-code works on Word Address format. Each letter and the following number makes one Word. Think of the letters as variables, sort of like in algebra. Then you can assign numerical values to those variables.

    N=210
    G=1
    Z=0.0000
    F=60.0
    Thanks. Understood. I did not realize feed speed was changed within a move command. G-code is quite different from shopbot's code and it can be confusing to look at a long line of code formatted completely differently from what you are use to.

  6. #6
    Join Date
    Mar 2003
    Posts
    35538
    Quote Originally Posted by donek View Post
    Thanks. Understood. I did not realize feed speed was changed within a move command.
    It can also be changed on it's own line. It's also modal, so once changed, it remains in effect until another F word is used.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (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 2010
    Posts
    294
    You must understand that excel can display a number differently form the underlying absolute value. You can round the underlying value to a specified number of decimal places by encasing your formulas in a ROUND function. So =ROUND(restofformula,3) will ensure that you only get three decimal places and no silly results like 0.0000E-60

Similar Threads

  1. Centroid M400 code numbers
    By h_2_o in forum Centroid CNC Control Products
    Replies: 23
    Last Post: 11-06-2019, 02:33 PM
  2. G-Code 5 point star
    By seunao in forum G-Code Programing
    Replies: 4
    Last Post: 12-02-2008, 08:43 AM
  3. Maquining letters&numbers with single point maquining
    By ZeroDay in forum MetalWork Discussion
    Replies: 2
    Last Post: 11-24-2008, 09:43 PM
  4. How to get rid of line numbers in NC code
    By mcoughlin in forum CamWorks
    Replies: 1
    Last Post: 04-17-2007, 04:30 AM
  5. G-Code Line Numbers?
    By Imagineering in forum G-Code Programing
    Replies: 3
    Last Post: 08-17-2005, 01:26 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
  •