docs: Add documentation for [delayed_gcode]
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
314b9654c6
commit
e19a41d0dd
|
@ -1693,3 +1693,16 @@
|
||||||
#release_gcode:
|
#release_gcode:
|
||||||
# A list of G-Code commands to execute when the button is released.
|
# A list of G-Code commands to execute when the button is released.
|
||||||
# G-Code templates are supported.
|
# G-Code templates are supported.
|
||||||
|
|
||||||
|
# Execute a gcode on a set delay.
|
||||||
|
#[delayed_gcode my_delayed_gcode]
|
||||||
|
#initial_duration: 0.
|
||||||
|
# The duration of the initial delay (in seconds). If set to a non-zero
|
||||||
|
# value the delayed_gcode will execute the specified number of seconds
|
||||||
|
# after the printer enters the "ready" state. This can be useful for
|
||||||
|
# initialization procedures or a repeating delayed_gcode. If set to 0
|
||||||
|
# the delayed_gcode will not execute on startup. Default is 0.
|
||||||
|
#gcode:
|
||||||
|
# A list of G-Code commands to execute when the delay duration has
|
||||||
|
# elapsed. G-Code templates are supported. This parameter must be
|
||||||
|
# provided.
|
||||||
|
|
|
@ -186,3 +186,64 @@ gcode:
|
||||||
|
|
||||||
Be sure to take the timing of macro evaluation and command execution
|
Be sure to take the timing of macro evaluation and command execution
|
||||||
into account when using SET_GCODE_VARIABLE.
|
into account when using SET_GCODE_VARIABLE.
|
||||||
|
|
||||||
|
### Delayed Gcodes
|
||||||
|
|
||||||
|
The [delayed_gcode] configuration option can be used to execute a delayed
|
||||||
|
gcode sequence:
|
||||||
|
|
||||||
|
```
|
||||||
|
[delayed_gcode clear_display]
|
||||||
|
gcode:
|
||||||
|
M117
|
||||||
|
|
||||||
|
[gcode_macro load_filament]
|
||||||
|
gcode:
|
||||||
|
G91
|
||||||
|
G1 E50
|
||||||
|
G90
|
||||||
|
M400
|
||||||
|
M117 Load Complete!
|
||||||
|
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
|
||||||
|
```
|
||||||
|
|
||||||
|
When the `load_filament` macro above executes, it will display a
|
||||||
|
"Load Complete!" message after the extrusion is finished. The
|
||||||
|
last line of gcode enables the "clear_display" delayed_gcode, set
|
||||||
|
to execute in 10 seconds.
|
||||||
|
|
||||||
|
The `initial_duration` config option can be set to execute the
|
||||||
|
delayed_gcode on printer startup. The countdown begins when the
|
||||||
|
printer enters the "ready" state. For example, the below delayed_gcode
|
||||||
|
will execute 5 seconds after the printer is ready, initializing
|
||||||
|
the display with a "Welcome!" message:
|
||||||
|
|
||||||
|
```
|
||||||
|
[delayed_gcode welcome]
|
||||||
|
initial_duration: 5.
|
||||||
|
gcode:
|
||||||
|
M117 Welcome!
|
||||||
|
```
|
||||||
|
|
||||||
|
Its possible for a delayed gcode to repeat by updating itself in
|
||||||
|
the gcode option:
|
||||||
|
|
||||||
|
```
|
||||||
|
[delayed_gcode report_temp]
|
||||||
|
initial_duration: 2.
|
||||||
|
gcode:
|
||||||
|
{printer.gcode.action_respond_info(
|
||||||
|
"Extruder Temp: %.1f" %
|
||||||
|
(printer.extruder0.temperature))}
|
||||||
|
UPDATE_DELAYED_GCODE ID=report_temp DURATION=2
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
The above delayed_gcode will send "// Extruder Temp: [ex0_temp]" to
|
||||||
|
Octoprint every 2 seconds. This can be canceled with the following
|
||||||
|
gcode:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
UPDATE_DELAYED_GCODE ID=report_temp DURATION=0
|
||||||
|
```
|
||||||
|
|
|
@ -500,3 +500,12 @@ section is enabled.
|
||||||
matching the supplied name from persistent memory. Note that after SAVE
|
matching the supplied name from persistent memory. Note that after SAVE
|
||||||
or REMOVE operations have been run the SAVE_CONFIG gcode must be run
|
or REMOVE operations have been run the SAVE_CONFIG gcode must be run
|
||||||
to make the changes to peristent memory permanent.
|
to make the changes to peristent memory permanent.
|
||||||
|
|
||||||
|
## Delayed GCode
|
||||||
|
|
||||||
|
The following command is enabled if a [delayed_gcode] config section has
|
||||||
|
been enabled:
|
||||||
|
- `UPDATE_DELAYED_GCODE [ID=<name>] [DURATION=<seconds>]`: Updates the
|
||||||
|
delay duration for the identified [delayed_gcode] and starts the timer
|
||||||
|
for gcode execution. A value of 0 will cancel a pending delayed gcode
|
||||||
|
from executing.
|
||||||
|
|
Loading…
Reference in New Issue