5-202
5.11 Standard Counter Function Blocks
5.11.3 Up/Down counter
CTUD(_E)
Operation Error
No operation error occurs in the execution of the CTUD (_E) function.
Program Example
The program which counts the number of times that bit type data input to is turned from OFF
to ON, and turns ON when the value of reaches the value set at . Simultaneously, it
counts the number of times that bit type data input to is turned from OFF to ON, and turns ON
when the value of reaches 0.
(a) Function without EN/ENO (CTD)
[Structured ladder]
[ST]
CTUD_Inst (g_bool1, g_bool2, g_bool3, g_bool4, g_int1, g_bool5, g_bool6, g_int2);
(b) Function with EN/ENO (CTD_E)
[Structured ladder]
[ST]
CTUD_E_Inst ( g_bool1, g_bool2, g_bool3, g_bool4, g_int1, g_bool5, g_bool6, g_int2);
s1
d1
d3
n
d2
d2
d3