This program simulates the operation of a strip of interactive lights placed along a stair.
The lights are controlled by two pairs of photocells at the ends of the stair. The lights turn on and off with a sequence depending on the direction you walk. A count instruction prevents the lights from turning off when the stair is occupied.
A PLC is a bit expensive for a project like this. However there is an application which converts ladder logic into microcontrollers code.