Mitsubishi L02CPU User Manual page 247

Melsec-l series
Hide thumbs Also See for L02CPU:
Table of Contents

Advertisement

(3) Resetting the counter
To clear the current value and to turn off the contact of the counter, use the RST instruction. At the time of
execution of the RST instruction, the counter value is cleared, and the contact is also turned off.
(a) Precautions for resetting the counter
Execution of the RST instruction also turns off the coil of counter. If the execution condition for the OUT
instruction is still on after execution of the RST instruction, turn on the coil of counter at execution of the OUT
instruction and update the current value (count value + 1).
In the above program example, when M0 turns on from off, the coil of C0 turns on, updating the current value.
When C0 reaches the preset value finally, the contact of C0 turns on, and execution of the RST instruction clears
the execution value of C0. At this time, the coil of C0 also turns off. If M0 is still on in the next scan, the current
value is updated since the coil of C0 turns on from off at execution of the OUT instruction. (The current value is
changed to 1.)
Program
M0
OFF
Coil of C0
OFF
OFF
RST C0
To prevent the above, it is recommended to add a normally closed contact of the OUT instruction execution to the
condition for the RST instruction execution so that the coil of C0 does not turn off while the execution condition
(M0) of the OUT instruction is on.
[Program example]
END
OUT C0
RST C0
ON
ON
Current value
update, turning
Turning off the
on the contact
coil of C0
Count value cleared, the contact turned off
[Modified ladder program]
END
OUT C0
RST C0
Current value is updated
since the coil of C0 turns
on from off.
CHAPTER 5 DEVICES
END
245
5

Advertisement

Table of Contents
loading

This manual is also suitable for:

L26cpu-bt

Table of Contents