I have been thinking about what will be required to get a 3D preview working to show Gcode travel paths. So as the first step I needed to get a Gcode parser coded in Labview for Linuxcnc.
Back in Feb/March of 2015 johnwu130 on github had posted a gcode parser for Labview 2014 that was partially completed as a sample but written for NI Motion hardware controllers. His code however looked like a good starting point for use with Linuxcnc and I was able to make the required changes and additions to get it working with Linuxcnc .ngc files.
For my preliminary work on getting a Gcode 3D preview working I'm using the arcspiral.ngc file from the NC folder with some minor changes in Z axis values to keep my machine from going into limits if it is raised more than .05 above its homed zero.
I have the Gcode parser breaking out my added line numbers, Gcode, Mcode, Ocode, R, X, Y, Z, I , J, K, P, feed and speed data for now. A code will carry forward in a line until changed by another code. The arcspiral.ngc test file has 1007 lines of Gcode
The first 10 lines of the input file. The spaces are removed and all are changed to upper case prior to entering the parser.
The parsed result in a array containing the values in clusters.
I can now use the data in the clusters to start work on the 3D preview display.