241
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Timer and Counter Instructions
3
MTIM/MTIMX
Flags
Function
• The following table shows the operation of MTIM(543)/MTIMX(554) for the four possible
combinations of the reset and pause bits
• The reset and pause bits are effective only when the execution condition for MTIM(543)/MTIMX(554)
is ON
Hint
• If a word in the CIO area is specified for D1, the SET and RSET instructions can be used to control
the pause and reset bits.
Precautions
• Unlike most timers, MTIM(543)/MTIMX(554) does not use a timer number. (Timer area PV refreshing
is not performed for MTIM(543)/MTIMX(554).)
• When the PV reaches 9999, the PV will be reset to 0 and all of the Completion Flags will be turned
OFF.
• If in BCD mode and an SV in S through S+7 does not contain BCD data, that SV will be ignored. An
error will not occur and the Error Flag will not be turned ON.
Name Label Operation
Error Flag P_ER • ON if the PV contained in D2 is not BCD, when MTIM(543) is used.
• OFF in all other cases.
• When the execution condition for
MTIM(543)/MTIMX(554) is ON and the reset and
timer bits are both OFF, MTIM(543)/MTIMX(554)
increments the PV in D2. If the pause bit is turned
ON, the timer will stop incrementing the PV, but
the PV will retain its value.
MTIM(543)/MTIMX(554) will resume timing when
the pause bit goes OFF again.
• The PV (content of D2) is compared to the eight
SVs in S through S+7 each time that
MTIM(543)/MTIMX(554) is executed, and if any of
the SVs is less than or equal to the PV, the
corresponding Completion Flag (D1 bits 00
through 07) is turned ON.
• When the PV reaches 9999, the PV will be reset
to 0 and all of the Completion Flags will be turned
OFF. If the reset bit is turned ON while the timer is
operating or paused, the PV will be reset to 0 and
all of the Completion Flags will be turned OFF.
• The set value is 0 to 999.9 s for MTIM(543) and 0
to 6,553.5 s for MTIMX(554), and the timer
accuracy is 0 to 0.01 s.
Note The timer accuracy for CS1D CPU Units is 10 ms +
the cycle time
Reset bit
(Bit 08)
Pause bit
(Bit 09)
Operation
OFF OFF The PV will be updated and the corresponding Completion Flag will be turned ON
when SV ≤ PV.
ON The PV will not be updated and MTIM(543)/MTIMX(554) will be treated as NOP(000).
ON OFF The PV will be reset to 0 and the Completion Flags will be turned OFF. The PV will not
be updated.
ON
SV 7
SV 2
SV 1
SV 0
0
0
to
to
to
Timer input
Timer PV (D2)
Bit 7
Timer PV
Timer SVs
Bit 2
Bit 1
Bit 0
Completion
flags (D1)
to
to