**PLC Type Simatic S7-200 Siemens, Name Input / Output PLC :**

**INPUT PLC :**

I0.0 ; Numeric 0 from KeyPad

I0.1 ; Numeric 1 from KeyPad

I0.2 ; Numeric 2 from KeyPad

I0.3 ; Numeric 3 from KeyPad

I0.4 ; Numeric 4 from KeyPad

I0.5 ; Numeric 5 from KeyPad

I0.6 ; Numeric 6 from KeyPad

I0.7 ; Numeric 7 from KeyPad

I1.0 ; Numeric 8 from KeyPad

I1.1 ; Numeric 9 from KeyPad

I1.2 ; ENTER Key from KeyPad

I1.3 ; Door closure Sensor

I1.4 ; Door Exit Button

**OUTPUT PLC :**

Q0.0 ; Output to Relay Coil (Used for Electromagetic Lock and Green LED)

Download PDF File:

Lock Unlock Door Using Siemens PLC(.pdf)

Reading Ladder

**PLC Programming**for

**Lock Unlock Door**using Siemens PLC :

**Step 1 :**

Password Data using VW20

Password Data using VW20

**a.**VW20 = 5214 (can be modified and 4 Digits Decimal)

**Step 2 :**

Numeric 0 to 9 is pressed

Using VW0 for temporary data storage

Numeric 0 to 9 is pressed

Using VW0 for temporary data storage

**a.**If I0.0 = ON (Numeric 0) Then |P| M0.0 = ON AND VW0 = 0

**b.**If I0.1 = ON (Numeric 1) Then |P| M0.0 = ON AND VW0 = 1

**c.**If I0.2 = ON (Numeric 2) Then |P| M0.0 = ON AND VW0 = 2

**d.**If I0.3 = ON (Numeric 3) Then |P| M0.0 = ON AND VW0 = 3

**e.**If I0.4 = ON (Numeric 4) Then |P| M0.0 = ON AND VW0 = 4

**f.**If I0.5 = ON (Numeric 5) Then |P| M0.0 = ON AND VW0 = 5

**g.**If I0.6 = ON (Numeric 6) Then |P| M0.0 = ON AND VW0 = 6

**h.**If I0.7 = ON (Numeric 7) Then |P| M0.0 = ON AND VW0 = 7

**i.**If I1.0 = ON (Numeric 8) Then |P| M0.0 = ON AND VW0 = 8

**j.**If I1.1 = ON (Numeric 9) Then |P| M0.0 = ON AND VW0 = 9

Note : |P| = Positive Transition

**Step 3 :**

Count the number keypad is pressed

Using Counter C0 for Count data

Count the number keypad is pressed

Using Counter C0 for Count data

**a.**If M0.0 = ON Then CU C0 = ON (Count UP Counter0 = ON)

**Step 4 :**

Enter Released for Reset Counter C0 (Count data RESET)

Enter Released for Reset Counter C0 (Count data RESET)

**a.**If I1.2 = OFF (ENTER key is Released) Then |N| R C0 = ON (Reset Counter0 = ON with Positive Transition)

**Step 5 :**

Password from the KeyPad

Using VW14 for Password from the KeyPad

Password from the KeyPad

Using VW14 for Password from the KeyPad

**a.Keypad is pressed first, multiplied by 1000**

If M0.0 = ON AND C0 = 1 then VW0 MUL_I 1000 = VW2

**b.Keypad is pressed second, multiplied by 100**

If M0.0 = ON AND C0 = 2 then VW0 MUL_I 100 = VW4

**c.Keypad is pressed three, multiplied by 10**

If M0.0 = ON AND C0 = 3 then VW0 MUL_I 10 = VW6

**d.Keypad is pressed four, multiplied by 1**

If M0.0 = ON AND C0 = 4 then VW0 MUL_I 1 = VW8

**e.Sum all the data**

VW2 ADD_I VW4 = VW10

VW6 ADD_I VW10 = VW12

VW8 ADD_I VW12 =

**VW14**

**Example :**

Keypad is pressed :

first : Numeric 5 => 5 multiplied by 1000 = 5000

second : Numeric 2 => 2 multiplied by 100 = 200

three : Numeric 1 => 1 multiplied by 10 = 10

four : Numeric 4 => 4 multiplied by 1 = 4

Sum all the data = 5000 + 200 + 10 + 4 = 5214

**So,Password from the keypad is 5214**

**Step 6 :**

Check the number of digits

Check the number of digits

**a.**If C0 = 4 (4 times the keypad is pressed) Then M0.2 = ON

**Step 7 :**

Correct Password And UnLock Door

7.1. Correct Password

Correct Password And UnLock Door

7.1. Correct Password

**a.**If I1.2 = ON (ENTER key is pressed) Then |P| M0.4 = ON (ENTER Down with Positive Transition)

**b.**If M0.4 = ON AND M0.2 = ON AND Value(VW20 = VW14) Then S M0.3 (correct password)

**7.2. UnLock Door by Correct Password**

**c.**If M0.3 = ON AND M0.7 = OFF AND T37 = OFF Then M0.6 = ON (Hold UnLock)

**7.3. UnLock Door by Door Exit Button**

**d.**If I1.4 = ON (Door Exit Button) AND M0.7 = OFF AND T37 = OFF Then M0.6 = ON (Hold UnLock)

**7.3. UnLock Door**

**e.**If M0.6 = ON (Unlock) Then Q0.0 = ON (Relay for Lock)

**Step 8 :**

Lock Door by Door position

Lock Door by Door position

**a.**If I1.3 = ON (Door Closure Sensor) Then |P| M0.7 = ON

**b.**If M0.7 = ON Then M0.6 = OFF (Unlock)

**c.**If M0.6 = OFF (Unlock) Then Q0.0 = OFF (Relay for Lock)

**Step 9 :**

Lock Door by Timer

Lock Door by Timer

**a.**If Q0.0 = ON AND I1.3 = ON (Door Closure Sensor) Then Activate the Timer T37

**b.**If T37 = ON Then M0.6 = OFF (Unlock)

**c.**If M0.6 = OFF (Unlock) Then Q0.0 = OFF (Lock Door)

**Step 10 :**

Password Reset

Password Reset

**a.**If M0.0 = ON AND M0.3 = ON (Correct Password) Then R M0.3 (M0.3 = OFF)

**b.**If M0.7 = ON AND M0.3 = ON (Correct Password) Then R M0.3 (M0.3 = OFF)

**c.**If T37 = ON AND M0.3 = ON (Correct Password) Then R M0.3 (M0.3 = OFF)

Please Download Programming for STEP 7 MicroWIN :

**Lock Unlock Door Using Siemens PLC**

See :

**Lock Unlock Door**