Snapshot for report and light control

Hi together,

I have the following problem:

I added some light control to my G-Code. When the print starts I turn on the light. When the print is finished I turn of the light after some time.

Begin of print:
...CUT...
;@execute lighton M115 U3.6.0 ; tell printer latest fw version G90 ; use absolute coordinates ...CUT...
End of print:
...CUT...
M84 ; disable motors G4 S30 M84 ; Dummy to delay lightoff... ;@execute lightoff ...CUT...
The M84 before the "lightoff" is only that the G4 S30 has any effect. Otherwise the light switch immediately off.

If I activate now "Take snapshot" to the report settings the snapshot is always made in the dark (after the light is off). How can I avoid this? Is there any possible way switch the light of AFTER the snapshot?

Thanks in advance.

Alex

Comments

  • The problem is here the buffering and execution time. There is a server command (requires version 0.93.0 or later)
    ;@syncMotion

    that floods the firmware with M400 to ensure further execution only when previous commands are executed. The snapshot is only triggered and executed in a different thread so you need a delay in between. So I guess this end script should work as expected:
    M84
    ;@syncMotion
    ;@make_snapshot
    G4 S10
    ;@syncMotion
    ;@execute lightoff

Sign In or Register to comment.