Gcode dot without decimals

Gcode dot without decimals

Anonymous
Not applicable
1,602 Views
8 Replies
Message 1 of 9

Gcode dot without decimals

Anonymous
Not applicable
Hi im creating my own gcode viewer for files created in fusion but i get some errors when parsing lines with a dot and no decimals, is there a reason why there are no decimals after some dots?

Like Z0.
0 Likes
Accepted solutions (1)
1,603 Views
8 Replies
Replies (8)
Message 2 of 9

Steinwerks
Mentor
Mentor
Accepted solution

You can force the number of characters shown after a decimal in the post. Generally this is because it takes less memory when you don't include a character, and many cnc controls need the decimal to define the geometry correctly (some are the opposite, but generally very few and much older machines).

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
Message 3 of 9

LibertyMachine
Mentor
Mentor

The decimal output, as well as the output of trailing zeroes in the G-Code is controlled by the Post Processor that you are using.

What post are you using to generate the code?

May I ask why you are creating a new g-code viewer as opposed to using Brackets? If it's options, have you considered NC Corrector?

 

Lastly, what do you mean by dots after decimals? In english shorthand, decimal and dot are often used interchangeably in speech


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
Message 4 of 9

Anonymous
Not applicable
Thanks, pardon the terminology, though it seems i was able to make you
understand so doesnt seem that relevant.

Its 3D gcode viewer im doing for my own software, where in the post is this
changed?
0 Likes
Message 5 of 9

LibertyMachine
Mentor
Mentor

For the XYZ output you would look here:

var xyzFormat = createFormat({decimals:(unit == MM ? 3 : 4), forceDecimal:true, trim:false});

You would also apply that same general formatting to other fields that you want that extra zero on, such as feed

 

The above changes yields:

G1Z0.0000F30.0

 

EDIT

(corrected the output, had too many .cps files open, got convoluted)


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
Message 6 of 9

Anonymous
Not applicable
Thanks!

And if i want to edit say the mach3 post, how would i do that?
0 Likes
Message 7 of 9

LibertyMachine
Mentor
Mentor

Select the post you want to edit (circled with the #1) and click on "Open Config" (circled with #2)

 

screenshot_50.png

 

This will give you the javascript for the mach 3 post processor.

Do note; Do a "Save As" and save the new post to a separate location from the Fusion file structure. Next update will overwrite all generic posts as well as any file stored in that OEM location


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
Message 8 of 9

Anonymous
Not applicable

Thanks again! 

I'm on mac and my box looks like this.


Skärmavbild 2017-01-06 kl. 09.54.10.png

 

0 Likes
Message 9 of 9

Anonymous
Not applicable

Found them here.

 

http://cam.autodesk.com/posts/

 

 

Thanks for all your help!

0 Likes