摘要 |
<p>PURPOSE:To perform correct update of the present timer value despite the jump of a subroutine by obtaining the elapsed time from the difference of contents between a time base register and a preceding value table and adding said elapsed time to a present value table. CONSTITUTION:The difference is obtained between a time base register 1 and a time base register preceding value table 2 and added to a timer present value table 3 to be transferred to the register 1 and the table 2. Then the contents are compared with each other between the table 3 and a timer set value table 4 for time-up check. The time elapsed between a time point when the preceding timer instruction is carried out and the present time points is obtained from the difference of contents between the register 1 and the table 2. Then the new timer present value is obtained with addition of said elapsed time to the table 3. At the same time, the content of the register 1 are transferred to the table 2 and the value of the register 1 is held until the next timer instruction is carried out. A time-up state can be decided based on the result of comparison between the contents of both tables 3 and 4. In such a way, the present value of timer is correctly updated.</p> |