346
21 DEVICES
21.3 User Device
■
Precautions about counter reset
When executing the RST C
instruction, the coil for C
is also turned off. If the execution condition for the OUT C
instruction is turned on after the RST C
instruction is executed, the coil of C
is turned on and the current value is updated
(count value +1) when the OUT C
instruction is executed.
In the above ladder example, the coil of C0 is turned on by turning off and on M0 and as a result the current value is updated.
When C0 count reaches its upper limit, C0 contact is turned on and C0 current value is cleared by execution of the RST C0
instruction. At this time C0 coil is also turned off. When M0 is turned on at the next scanning, the current value is updated
because C0 coil is turned off and on during the OUT C0 instruction execution (the current value is changed to 1).
To address the above problem, insert a normally closed contact of the execution condition for the OUT C0 instruction into the
execution condition for the RST C0 instruction to prevent C0 coil from being turned off while the execution condition (M0) of
the OUT C0 instruction is turned on as shown in the following ladder example.
Maximum counting speed for counters
Counting is possible only when on/off time of the input condition is longer than the execution interval of the same OUT C
instruction. Maximum counting speed for counters can be obtained by the following equation:
*1 Duty (n) is a value which expresses the ratio of on/off time of the count input signal as a percent (%) value.
(1) The current value update contact turns on.
(2) The current value is updated because the coil of C0 turns on.
(3) The count value is cleared, and the contact turns off.
C0
M0
K10
C0
RST
C0
M0
OFF
OFF
ON
RST C0
OUT C0
END
RST C0
OFF
(3)
(1)
(2)
RST C0
OUT C0
END
END
ON
Program
Coil of C0
The coil of C0 turns off.
C0
RST
C0
M0
C0
K10
M0
100
T
1
n
×
Maximum counting
speed Cmax
[times/s]
=
OFF
ON
T1
T2
T2
T1
×
100%
×
100%
T1+T2
T1+T2
• When T1
≥
T2, n =
• When T1<T2, n =
Count input signal
Summary of Contents for MELSEC iQ-R-R00CPU
Page 2: ......
Page 151: ...9 MONITOR FUNCTION 9 1 Real Time Monitor Function 149 9 MEMO ...
Page 323: ...18 SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION 321 18 MEMO ...
Page 330: ...328 20 ROUTING SETTING 20 3 Precautions MEMO ...
Page 423: ...26 BASIC CONCEPT 26 8 State Transition of the Redundant System 421 26 MEMO ...
Page 1014: ...1012 APPX Appendix 15 Added and Enhanced Functions MEMO ...
Page 1027: ......