Can't edit/save daemon.g that contains a 1 sec loop.
-
@DonStauffer said in Can't edit/save daemon.g that contains a 1 sec loop.:
Also, what's the best way for it to check whether there's a print job running at the moment, so I can write code to only execute during a job?
Take a look at the object model documentaton: https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation in particular the state.status it probably has what you need.
-
@Tinchus said in Can't edit/save daemon.g that contains a 1 sec loop.:
if global.runDaemon = true while true mycode G4 S2
Use this instead:
while global.runDaemon mycode G4 S2
-
@gloomyandy That may work, but it does raise questions:
-
If state.status is "busy", does that imply a job is running, or is it impossible to tell whether maybe it's just executing a G1 from the console, for instance? Would you have to wait for it not to be busy to determine whether there's a job running?
-
Does running a macro count as "processing" or is that status only when an actual print job is running?
Put another way, what would the test be for simply whether a job is running/unfinished or not, regardless of what else exactly is happening at the time?
-
-
@DonStauffer state.status is "processing" only while a job is running from SD card. It's still "processing" even if the job calls a macro.