6 Standard Function Blocks
6.4 CTD(_E)
212
FXCPU Structured Programming Manual
(Application Functions)
6.4
CTD(_E)
Outline
This function block counts down the number of times of rising of a signal.
1. Format
*1.
Refer to caution points.
2. Set data
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
This function block counts down (subtracts "1" from) the value stored in a device specified in
when a
device specified in
turns ON.
The value
specifies the initial value for subtraction.
This function block turns ON a device specified in
when the count value becomes "0".
When a device specified in
turns ON, this function block turns OFF a device specified in
, and sets
the initial value for subtraction specified in
to the count value of a device specified in
.
Cautions
1) Use the function having "_E" in its name to connect a bus.
2) Expression of function blocks in each language
*1.
Set the instance when using a function block.
Describe the instance name when programming a function block.
FX
3U(C)
FX
3G
FX
2N(C)
FX
1N(C)
FX
1S
FX
U
/FX
2C
FX
0N
FX
0(S)
Function name
Expression in each language
Structured ladder
ST
CTD
CTD(CD,LOAD,PV); *1
Example:
Instance name(CD:=M0,
LOAD=M10, PV=D0);
M20:=Instance name.Q;
D10:=Instance name.CV;
CTD_E
CTD_E(EN,CD,LOAD,PV); *1
Example:
Instance name(EN=X000,
CD:=M0, LOAD=M10, PV=D0);
M20:=Instance name.Q;
D10:=Instance name.CV;
Variable
Description
Data type
Input
variable
EN
Execution condition
Bit
CD
(
)
Count source signal
Bit
LOAD (
)
Reset input signal
Bit
PV
(
)
Counter set value
Word [signed]
Output
variable
ENO
Execution status
Bit
Q
(
)
Output signal (which turns ON when the current counter value
becomes "0" or less)
Bit
CV
(
)
Number of times of rising
Word [signed]
CTD
Q
M20
CD
M0
CV
D10
LOAD
M10
PV
D0
Instance name
CTD_E
EN
ENO
Q
M20
X000
CD
M0
CV
D10
LOAD
M10
PV
D0
Instance name
s1
s2
n
d1
d2
d2
s1
n
d1
s2
d1
n
d2