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

    Possible bug (RRF3.5.1): M208 throws error when used with array

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    4
    177
    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.
    • NeoDueundefined
      NeoDue
      last edited by NeoDue

      In order to make axis limits tool-dependent (see here), i wanted to define the X and U limits on my IDEX printer as follows:

      ; config.g
      if !exists(global.X_Limit)
          global X_Limit = {-175.5,151}       ; X limits
      if !exists(global.U_Limit)
          global U_Limit = {-151,175.5}       ; U limits
      
      ;[...]
      
      M208 X{global.X_Limit[0]}:{global.X_Limit[1]} Y-101:101 Z0:209 U{global.U_Limit[0]}:{global.U_Limit[1]}
      

      That resulted in the error "M208: U axis maximum must be greater than minimum".

      The same happens if I define only the U or the X values to shorten the command.

      If I use the old separate notation however...

      M208 S0 X{global.X_Limit[1]} Y101 Z209 U{global.U_Limit[1]}
      M208 S1 X{global.X_Limit[0]} Y-101 Z0 U{global.U_Limit[0]}
      

      ...it works as it should, except that the variables are not replaced by their values in the console output.

      Can anyone confirm this behaviour?

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @NeoDue
        last edited by

        @NeoDue There has been a change to the way that expressions are used as parameters with array type in GCode commands. Now the entire parameter must be either a colon-separated list of literal values, or an expression of array type. Try this:

        M208 X{global.X_Limit[0], global.X_Limit[1]} Y-101:101 Z0:209 U{global.U_Limit[0], global.U_Limit[1]}
        

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        NeoDueundefined 1 Reply Last reply Reply Quote 1
        • NeoDueundefined
          NeoDue @dc42
          last edited by

          @dc42 Thanks, that one works as intended 🙂

          dc42undefined 1 Reply Last reply Reply Quote 0
          • NeoDueundefined NeoDue marked this topic as a question
          • NeoDueundefined NeoDue has marked this topic as solved
          • dc42undefined
            dc42 administrators @NeoDue
            last edited by dc42

            @NeoDue I have now added this change to the upgrade notes at https://github.com/Duet3D/RepRapFirmware/wiki/Changelog-RRF-3.x#reprapfirmware-351-stable-changes-since-346.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

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