Using while in terminal commands



  • 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!



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



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


Log in to reply