SBC + DSF-API with M291 S3
-
I'm trying to write a macro with an Ok/Cancel Message box:
; ask for confirmation first M291 P"Are you sure?" S3 ; should only be executed if OK M1234 ; custom g-code via DSF-API
However, I this is not working as intended. The custom g-code executed before I even can click anything on the message box - it's almost as M291 is acting in non-blocking mode.
Is this a bug in M291, or do I need to flush the SBC DSF g-code queue and somehow read the result from M291 first?
I tried the
intercept_connection.flush(cde.channel)
as used in the pydsfapi example, but this simply blocks. And DWC seems also stuck with reporting "Busy" state for the printer. Reloading the browser simply displays the message again... -
@chrishamm anything in the upcoming v3.3 that would fix this?
I reported this broken behaviour with 3.2.2. -
@resam This is exactly the reason you need to perform a flush. See here for an example how custom codes may be implemented: https://github.com/Duet3D/DuetSoftwareFramework/blob/v3.3-dev/src/DuetPiManagementPlugin/Program.cs#L122