Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Parantesis inside a parantesis gives Bad Command

    Scheduled Pinned Locked Moved
    General Discussion
    4
    6
    260
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rziundefined
      rzi
      last edited by

      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

      gloomyandyundefined infiniteloopundefined droftartsundefined 3 Replies Last reply Reply Quote 0
      • gloomyandyundefined
        gloomyandy @rzi
        last edited by

        @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?

        1 Reply Last reply Reply Quote 2
        • infiniteloopundefined
          infiniteloop @rzi
          last edited by

          @rzi

          The gcode Fusion generates looks like:
          (Contour1 (2))

          This is not a GCode. Here's a list of all available GCodes: GCode Dictionary

          1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @rzi
            last edited by droftarts

            @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#comments

            Otherwise, it's needs to be a valid Gcode.

            Ian

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            rziundefined 1 Reply Last reply Reply Quote 0
            • rziundefined
              rzi @droftarts
              last edited by rzi

              @gloomyandy

              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

              droftartsundefined 1 Reply Last reply Reply Quote 0
              • droftartsundefined
                droftarts administrators @rzi
                last edited by

                @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

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA