摘要 |
PURPOSE: A method for controlling a task of a PLC is provided to perform a task priority process as well as a real-time task process by generating a task interrupt according to the priority. CONSTITUTION: An operation for processing a task is decided at the present point when a task event is generated(ST21,ST22). A task interrupt is generated after performing the present interrupt and all pending interrupts if the task is processed(ST23). The unused task interrupt is generates if the performing and the pending interrupts are finished(ST24,ST25). A stack is operated(ST26). The predetermined task processing routine is jumped to a task program corresponding to a requested tack number after the predetermined task processing routine is performed according to the operated stack if the task interrupt is finished(ST27,ST28). The task program is performed(ST29). The process is finished if there is no the requested task after a task program end command is performed(ST30-ST32).
|