515,094 active members
3,402 visitors online

# Thread: G-code and floating point numbers?

1. ## 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. 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.

3. Originally Posted by ger21
N210G1Z0.0000F60.0

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

4. Originally Posted by ger21
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. Originally Posted by txcncman
+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. Originally Posted by donek
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.

7. 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

#### Posting Permissions

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