Set Regular Job Timing
ok = job.set(n, txt, [var])
ok = job.set(n, txt, [var], [func])
#Firmware/v320
Sets the parameters for a job.
Parameter | Type | Description |
---|---|---|
n |
integer | Job number, 1-32 |
txt |
string | Job Schedule Strings |
var |
boolean | True to use serial number variance |
func |
function | Function to call |
Returns | Type | Description |
---|---|---|
ok |
boolean | True if successful |
When a job runs, it will make a call to a Lua function in the form onJob#
(where #
is the job number).
e.g.
function onJob21(jn, utc, utcj)
-- jn is the job number = 21
-- utc is the real time (could be behind realtime if catching up)
-- utcj is the utc time of this call including variance
end
job.set(21, '00:30:00') -- run every 30 minutes
#Firmware/v320
When a function is passed, the onJob#
function is assigned to this value.
If more than one call is made to a job index n
and a func
is passed, the last value will affect all callbacks (because it's reassigning onJob#
)