How to make Latching Program in a PLC

How to make  Latching Program in PLC, We teach with 2 methods.
1. Using internal relay
2. Using special relays (SET and RST)


Equipment needed:


- 1 PLC
- 1 Push Button NO
- 1 Push Button NO
- 1 Lamp  


How do PLC programming work?


Step 1
If X0 is pressed (ON) then the current will pass through X1 (NC) so that Y0 will be ON.
then if X0 is released, Y0 will remain ON. Because the current flowing to the contact has Y0


Step 2
If X1 is ON then Y0 (lamp) will OFF, because the current passing through contact X1 is lost