GCode Preview as JSON

  • hydroid7
  • hydroid7's Avatar Topic Author
  • Away
  • New Member
  • New Member
More
21 May 2024 18:50 #301101 by hydroid7
GCode Preview as JSON was created by hydroid7
Hi,
I'm using the following code to generate a list of waypoints (JSON) of the loaded GCode. Using the attached script, I get the output.txt when using a simple GCode without subroutines or remapped codes. This is still not ideal, as for plotting short line segments would be ideal, like in Gremlin.

However, on any remapped GCODE or on any subroutine I get an error: "EOF in file:/home/admin/default.ngc seeking o-word: o<bohrung> from line: 6"

Of course Linuxcnc is running in a separate window.

Can you please advice me some directions how I could tell the PlotGenerator the remapped GCodes and subroutines?
Thank you in advance!
 
Attachments:

Please Log in or Create an account to join the conversation.

More
25 May 2024 08:48 #301383 by andypugh
Replied by andypugh on topic GCode Preview as JSON
"EOF in file" is what LinuxCNC says when it can't find the subroutine file, generally a problem with the SUBROUTINE_PATH.

I am not familiar with the gcode python module, but I wouldn't be surprised to find that the last parameter that you have as an empty string is meant to be the INI file where the parser can find the SUBROUTINE_PATH info.

Please Log in or Create an account to join the conversation.

  • hydroid7
  • hydroid7's Avatar Topic Author
  • Away
  • New Member
  • New Member
More
26 May 2024 07:23 #301464 by hydroid7
Replied by hydroid7 on topic GCode Preview as JSON
Thank you for the hint! Indeed, the EOF was appearing because it did not found a file. However, the last argument is that to the parameter file (rs274ngc.var)

Interesting enough, if I run the same script with axis started, I get my code working.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum