sys::Obj sys::Virtual sys::Component timing::Timer
public class Timer
[niagaraIcon="module://icons/x16/clock.png"]
Timer outputs a pulse for the configured amount of time "in" is used to fire the timer:
- if low, out is forced to false - if high, out = 1 until timer reaches "time" seconds Alternatively, the pulse can be fired from the "Start Timer" action if run is not linked.
public property int left [summary, unit="second", readonly]
Time left on the timer if running, in seconds If not running, this value is 0
public property bool out [readonly]
The timed output pulse
public property bool run [falseText="stop", trueText="run"]
Used to fire the timer on transition from false -> true
public property int time [summary, config, unit="second"]
Desired duration of the output pulse, in seconds
public virtual override void changed(Slot slot)
override changed to recompute ms length of the timer if the time changes
public virtual override void execute()
Execute is called once every scan.
public action void resetTimer()
Action to reset the timer. Any time already in progress is immediately canceled, and the "left" is set to 0 sec
public virtual override void start()
start computes the ms length of the timer
public action void startTimer()
Used to manually start the timer in cases where there is no link to "in" property Issuing this command while the timer is already active will reset/restart the timer