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

    object model aktiv extruder on an Idex

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    6
    192
    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.
    • Proschi3Dundefined
      Proschi3D
      last edited by

      can someone tell me what the code should look like if i want to use the if command on the active extruder?

      if {move.extruders[0].filament = "PLA"} 
       if {sensors.gpIn[1].value = 0} 
         M300 S600 P1000
         G4 S2
         M300 S600 P1000
         G4 S2
         M300 S600 P1000
         G4 S2
         M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
      

      Love my Duet 3 Mini.
      https://www.instagram.com/proschi3d
      https://youtube.com/@proschi3d
      https://www.proschi3d.de

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

        @Proschi78 This should work:

        if state.currentTool >= 0 && #tools[state.currentTool].extruders > 0
          var toolExtruder = tools[state.currentTool].extruders[0]
          if move.extruders[{var.toolExtruder}].filament = "PLA" && sensors.gpIn[1].value = 0 
           M300 S600 P1000
           G4 S2
           M300 S600 P1000
           G4 S2
           M300 S600 P1000
           G4 S2
           M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
        

        Duet software engineer

        Proschi3Dundefined 2 Replies Last reply Reply Quote 0
        • Proschi3Dundefined
          Proschi3D @chrishamm
          last edited by

          @chrishamm unfortunately didn't work.
          But that's how it works
          Anyways thanks for your help

          if (move.extruders[0].filament == "PLA" || move.extruders[1].filament == "PLA") 
           if {sensors.gpIn[1].value = 0} 
             M300 S600 P1000
             G4 S2
             M300 S600 P1000
             G4 S2
             M300 S600 P1000
             G4 S2
             M291 P"Tür oder Deckel geschlossen" R"Es wird PLA gedruckt bitte Deckel öffnen" S3
          

          Love my Duet 3 Mini.
          https://www.instagram.com/proschi3d
          https://youtube.com/@proschi3d
          https://www.proschi3d.de

          1 Reply Last reply Reply Quote 0
          • Proschi3Dundefined
            Proschi3D @chrishamm
            last edited by

            @chrishamm "The code you provided runs without errors, but there is neither a beep nor the M291 message displayed."

            Love my Duet 3 Mini.
            https://www.instagram.com/proschi3d
            https://youtube.com/@proschi3d
            https://www.proschi3d.de

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

              @Proschi78 I don't know what the value of your second gpIn port is but that script works OK on my setup if a tool is selected and if I remove the gpIn check.

              Duet software engineer

              Proschi3Dundefined 1 Reply Last reply Reply Quote 0
              • Proschi3Dundefined
                Proschi3D @chrishamm
                last edited by

                @chrishamm said in object model aktiv extruder on an Idex:

                I don't know what the value of your second gpIn port is but that script works OK on my setup if a tool is selected and if I remove the gpIn check.

                it's just a magnetic switch. 0 and 1

                Love my Duet 3 Mini.
                https://www.instagram.com/proschi3d
                https://youtube.com/@proschi3d
                https://www.proschi3d.de

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