How Can I delay the activation of the filament sensor until after the prime blob - will this work?

I'd like to delay the filament sensor until after the prime blob. Will something like this work? I'm trying to piece this together with other information I've found online and am unsure as to the formatting.
[gcode_macro enable_filament_sensor]
# Helper macro to enable runout sensor
gcode:
# Activate the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1

[gcode_macro _PRIME]
gcode:
# disable the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
# prime blob
{% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeblob' %}
PRIME_BLOB INITIAL_TOOLHEAD={params.INITIAL_TOOLHEAD} BOTH_TOOLHEADS={params.BOTH_TOOLHEADS} IDEX_MODE={params.IDEX_MODE} Y1={params.Y1}
{% endif %}
# call enable_runout_sensor with a delay of 1 sec
UPDATE_DELAYED_GCODE ID=enable_filament_sensor DURATION=1
[gcode_macro enable_filament_sensor]
# Helper macro to enable runout sensor
gcode:
# Activate the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1

[gcode_macro _PRIME]
gcode:
# disable the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
# prime blob
{% if printer["gcode_macro RatOS"].nozzle_priming|lower == 'primeblob' %}
PRIME_BLOB INITIAL_TOOLHEAD={params.INITIAL_TOOLHEAD} BOTH_TOOLHEADS={params.BOTH_TOOLHEADS} IDEX_MODE={params.IDEX_MODE} Y1={params.Y1}
{% endif %}
# call enable_runout_sensor with a delay of 1 sec
UPDATE_DELAYED_GCODE ID=enable_filament_sensor DURATION=1
Solution:
Not sure if I did this entirely correctly but it works... ```[delayed_gcode enable_filament_sensor] Helper macro to enable runout sensor gcode: # Activate the sensor...
Jump to solution
1 Reply
Solution
LogieBears
LogieBears6mo ago
Not sure if I did this entirely correctly but it works...
[delayed_gcode enable_filament_sensor]
# Helper macro to enable runout sensor
gcode:
# Activate the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1

[gcode_macro PRIME_BLOB]
description: Prints a primeblob, used internally, if configured, as part of the START_PRINT macro.
variable_x_offset: 5 # the prime blob x-margin
gcode:
# Handle toolhead settings
CACHE_TOOLHEAD_SETTINGS KEY="prime_blob"
SET_MACRO_TRAVEL_SETTINGS

RATOS_ECHO PREFIX="Priming" MSG="Priming nozzle with prime blob.."

# disable the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
...rest of the macro...
# call enable_filament_sensor with a delay of 1 sec
UPDATE_DELAYED_GCODE ID=enable_filament_sensor DURATION=1
[delayed_gcode enable_filament_sensor]
# Helper macro to enable runout sensor
gcode:
# Activate the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=1

[gcode_macro PRIME_BLOB]
description: Prints a primeblob, used internally, if configured, as part of the START_PRINT macro.
variable_x_offset: 5 # the prime blob x-margin
gcode:
# Handle toolhead settings
CACHE_TOOLHEAD_SETTINGS KEY="prime_blob"
SET_MACRO_TRAVEL_SETTINGS

RATOS_ECHO PREFIX="Priming" MSG="Priming nozzle with prime blob.."

# disable the sensor
SET_FILAMENT_SENSOR SENSOR=filament_sensor ENABLE=0
...rest of the macro...
# call enable_filament_sensor with a delay of 1 sec
UPDATE_DELAYED_GCODE ID=enable_filament_sensor DURATION=1

Did you find this page helpful?