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

    while command not work properly while printing

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    4
    195
    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.
    • FBGundefined
      FBG
      last edited by

      Re: How to make a loop of a Output_Pin ON and OFF?

      Sorry for late response...

      If i try the code (inside daemon.g):

      while state.status  != "printing"
          M42 P1 S1
          G4 S2
          M42 P1 S0
          G4 S10
      

      Works properly as the code said.

      But i want that works while i am printing so... i use:

      while state.status  != "idle"
          M42 P1 S1
          G4 S2
          M42 P1 S0
          G4 S10
      

      If I start printing a file, it seems that the Duet3 6HC can't do two things at the same time... The duet can't make any movement and while it does it it loops.
      Activates or deactivates the port sometimes during line changes.

      It's like not having multitasking... one task to make the loop and another task to make movements...

      Surely it can be done, but I don't know how...

      Thank you!

      gloomyandyundefined timschneiderundefined 2 Replies Last reply Reply Quote 0
      • gloomyandyundefined
        gloomyandy @FBG
        last edited by

        @FBG said in while command not work properly while printing:

        Activates or deactivates the port sometimes during line changes.

        Can you explain a little more about what exactly you mean by this?

        1 Reply Last reply Reply Quote 0
        • timschneiderundefined
          timschneider @FBG
          last edited by

          @FBG
          M42 is queued in the movement queue, so you can try to bypass the queue:

          while state.status  != "idle"
              M42 P1 S{1}
              G4 S2
              M42 P1 S{0}
              G4 S10
          

          maybe this helps.

          FBGundefined 1 Reply Last reply Reply Quote 0
          • FBGundefined
            FBG @timschneider
            last edited by

            @gloomyandy I mean turn on/off the output relay

            @timschneider thank you!!! now work properly!!

            1 Reply Last reply Reply Quote 1
            • timschneiderundefined timschneider referenced this topic
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA