摘要 |
PURPOSE: To provide the programmable controller which correctly stores data in a nonvolatile storage means whenever a power failure occurs during the execution of an instruction. CONSTITUTION: The programmable controller 101 is equipped with a program 314 for power-failure time processing which completes execution if there is an instruction being executed in a process F1 once detecting a power failure detection signal ESG reaching a value indicating a power failure, reads an instruction to be read out next in a following process F2, decides whether or not the read instruction is in the same instruction group as the sequence control instruction group that an instruction that is already executed belongs to in a process F3, and makes a return to the process F2 after the read instruction is executed when the instruction belongs to the same instruction group, but stores the address of the storage means where the read instruction is stored in an area of a nonvolatile storage means in a process when no instruction is in the same instruction group. |