Conditional g-code extra functions
tekkydave last edited by tekkydave
I would like to see some simple date/time functions added to the meta commands. At the moment I can't manually kill a long-running macro without doing an emergency stop. If the macro itself could calculate how long it has been running it could execute an M99 itself.
One possible solution is a getDateTime function that populates an array:
var dt = getDateTime()
dt is 4-digit year
dt is month 1-12
dt is day of month 1-31
dt is hour 0-23
dt is minute 0-59
dt is second 0-59
dt is milliseconds 0-999 (if possible)
could also have day of week (mon,tue etc) or week number (0-52) etc etc
Alternatively the format could be similar to the object model:
e.g. dt.year. dt.month etc
There is already an up time variable in the OM. However, to implement timeouts I think you will need to use variables, so that you can capture the up time at the start of the macro.
tekkydave last edited by
Ok, that's interesting about the uptime. I realise my solution would have to wait for variables.
I also just discovered that I can use the M291 command to periodically check with the user if they want to continue. It's a useful workround for now.