Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line Number Mismatch in G-Code Error Reporting #588

Open
siganberg opened this issue Dec 23, 2024 · 2 comments
Open

Line Number Mismatch in G-Code Error Reporting #588

siganberg opened this issue Dec 23, 2024 · 2 comments

Comments

@siganberg
Copy link

Description:
When an error occurs, the reported line number of the culprit G-code does not match the actual line number in the G-code file. Even after cleaning up comments and empty lines, the line numbers still do not align.

This mismatch makes it challenging to troubleshoot and accurately determine where to resume the job.

Expected Behavior:
The reported line number should match the actual line number in the G-code file for easier troubleshooting and job resumption.

Impact:
This discrepancy adds difficulty in pinpointing the exact location of issues and determining where to resume operations after an error.

Suggestion:
Ensure the line numbers reported in errors accurately match the G-code file’s actual line numbers, regardless of comments or empty lines.

Additional Context:
None.

Let me know if any further details are required!

Screenshot 2024-12-22 at 8 52 04 PM
@siganberg
Copy link
Author

Aside from mismatched line numbers when you have comments or empty lines, it actually reports the wrong g-code line that caused the problem.

As shown in the image below, the actual invalid code is on line 21.

Screenshot 2024-12-22 at 9 46 48 PM

Here a simple g-code that I use to test

(2D Contour1)
G90 G94
S5000 M3
G54
M8
G0 X-20.316 Y-17.472
Z15
G00 Z5.0 (Changed from: "G1 Z5 F5000")
G01 Z0.632 F3000 (Changed from: "Z0.632 F3000")
Z-19.684
Y-17.48 Z-19.754 F5000
Y-17.503 Z-19.821
Y-17.541 Z-19.881
Y-17.591 Z-19.931
Y-17.651 Z-19.969
Y-17.718 Z-19.992
Y-17.788 Z-20
Y-18.104
G3 X-20 Y-18.42 I0.316 J0

G100 X38.42 ;intended wrong

G1 X38.42
Y18.42
X-38.42
Y-18.42
X-20
G3 X-19.684 Y-18.104 I0 J0.316
G1 Y-17.788
Y-17.718 Z-19.992
Y-17.651 Z-19.969
Y-17.591 Z-19.931
Y-17.541 Z-19.881
Y-17.503 Z-19.821
Y-17.48 Z-19.754
Y-17.472 Z-19.684
G00 Z15.0 (Changed from: "Z15")

@mattydboom
Copy link

I have noticed this behaviour too and after some wild goose chases to eventually realise the true culprit was not the code line indicated, but one several lines prior.

The error reporting function is a brilliant and useful idea, but does needs to be made more accurate if it's going to be trusted & fulfil its function properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants