Mitsubishi Electronics QnUCPU Home Theater Server User Manual


 
CHAPTER9 DEVICES
9
2
3
4
5
6
7
8
9.2 Internal User Device
9.2.11 Counter (C)
9 - 29
1) Precautions for resetting the counter
Execution of the RST C instruction also turns off the coil of C .
If the execution condition for the OUT C instruction is still ON after execution of the RST C
instruction, turn on the coil of C at execution of the OUT C instruction and update the current
value (count value + 1).
In the above ladder 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 C0
instruction clears the current 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 C0 instruction. (The current value is changed to 1.)
To prevent the above, it is recommended to add a normally closed contact of the OUT C0
instruction execution to the condition for the RST C0 instruction execution so that the coil of C0
does not turn off while the execution condition (M0) of the OUT C0 instruction is on.
Figure 9.33 Counter resetting ladder example
Figure 9.34 Current value update timing
Figure 9.35 Counter resetting ladder example (recommended)
C0
RST C0
M0
C0
K10
[Ladder example]
M0 OFF
OFF
ON
RST C0
OUT C0
END
RST C0
OFF
RST C0
OUT C0
ENDEND
ON
Sequence
program
Coil of C0
Current value
update, turning on
the contact
Turning off the
coil of C0
Current value is
updated since the coil
of C0 turns on from off.
Count value cleared, the contact turned off
C0
RST C0
M0
C0
K10
M0
[Modified ladder example]