Introduction
A flashing light circuit with timers helps control lights to turn on and off repeatedly at set intervals. This is useful for signaling or alerting in machines or buildings.
TON TimerName(IN:=Condition, PT:=TimeValue, Q=>Output, ET=>ElapsedTime); // TON is an ON-delay timer // IN: input to start timer // PT: preset time (how long to wait) // Q: output becomes true after PT // ET: elapsed time since timer started
Timer1(IN:=StartButton, PT:=T#1s, Q=>Timer1Done);FlashTimer(IN:=NOT FlashTimer.Q, PT:=T#500ms, Q=>FlashTimer.Q);(* Flashing light using TON timer in Structured Text *) VAR FlashTimer: TON; LightOutput: BOOL := FALSE; ResetPulse: BOOL := FALSE; END_VAR FlashTimer(IN := NOT ResetPulse, PT := T#500ms); IF FlashTimer.Q THEN LightOutput := NOT LightOutput; END_IF; ResetPulse := FlashTimer.Q; (* Output LightOutput controls the flashing light *)
TON T1(IN:=Start, PT:=T#2s); IF T1.Q THEN Light := NOT Light; T1(IN:=FALSE); END_IF;
TON T1(IN:=Start, PT:=T#3s); IF T1.Q THEN Light := NOT Light; END_IF; T1(IN:=Start);
Pass the test and this pattern moves unknown