Functional Block Diagram PLC Example for Traffic Light System

In PLC programming, as there are five programming languages, one of the most preferred and best ones out of them is a functional block diagram. Due to it’s block diagram representation, troubleshooting and viewing becomes very easy.

Traffic Light System

One of the most common pieces of logic that every newcomer faces in his career is traffic light signal logic. The logic is taught to new PLC programmers as it uses a good amount of logic, and is not that simple. In this post, we will see traffic light logic in a functional block diagram.

First, let us see the test bench criteria and condition of the logic. As soon as the start button is pressed, the red light will turn on first for a set time of 10 seconds. After that time, the red light will turn off and the yellow light will turn on for a set time of 10 seconds.

After that time, the yellow light will turn off and the green light will turn on for a set time of 10 seconds. After that time, the green light will turn off and the red light will turn on again for a set time of 10 seconds.

The cycle repeats as long as the stop button is not pressed. If in any sequence, the stop button is pressed, then the whole logic will reset and all lamps will turn off. The cycle will start again from scratch once the start button is pressed again.

Functional Block Diagram PLC Example

Now that we have seen the question, let us come up with an answer using a functional block diagram. Refer to the below image for the logic written.

We have used two inputs – start and stop push buttons, three outputs – red, yellow, and green lamps, three timers – on timer for each lamp, and one internal variable – showing logic running or not.

Functional Block Diagram PLC Example for Traffic Light System

Now, let us start developing the logic. As per the first condition, when we press start, the red light turns on for a set time. So, we have set the light as shown with the S symbol in the image. At the same time, we set the internal variable of the running bit.

Now, we use the red lamp to turn on the red lamp timer for 10 seconds. The output bit of the timer is used to set the yellow lamp first and then reset the red lamp, shown as the R symbol. After this, the red lamp timer turns off.

Now, we use the yellow lamp to turn on the yellow lamp timer for 10 seconds. The output bit of the timer is used to set the green lamp first and then reset the yellow lamp. After this, the yellow lamp timer turns off.

Now, we use the green lamp to turn on the green lamp timer for 10 seconds. The output bit of the timer is used to set the red lamp first and then reset the green lamp. After this, the green lamp timer turns off and the cycle repeats.

We set the bit first, because if we reset first, then the timer too will turn off and the next bit will not set due to PLC scan time. So, in any logic, if we want to continue something, then first start the next one and then stop the preceding one.

As per the last condition of the question, by pressing the stop button, everything should reset. So, on this input, we have reset all the bits used in logic, to enable it to restart once again.

In this way, we have seen the traffic light logic using a functional block diagram.

Read Next:

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address

1 thought on “Functional Block Diagram PLC Example for Traffic Light System”

Leave a Comment

Share via
Follow us and never miss an update!