If the 2s spec is fuzzy enough that 2s +/- 41% (sqrt(2)-1) is acceptable, you could pick a bit in the free running clock that will toggle with a full cycle period somewhere between 2.8s and 5.6s, and tie your lamp to that.
It's one line of code.
For MicroLogix, the low bit (S:4/0) increments at 100us intervals, so 10,000 increments per second, so bit S:4/14 is 16384, and tying the lamp to it would have it toggle at 1.6s intervals.
If your PLC has Hour, Minutes and Seconds in a Real-Time Clock (RTC), you might be able to tie the lamp to the 1 bit of the Seconds register, which will toggle at around 2s intervals.
I am no ST expert and I am not sure how you address the RTC bits, but the implementation would be something like this:
Code:
Lamp_Output := RTC:0.SEC/1;
I just implemented that in ladder on a MicroLogix 1100 and timed the result with an Android stopwatch app: 20.3s for 10 toggles; the 0.3s is probably more my finger than the RTC.
It's all a matter of what accuracy is acceptable.