
245
CHAPTER 5 DEVICES
5
5.
2
I
n
te
rnal Us
er Dev
ices
5.
2.
11
Count
er (C)
(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.)
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]
M0
OFF
OFF
ON
RST C0
OUT C0
END
OFF
RST C0
OUT C0
END
END
ON
Current value
update, turning
on the contact
Program
Coil of C0
RST C0
Count value cleared, the contact turned off
Turning off the
coil of C0
Current value is updated
since the coil of C0 turns
on from off.
[Modified ladder program]
Содержание L02CPU
Страница 1: ......
Страница 2: ......
Страница 13: ...11 Memo ...
Страница 78: ...76 Memo ...
Страница 226: ...224 Memo ...
Страница 317: ...315 APPENDICES APPEN DIX Appendix 4 Character Codes Available in the Display Unit To the next page ...
Страница 318: ...316 To the next page ...
Страница 319: ...317 APPENDICES APPEN DIX Appendix 4 Character Codes Available in the Display Unit To the next page ...
Страница 320: ...318 To the next page ...
Страница 321: ...319 APPENDICES APPEN DIX Appendix 4 Character Codes Available in the Display Unit To the next page ...
Страница 322: ...320 To the next page ...
Страница 323: ...321 APPENDICES APPEN DIX Appendix 4 Character Codes Available in the Display Unit To the next page ...
Страница 324: ...322 To the next page ...
Страница 325: ...323 APPENDICES APPEN DIX Appendix 4 Character Codes Available in the Display Unit To the next page ...
Страница 326: ...324 To the next page ...
Страница 335: ...333 Memo ...
Страница 339: ......