Skip to content

How to clear current motion

HuttonGe edited this page Dec 13, 2021 · 13 revisions

Caution

If you want to use this function, please make sure the firmware is v4.5.0 or later.

For Gcode cmd

Applicable under the G0 G2202 G2206 instruction

1.send "S1000 V0" string to suspend motion

2.send "S1100" string to clear motion buffer

3.send "S1000 V1" string to restart motion

Applicable under the G1 G2201 G2204 G2205 instruction

1.send "!" string to suspend motion

2.send 0x18 to clear motion buffer

3.send "~" string to restart motion

For python library

Applicable under the G0 G2202 G2206 instruction

swift.set_position(x=200, y=0, z=150, speed=10, wait=True, timeout=10) #init positon

swift.set_position(x=200, y=0, z=0, speed=10) # this must close wait system

time.sleep(1)

swift.send_cmd_sync(msg='S1000 V0') # suspend motion

time.sleep(1)

swift.send_cmd_sync(msg='S1100') # clear motion buffer

time.sleep(1)

swift.send_cmd_sync(msg='S1000 V1') # restart motion

Applicable under the G1 G2201 G2204 G2205 instruction

swift.set_position(x=200, y=0, z=150, speed=10, wait=True, timeout=10) #init positon

swift.set_position(x=200, y=0, z=0, speed=10) # this must close wait system

time.sleep(1)

swift.send_cmd_sync(msg='!') # suspend motion

time.sleep(1)

swift.send_cmd_sync(msg=chr(0x18)) # clear motion buffer

time.sleep(1)

swift.send_cmd_sync(msg='~') # restart motion