1
G-Code, CAD, and CAM discussions / Re: Need to run GCode between certain times.
« Last post by Marcwolf on December 16, 2025, 03:26:18 PM »I have whipped up this pseudo code that should do it. you start by tunning this when you ready to start the job..
Const StrtTime = ' mins at 8am
Const EndTime = ' mins at 5pm
Var iRunning as Boolean
Var oRunning as Boolean
iRunning = True
oRunning = True
Start the Job
While Job_active ' Checks that the current job is running and not finished
Get System Time in minutes from midnight
If system time between StrtTime and EndTime then
iRunning = False
Else
iRunning = True
End if
Do ' Stop testing too quickly. We are not worried about seconds
Wait 5 mins
sleep
Loop
If oRunning <> iRunning
if iRunning = False
FeedHold
oRunning = False
else
Run Job
oRunning = true
end if
end if
Loop
Const StrtTime = ' mins at 8am
Const EndTime = ' mins at 5pm
Var iRunning as Boolean
Var oRunning as Boolean
iRunning = True
oRunning = True
Start the Job
While Job_active ' Checks that the current job is running and not finished
Get System Time in minutes from midnight
If system time between StrtTime and EndTime then
iRunning = False
Else
iRunning = True
End if
Do ' Stop testing too quickly. We are not worried about seconds
Wait 5 mins
sleep
Loop
If oRunning <> iRunning
if iRunning = False
FeedHold
oRunning = False
else
Run Job
oRunning = true
end if
end if
Loop

Recent Posts