CTD / CTDr

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Down counter.

Inputs

Input

Data Type

Range

Unit

Default

Description

CD

BOOL

 

 

 

Enable counting.

Counter is decreased on each call when CD is TRUE.

LOAD

BOOL

 

 

 

Re-load command.

Counter is set to PV when called with LOAD to TRUE.

PV

DINT

 

 

 

Programmed maximum value.

Outputs

Output

Data Type

Range

Unit

Description

CV

DINT

 

 

Current value of the counter.

Q

BOOL

 

 

TRUE when counter is empty (i.e., when CV = 0).

Remarks

FBD Language Example

CtdFbd.gif (1361 octets)

FFLD Language Example

  • The CD is the input rung.
    • The output rung is the Q output.

CtdLd.gif (1478 octets)

IL Language Example

(* MyCounter is a declared instance of CTD function block. *)
Op1: CAL    MyCounter (CD, LOAD, PV)
FFLDClosed "Free Form Ladder Diagram"     MyCounter.Q
ST     Q
FFLD     MyCounter.CV
ST     CV

ST Language Example

(* MyCounter is a declared instance of CTD function block. *)
MyCounter (CD, LOAD, PV);
Q := MyCounter.Q;
CV := MyCounter.CV;

See Also