A method to detect a fault in a CPU of an industrial controller during
on-line safety control of real world objects. An application program is
complied into assembler instructions. A test application is complied into
assembler instructions where the assembler instructions is a subset of
the total number of assembler instructions available for the CPU. The
application program is downloaded and the test application to a central
unit of an industrial controller. The test application is repeatedly
executed in the industrial controller. A result from the test application
is repeatedly compared with the pre-defined result in the test module. A
fault detected in the CPU as the result from the test application does
not equal the pre-defined result stored in the test module and the
unexpected result of the test application is due to the execution of an
assembler instruction of the test application. The execution of the
application program is aborted wherein the application program is
prohibited from executing the assembler instruction which otherwise would
cause the application program to fail.