PURPOSE: To make sure loop detection possible, by setting the most suitable loop detecting level of each program level by means of the number of instruction executing steps.
CONSTITUTION: In a control memory 11 programs of each level Li of a line control program NCP are stored. An executing program is selected by a control section 16 and instructions are successively fetched by a register 13 and executed in accordance with a value set in an address register 12. An instruction running number counter 14 counts whenever an instruction is fetched at each level Li and displays the total step number R of executed instructions. In an instruction running number upper limit value table 18, the upper limit value Mi of allowable total instruction step numbers are previously registered at every level Li. A comparing section 19 reads out the upper limit value Mi in accordance with the level Li and compares the read out Mi with a total step number R and, when the R becomes R≥Mi, generates interruption and informs of the incidence of a fault by judging that a loop condition occurs.