Close

Data gathering

A project log for Gcode Manipulator

Why G53 zero your CNC machine when you could just MOVE YOUR CODE to the origin!

AndyAndy 04/12/2016 at 15:220 Comments

As it turns out, there is a surprising amount of unwritten information in RS274 that can be synthesized via analysis. I've split this program into a CLI frontend and a library, and the library, named RS274, now supports doing some of this analysis. It now synthesizes the following meta-data from each file as it parses:


G0 X0 Y0 Z0
    X10 Y5
    X5 Z2

This information is useful for another project I'm working on, which is why I spent the time implementing it. The logic for doing so is very tricky when trying to use the least system resources possible, which is one of the goals of this project.

Lastly, ternary statements are awesome:

(isLineModal & isCommandMotion) ? isMotionBlock = true : (isLineModal | motionMatch[0] == "") ? isMotionBlock = true : isMotionBlock = false;

Discussions