Here is PLC program to Simply Latch and Unlatch an Output, along with program explanation and run time test cases.
List of Inputs & Outputs
SW1 = Switch1 I:1/0 & 0.00 (Input to Latch)
SW2 = Switch2 I:1/1 & 0.01 (Input to Unlatch)
Bit stored to latch 100.00 (Stored Bit Address)
Output O:2/0 & 200.00 (Output Light)