@infiniteloop @OwenD
Thank you both for all of your help. I've implemented changes and I am not getting errors any more. I wont be able to print until tomorrow due to severe weather in my area.
But I wanted to post the scripts below to make sure I am not missing anything.
At the end of config.g
global move.extruders[0].position=0.0
; daemon.g
; Constantly runs in background to check outputs etc
;
M98 P"filamentmonitor.g"
; filamentmonitor.g
; Check filament progress, feed pellets if needed
if job.file.fileName == null ; no job file around?
M99 ; exit
if {{global.filamentProgress + 11500.0} <= move.extruders[0].position} ; 11500 mm are done? Then …
set global.filamentProgress = {move.extruders[0].position + 11500.0} ; … prepare for the next meter
M106 P0 S255 ; … start the compressor (fan 0)
G4 S3 ; … wait 3 seconds
M106 P0 S0 ; … stop the compressor
; start.g
; runs immediately before any slicer created gcode
set global.filamentProgress = move.extruders[0].position
I am not sure how you are posting gcode script so mine is just copied and pasted. There are proper indents after the if statements in my files.