Ladder Diagram automatic door

Before we make the ladder diagram for automatic door first we make the lay out and sensors for the automatic door, please see picture below:

I/O table for automatic door used PLC siemens S7-200 cpu 224:

Input device :
1. Motion sensor Inside address I0.0
2.Motion sensor outside address I0.1
3.Limit switch open address I0.2
4.Limit switch closed address I0.3
5.selector switch automatic mode address I0.4

6.selecor switch manual mode address I0.5
7.push button open manual I0.6
8.push button closed manual I0.7
9.Emergency stop I1.0

Output device:

1.Kontaktor motor closed Q0.0
2.kontaktor motor open Q0.1
2.pilot Lamp emergency Q0.2
3.piloy lamp manual mode Q0.3
4.pilot lamp automatic mode Q0.4

Ladder diagram