D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 29 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
reader.setInterval (func, interval)
The setInterval method calls a function or evaluates an expression at specified intervals, in
seconds. setInterval method will continue calling the function until clearInterval is called.
The ID value returned by setInterval is used as the parameter for the clearInterval method.
Example:
intervalId = reader.setInterval(function, interval_sec);
reader.clearInterval(intervalId)
The clearInterval method removes the instance of setInterval that has the handle intervalId.
Example:
reader.clearInterval(intervalId);
reader.setTimeout (func, delay)
The reader.setTimeout() method calls a function after a delay number of seconds. The
function cannot be a code-predefined object method.
The ID value returned by reader.setTimeout() is used as the parameter for the
reader.clearTimeout() method.
Example:
timeoutId = reader.setTimeout(function, timeout_sec);
reader.clearTimeout(timeoutId)
The clearTimeout method removes the instance of setTimeout that has the handle timeoutId.
Example:
reader.clearTimeout(timeoutId);
reader.tick1Hz() – default implementation
This implementation is used to manage the internal “interval”
timers.cra.js
Code provides default reader behavior by implementing special features in JavaScript. These special
features are in “.cra.js”.
reader.onEvent(event)
This function checks for a function variable “rules_onEvent” and if it is not “null”, it will call
that function. If “rules_onEvent” returns false, the function will handle the call.