Design a PLC program for an alternate output circuit with a latched function and explain the ladder logic with a…