2-137
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Counter Instructions
2
CTD_**
After the value of CV reaches 0 or less, CV does not change even if CD changes to TRUE.
CD is ignored while Load is TRUE. CV is not decremented.
The following figure shows a CTD_LINT programming example and timing chart for a PV of LINT#5.
• Use the CTU instruction (page 2-138) to create a counter that increments the counter value each
time the counter input signal is received.
• Use the CTUD instruction (page 2-142) to create a counter that is both incremented and decre-
mented.
• Change Load to TRUE and then back to FALSE to restart a counter that has completed counting
down.
• Use the same data type for PV and CV.
• Even when PV is set to a negative value, CV is set to the value of PV when the value of Load
changes to TRUE. The value of CV will be 0 or less, so the value of Q changes to TRUE immediately.
After that, the value of CV is not decremented even if the value of CD changes.
• If the value of CD is FALSE and the power supply is interrupted or the operating mode is changed to
PROGRAM mode, the value of CV is decremented once if the value of CD is TRUE when instruction
execution is restarted.
• If this instruction is used in a ladder diagram, the value of Q changes to FALSE if an error occurs in
the previous instruction on the rung.
Additional Information
Precautions for Correct Use
CTD_LINT_instance(A, abc, LINT#5, def, ghi);
LD ST
A
def
ghi
LINT#5
abc
CTD_LINT
CD Q
Load CV
PV
CTD_LINT_instance
When CV reaches 0, Q
changes to TRUE.
CV is decremented as soon as
Load changes to FALSE.
When Load changes to TRUE,
CV is set to the value of PV and
Q changes to TRUE.
CD=A
Load=abc
TRUE
FALSE
TRUE
FALSE
CV=ghi
PV=LINT#5
Q=def
TRUE
FALSE
0