UT_FLASHER — On/off pulse generator
UT_FLASHER — On/off pulse generator
A flashing lamp, a horn that pulses, or an "every 10 minutes, do this" trigger.
Pins
| Pin | Type | Default | What to wire | |
|---|---|---|---|---|
| in | Enable |
BOOL | FALSE | Runs while TRUE |
| in | OnTime |
TIME | T#500ms | |
| in | OffTime |
TIME | T#500ms | |
| in | StartOn |
BOOL | TRUE | First phase ON (a flasher) or OFF (an "every X, pulse" timer) |
| in | Hold |
BOOL | FALSE | Freezes the cycle with Q off; it carries on where it stopped when released |
| in | StartNow |
BOOL | FALSE | Rising edge: an ON phase starts now and the cycle restarts from it |
| out | Q |
BOOL | ||
| out | Pulse |
BOOL | One scan at the start of every ON phase. Use as an "every N seconds" trigger | |
| out | Cycles |
UDINT | ON phases since Enable came on |
|
| out | ET |
TIME | Time spent in the phase running now | |
| out | Remaining |
TIME | Time left in the phase running now | |
| out | NextOnIn |
TIME | Time to the next ON phase (T#0s while on). "Stirrer: next start in 42 m" |
How it works
Qis off wheneverEnableis off. WhenEnablecomes on, the first phase starts
at once: ON withStartOnTRUE (and aPulse), or OFF forOffTimewithStartOnFALSE.- Turning
Enableoff stops at once. Turning it on again starts again from the first
phase, andCyclesstarts again from 0.Cycleskeeps its last value whileEnableis off. - No drift. Each phase is timed from when it should have started, not from the
scan that noticed it. After 10,000 cycles the ON phases still start at exact
multiples ofOnTime + OffTime. - A change of
OnTimeorOffTimeacts on the phase running now. Shortening the ON
time below the time already on turnsQoff on the next scan. OnTime= 0:Qstays off and onlyPulsefires, everyOffTime.
OffTime= 0:Qstays on andPulsefires everyOnTime. Both 0:Pulse
fires every scan. A negative time counts as 0. Very long times are fine.QandPulsecan change at most once per scan. If a cycle is shorter than the
task interval,Cyclesstill counts every cycle.Holdstops the cycle's clock and turnsQoff. WhenHolddrops, the phase
carries on where it stopped: a stirrer blocked at minimum level gets the rest of
its ON phase once the level is back, and an OFF phase is lengthened by the time
held.ET,RemainingandNextOnInstand still while held (NextOnInstays
0 when the hold came in an ON phase: that phase is still to finish).StartNow(rising edge) starts an ON phase at once, with aPulse, and the
cycle is timed from it. A heldStartNowacts once. WhileHoldis on, the ON
phase starts whenHolddrops.ET,RemainingandNextOnInare allT#0swhileEnableis off. Show them
with UT_TIME_TEXT.
Last updated 2 hours ago
Was this helpful?