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

    How to assign a value to a node? Or: Error: expected '='

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    3
    114
    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.
    • DavidG_68kg_PLAundefined
      DavidG_68kg_PLA
      last edited by

      How can I reset my extrusion factor via a macro (prior to the print start)?

      My macro looks as follows:

      if move.extruders[0].factor != 1
      	set move.extruders[0].factor = 1
      

      i usually get the following error:

      Error: expected '=' in line 2 of Reset Speed and extrusion factor.txt
      

      I already experimented with braces and different order - but i didnt get it to work.

      Thank you in advance!

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @DavidG_68kg_PLA
        last edited by

        @DavidG_68kg_PLA You cannot write to the object model directly using set, it only supports local or global variables. Use M221 D0 S100 or M221 D0 S{myFactor * 100} to set the extrusion factor.

        Duet software engineer

        DavidG_68kg_PLAundefined 1 Reply Last reply Reply Quote 1
        • DavidG_68kg_PLAundefined
          DavidG_68kg_PLA @chrishamm
          last edited by

          @chrishamm thanks, chris!

          1 Reply Last reply Reply Quote 0
          • dc42undefined dc42 marked this topic as a question
          • dc42undefined dc42 has marked this topic as solved
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA