Traffic light on PLC - all languages IEC 61131-3
The new program uses all 5 languages of the IEC 61131-3 standard.
The first section is on IL .
It is an assembly language.
There are only 2 lines in the section:
LD - loading the value into the accumulator
S - setting the variable to true if the accumulator is true, otherwise the variable does not change.

A 0.5-second pulse generator is written in FBD , as in the previous version.

The main section is written in SFC . It seems to me that this is the most difficult language to use in the IEC 61131-3 standard.
The program consists of steps and transitions.
When the program starts, the Init step is performed.
The next step is performed if the transition condition after it is true. The step may be delayed, the step time may be limited.
In the figure below, only one transition contains a condition. Other transitions are always performed.
At the end of the chain, an unconditional jump to the WaitPeople label is performed.

Each step is performed with a delay corresponding to the required time the traffic light is in a given state.

At each step, a specific action is performed. My program is set to execute a section in ST.

The uState variable is added to the project, corresponding to the state of the traffic light.
Here is the contents of all the sections performed in steps:

Section on STdepending on the state, uState writes the value to Boolean variables, which will then be rewritten to the outputs. This could be done in the stStep_1..stStep_8 sections, but then you would not have seen the CASE statement and understood that ST is the closest language for the programmer from the IEC 61131-3 standard. Also in this section, protection against program errors is introduced in the form of flashing yellow in an undefined state.

Language LD close to the ladder logic diagrams. The basis of LD is contacts and coils. The diagram shows that on the left is a conductor from which the “voltage” (true) extends to the right along the branches.
A normally open contact (similar to a capacitor) closes if the variable bound to it is true.
A normally closed contact (similar to a capacitor with a slash inside) closes if the variable attached to it is false.
A coil (2 brackets) passes the “voltage” through itself and rewrites its value (false or true) into a variable bound to it.
In the program, this section is used to rewrite intermediate variables into output-bound variables with protection from software error. The green light lights up only if there is no red at this traffic light and green at another traffic light.

The result of the program:
The use of all 5 languages in one program is not justified. But in real projects sometimes it is necessary to apply simultaneously 2..3 languages. Most often I use ST, less often FBD, even less often IL. SFC and LD in real projects I did not have to apply.
UPD Made a correction - removed an extra zero from the name of the standard according to RouR
UPD2. A slight change in the description of LD.