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

trigger a macro with toolboard button

Scheduled Pinned Locked Moved Solved
Duet Hardware and wiring
4
8
511
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.
  • undefined
    Pseud3mys
    last edited by 5 Dec 2020, 17:12

    Hi,
    I tried to trigger a macro when I click on one button of ToolBoard.
    this is the Gcodes on my config file:

    ; Input/Output
    M950 J1 P"!121.button0"
    M581 P1 T1 S1
    

    and the macro named "trigger1.g":

    ;trigger1.g
    echo "button0"
    M300 S300 P200
    

    Why this don't work ?

    undefined undefined 2 Replies Last reply 5 Dec 2020, 21:31 Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 5 Dec 2020, 18:29

      What actually happens?

      I'm not sure that's how echo is intended to work.

      https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Echo_command

      T1 would mean trigger1 which I believe means pause the print. I think you'd need to start at trigger2

      https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_RepRapFirmware_3_01RC2_and_later

      Trigger number 0 causes an emergency stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater than 1 causes the macro file sys/trigger#.g to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the M400 command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 5 Dec 2020, 19:06 Reply Quote 0
      • undefined
        Pseud3mys @Phaedrux
        last edited by Pseud3mys 12 May 2020, 19:10 5 Dec 2020, 19:06

        @Phaedrux It change to trigger5, to be sure. Still nothing happen, when i click the button.
        I refer to this exemple: https://www.wildbot3d.xyz/control-panel/, but it is a bit old.

        1 Reply Last reply Reply Quote 0
        • undefined
          Pseud3mys
          last edited by 5 Dec 2020, 19:42

          Is there a way to read directly the value of a input ?

          1 Reply Last reply Reply Quote 0
          • undefined
            Pseud3mys
            last edited by 5 Dec 2020, 19:57

            from https://duet3d.dozuki.com/Wiki/Duet_3_Tool_Board#Section_Buttons_and_LEDs

            The buttons can be used to generate triggers in the normal way. Their pin names are "button0" and "button1". The required pullup resistors are enabled automatically on these pins.

            So this is possible normally, but there are no doc to do it...

            1 Reply Last reply Reply Quote 0
            • undefined
              dc42 administrators @Pseud3mys
              last edited by 5 Dec 2020, 21:31

              @Pseud3mys said in trigger a macro with toolboard button:

              M950 J1 P"!121.button0"

              The port name parameter in M950 is C, not P.

              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 1
              • undefined
                Pseud3mys
                last edited by 6 Dec 2020, 21:21

                RESPONSE:
                It is C parameter for the pin name, and trigger1 is already used.
                the corrected code:

                ; Input/Output
                M950 J1 C"!121.button0"
                M581 P1 T2 S1
                

                AND the triggerX.g must be in /sys/ directory.

                1 Reply Last reply Reply Quote 0
                • undefined
                  RodrigoRMaraujo @Pseud3mys
                  last edited by 8 Aug 2021, 22:09

                  @pseud3mys said in trigger a macro with toolboard button:

                  Hi,
                  I tried to trigger a macro when I click on one button of ToolBoard.
                  this is the Gcodes on my config file:

                  ; Input/Output
                  M950 J1 P"!121.button0"
                  M581 P1 T1 S1
                  

                  and the macro named "trigger1.g":

                  ;trigger1.g
                  echo "button0"
                  M300 S300 P200
                  

                  Why this don't work ?

                  Pseud3mys , please.
                  I'm trying to figure out what it would be like to connect the wires to the buttons on the board, using a 3 mini 5+ duet. Would you know how to recommend me?

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