Elements that keep their state: Elements driven by an accumulative timer, counter, or SET and RST instructions.
Elements that turn OFF: Elements driven by a timer and an OUT instruction.
Program example (with nesting, 3 levels)