M291 message non blocking execution
-
Hi. I have a macro wich objective is to ask me if I want or not to execute another macro at the end of the print.
At the beginning of that macro I have this:M291 S4 K{"YES","NO"} J1 T30 P"Print has finished. Do oyu want to run cooling?"
This M291 createsa message, where I can read YES, NO, and a CANCEL buttom. And if user doesnt answer, it should time out in 30 secconds and close the window.
Documentation says the CANCEL buttom cancel inmediatly the excution of the curret macro. That is ok.
But I have this at the very start of the macro, so what I wanted is to stop there at least for 30 secodns before continue with the rest of the macro. But it is not working like that. Message appears and looks like it nevers times outAm I doing it wrong??
-
@Tinchus From the docs it looks like what should happen is that if the timeout is reached then the message box will be cancelled (which I think will also abort your script). Is that what is happening? If not then I think you need to provide more information (like the version of RRF you are running, standalone or SBC mode etc.).
I suspect that what you want is for your script to be able to detect the timeout and be able to continue. This is not currently possible. See a discussion of this here: https://forum.duet3d.com/topic/36445/m291-t-value-to-return-a-result?_=1727454749164 and a related feature request here: https://github.com/Duet3D/RepRapFirmware/issues/959
-
@gloomyandy The I understood incorrectly documentation. I thought that if there was a time out, the macro continuos, the macro is cancelled only if I press the CANCEL buttom. Docuemtnation says:
Jn (RRF 3.5 and later only, optional) If message box mode >= 4: 0 = no Cancel button (default), 1 = display a Cancel button (job/macro is cancelled immediately when pressed)
If J4 cancell the macro/job, I think ther eis no pint in cancelling the macro too with the timeout?
Im using duet3, 3.5.3, SBC mode
-
@Tinchus The documentation says: "Tn Timeout in seconds, only used for types 0, 1, and those with a cancel button (type 3 or higher with J1 parameter; the message box is cancelled upon timeout)". If you read the first link I posted DC42 says: "Timing out is equivalent to pressing the Cancel button, if there is one". So I think what you are seeing is the currently documented behaviour. As you can see, there is a feature request already open to enhance this.
-
@gloomyandy Ok, I understand, it is a interpretation thing I think because it is correct that DC made a clarification that I didnt read, I interpreted "time out" of the mnessage box, not of the whole maCRO AS IF CANCEL WAS PRESSED.
So lets see how can I achieve my objective, if you can help me on that would be great: As I posted, I run a macro, at the beginning I have that message , my objective is to be able on some situations, in order to save time, to just cancel the rest of the macro. So My message ask for a yes or no. But also, if Im not available, I want that message to time out and default behaviour should be to continue and execute the rest of the macro. Is there today a way to do that because if the time out jwill cancell everything, Im out of options