Is it possible to enable optional pause in expr.txt while gcode is running?
I have a temperature sensor which should enable optional pause if it is getting too hot, so the gcode may stop at the next optional pause, which is set in gcode at certain positions.
I have used the following code for e-stop on critical temperature:
if(and(_sx_tool_temperature == 1 , and(_sx_hasError == 0 , GT(_hw_aux2, _sx_tool_temperature_critical))), exec(_sx_hasError = 1, cmd('Machine.Emergency_Stop'), msg('Temperaturwarnung Kritisch')));
But I'd like to enable optional pause on lover value but don;t know how to write the part "cmd('Machine.Emergency_Stop')"... to enable optional pause instead.