This ladder logic program could be used to drive a strip of ten lights placed along a stair. Controlled by photocells at the ends of the stair, the lights turn on and off progressively with a sequence related to your walking direction.
At each end of the stair there are two photocells, in order to generate a count signal and prevent the lights from getting dark when someone is still walking on the stair.
The relays from 1 to 5 is supposed to perform the count.
Timers from T1 to T10 drive the lights from L1 to L10; timers from T1A to T10A drive the lights from L10 to L1.
The program has been simulated with the educational version of TRiLOGI software, without using the PLC.
Basic ladder logic