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

    Using while in terminal commands

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    2
    3
    123
    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.
    • jcsb1994undefined
      jcsb1994
      last edited by

      Hi,
      I am trying to implement a while loop meta command in one of my projects. It works fine when placing it into a g file that is uploaded and run as a print file.

      ;test.g
      ;echoes 12345 and executes a successful while loop
      echo 12345
      
      while true
      	G1 X25 F1500
      	G1 H1 X-25 F1500
      
      M0 H1
      

      But I want to see if it is possible to send a while loop via direct usb serial commands (i.e. through sending G code on a terminal). When sending the same string to the terminal (and making sure the indentation is still present) the Duet3D discards the while operation and does the moving only once.

      "motors: while true\n
          G1 H0 X25.417066 F528.000676\n
          G1 H1 X-25.417066 F528.000676\n"
      

      Is it possible or the while can onlu be used inside files?
      thanks!

      1 Reply Last reply Reply Quote 0
      • A Former User?
        A Former User
        last edited by

        what is the intended purpose of the motors: before the while loop which seems to differ from the macro file?

        jcsb1994undefined 1 Reply Last reply Reply Quote 0
        • jcsb1994undefined
          jcsb1994 @A Former User
          last edited by

          @bearer oups it is not part of the string, its just a pasting mistake

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