Closed TurBoss closed 6 years ago
@TurBoss thanks for the issue!
My CAM software doesn't generate line numbers, so I hadn't picked this problem up yet.
Workaround
define the following class (anywhere)
import pygcode
class GCodeLineNumber(pygcode.gcodes.GCode):
@classmethod
def word_matches(cls, w):
return w.letter == 'N'
word_letter = 'N'
word_value_configurable = True
exec_order = 0
but before that works, you'll have to modify a line in gcode.py
from:
if (not exhaustive) and (word.letter not in 'GMFST'):
to
if (not exhaustive) and (word.letter not in 'GMFSTN'):
If you're interested
The issue is that the parser pulls all words (<letter><number>
) out of the gcode string, then attempts to bind them as parameters to the closest valid gcode to the left of it.
Anything that remains (in your case, N10
) is considered to be a parameter to a modal motion gcode (eg: G0
)...
So what this is saying is that G0 N10
isn't a valid code, which it isn't... but that's because I haven't assigned N
codes to be their own dummy gcode.
I'll be releasing v0.1.3
very soon to fix this, and some other issues.
correction: make that v 0.2.0
, I'll move this lib to alpha
ok, new version is out... let me know if you have any more troubles.
Thank yo so much
Hello,
I'm trying to process a program that contains N codes at the begining of each line
while trying to process the block in the machine an error is raised
I was trying to figure what is wrong but failed
Thanks this project is great