Extruder Active Command In GCode Viewer

I am using a solenoid to extrude material (using M42 command). Because the GCode Viewer doesn't understand this by default, it shows these as travel moves. 

Is there any way I can convince the Gcode viewer that anything bounded by `M42 PX S255` and `M42 PX S0` is an extrusion, not travel?

One theory I have is that I could use a script to append "EX" to each G0/G1/G2 command between `M42 PX S255` and `M42 PX S0`. Thoughts?


  • No, M42 can not be used to show filament in viewer. You need E or A values and they must be meaningfull or relative extrusion enabled. If they are not correct from value, make sure not to compute width/height from extrusion amount. So a filter script (can be added into slicing process in printer settings->advanced) should use A and enable relative mode. A so firmware does ignore this part.
  • Thanks for the response. This is more-or-less how we solved this problem. I wasn't aware that A values would work. 

    We wrote a parsing script to add E values to each motion bounded by the M42 command. One additional issue is that we are using dwell command to extrude material, so we also used the parsing script to insert a circular "arc" at those locations. We will just use the modified gcode to visualize and load the un-modified gcode to print. Somewhat hacky, but seems to do the trick for now.


Sign In or Register to comment.