Patent ID: 8756606

Claim:
A safety controller comprising: a hardware resource including at least one processor; and a system program for controlling allocation of an execution time of the processor to a plurality of programs including (a) a safety monitoring program for monitoring occurrence of an abnormality related to a control target, (b) a normal control program related to control of the control target during normal time, and (c) a safety control program related to control of the control target upon occurrence of the abnormality, the execution time being a single execution time for execution of all the plurality of programs, wherein the system program includes a partition scheduler that schedules according to a scheduling pattern of a plurality of partitions including (d) a first time partition in which the execution time is exclusively allocated to the safety monitoring program, (e) a second time partition in which the execution time is exclusively allocated to the normal control program, and (f) a third time partition in which the execution time is exclusively allocated to the safety control program, the processor executes the system program to cause the partition scheduler to schedule periodically according to the scheduling pattern, and the partition scheduler is activated upon detection of the abnormality by the safety monitoring program executed in the first time partition and the normal control program executed in the second time partition, and performs switching from one of the first time partition and the second time partition to the third time partition, even when a time resource is left in one of the first time partition and the second time partition, wherein the plurality of programs have respective priorities assigned thereto, and the partition scheduler decides a program of the plurality of programs to be subsequently executed according to the priorities of the plurality of programs and an amount of execution time remaining in the plurality of time partitions in which the programs are executed, and performs switching to a time partition of the plurality of time partitions in which the decided program executes.