Share this

How to make two lights flash alternately in a Siemens PLC?

2026-04-06 04:48:31 · · #1

Today, let's look at a Siemens example—how a Siemens S7-200 SMART PLC can achieve alternating flashing of two lights.

Let's first look at the specific requirements of this example:

Using timers Q0.0 and Q0.1, when the start button is pressed, Q0.0 lights up, turns off after 1 second, and Q0.1 lights up simultaneously. Two seconds later, Q0.1 turns off. This cycle repeats until the stop button is pressed, at which point both Q0.0 and Q0.1 turn off.

The first step is to draw a timing diagram. Then, using timers and comparisons will simplify many complex aspects.

A timing diagram is a graphical representation of how addresses or variables change over time.

The entire process takes 3 seconds and requires a 100-millisecond timer.

Let the current value of the timer be X. When 0 ≦ X < 10, Q0.0 is lit; when 10 ≦ X < 30, Q0.1 is lit.

The next issue is the problem of loops, where the last state is used as the trigger condition for the first state.

The timer PT value is 3 seconds (numerical value is 30). The delay timer is turned on using TNO. When the current value equals the set value and the status output is 1, that is, when the timer status bit T37=1, the timer is reset and starts from 0 again. This is self-reset, which means that it resets itself. After 3 seconds, it starts from 0 again.

Finally, let's summarize the thought process behind writing the program:

1. Start/Stop Control – Output start flag bit, output is 1 and remains (self-locking).

2. Timer Control – Use the start flag to activate the timer and make it work.

3. Comparison – Q0.0 output for 0-1 seconds, Q0.1 output for 1-3 seconds.

There is also a second method, which uses an oscillating circuit (flashing circuit) and two timers to control the on-time and off-time alternately.


Disclaimer: This article is a reprint. If it involves copyright issues, please contact us promptly for deletion (QQ: 2737591964). We apologize for any inconvenience.

Read next

Analysis: Latest Developments in Automotive Drive Belt Technology

Automotive drive belts are crucial components of car engines and an integral part of the transmission belt system. Many ...

Articles 2026-02-22