I'm still on 3.1.1 and I'm still having issues with the the M291 command. Here is the macro I'm trying to run:
; ToDo check Temp of bed and nozzle, so both are cold ; Cancel any currently active mesh compensation M561 ; Set z-probe trigger height to 0 G31 Z0 G1 X0 Y0 Z200 F6000 M291 P"Move to point were the z probe shall be calibrated." X1 Y1 S2 M291 P"Get a 0.1 mm thick metal spacer" S2 while iterations <= 5 G1 Z50 M291 P"Remove the z probe sensor if it is already or still attached" S2 G1 Z5 M291 P"Move FFF nozzle down until it just grabs a 0.1 mm thick metal spacer and then remove it." Z1 S2 G92 Z0.1 G1 Z50 M291 P"Attach the z probe" S2 G30 S-1 M291 P"Now calculate the average of the test. The average is the z probe trigger height for that point. Set it the config.g with G31 Z{ave} " S2After I click OK from the first M291 in line 7 the machine just stays busy and the second window does not open.