Parantesis inside a parantesis gives Bad Command
-
Hello
When using Fusion 360 and I copy an operation or setup, Fusion adds a (n) to the name of the operation. For example the copy of Contour1 is named Contour1 (2) and so on.
The gcode Fusion generates looks like:
(Contour1 (2))
This results in:
(Contour1 (2)) Error: Bad command: )
And that the line(s) right after are ignored.
I know that I could edit my post prosessor to fix this. But I guess that if this is a parsing issue is should be address in the firmware.
I'm running v3.3 (both firmware and dwc).
Best regards
Rickard -
@rzi According to this NIST document: https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir6556.pdf nested comments (which is what you have in effect in the examples) are not valid:
3.3.4 Comments and Messages Printable characters and white space inside parentheses is a comment. A left parenthesis always starts a comment. The comment ends at the first right parenthesis found thereafter. Once a left parenthesis is placed on a line, a matching right parenthesis must appear before the end of the line. Comments may not be nested; it is an error if a left parenthesis is found after the start of a comment and before the end of the comment. Here is an example of a line containing a comment: āG80 M5 (stop motion)ā. Comments do not cause a machining center to do anything.
I had a quick look at LinuxCNC and from some (rather old) posts on the forum it would seem that nested comments are not valid with that either. Not sure what other gcode processors do with them.
Are these comments being generated directly by fusion360 or is this some sort of custom post processor?
-
The gcode Fusion generates looks like:
(Contour1 (2))This is not a GCode. Here's a list of all available GCodes: GCode Dictionary
-
@rzi If it is just a comment, and intended to be ignored by the firmware, it should be preceded at the start of the line with a semicolon
;
, or enclosed in a single set of parentheses()
. See https://docs.duet3d.com/en/User_manual/Reference/Gcodes#commentsOtherwise, it's needs to be a valid Gcode.
Ian
-
Thanx for all the comment. I'm always amazing how fast things get sorted out when you guys kicks in.
It's generated by Fusion 360 and as it breakt with the gcode spec I just fix it in the post prosessor.
Best regards
Rickard -
@rzi I've updated that Gcode section to say that it should be just a single set of parentheses:
Alternatively, comments can be enclosed in a single pair of parentheses, e.g.
(comment)
. Comments cannot include double or nested parentheses, e.g.(comment (a bit more comment))
, and they must start and end on the same line.To be fair, I didn't even realise a comment could be in parentheses!
Ian