guys. I thought for first step. Is it correct whren i push start button after 20 sec lamp it opened but i didn't continue second step.
Excellent! Well done: the light [O:0/0] turns on 20s after the input [I:0/0] becomes 1. This is a classic TON (Timer-driver ON-delay) circuit.
Also, the [OTL O:0/0] latches the light ON (assigns 1 to O:0/0), so when the timer is reset and [T4:0/DN] become 0, the light will stay on. That can be good too*, but at some point we will want the light to turn off as well, even though T4:0/DN may be 1. Also, if the input switch is turned off ([I:0/0] becomes 0) after 20s, then the timer will reset and [T4:0/DN] will become 0, but the light will say latched on. So there
may be some more logic (instructions) added to Rung 0001 later to disable the latch [OTL] on every scan, and there will need to be a way for the light to turn off that looks at the input switch, but this is good for now.
The next step is to reset the timer 20s after it starts timing, so it can start the next 20s cycle.
- What is the trigger to do that reset?
- Hints: what bit becomes 1 at 20s after the timer starts? You did something similar on Rung 0004 of Post #7
* The light could also be turned on, and kept on, with an [OTE O:0/0] fed by rungs that contain additional logic, instead of the OTL triggered by [T4:0/DN]. Sometimes an OTL is not preferred: for example if the PLC lost power, then the light would be on ([O:0/0] would be 1) when the power came back, and that might not be what was desired. But leave it as a latch for now.