This program uses a CTU counter block named CONTADOR1 to count up from 10 when CU1 is true and reset when R1 is true. The output of the counter is assigned to QU1 and the current value is assigned to CV1.
1 of 1
Download to read offline
More Related Content
Ctu
1. VAR
CONTADOR1:CTU;
CU1 AT %IX0.0:BOOL;
CD1 AT %IX0.1:BOOL;
R1 AT %IX0.2:BOOL;
LD1 AT %IX0.3:BOOL;
PV1:INT:=10;
QU1 AT %QX2.0:BOOL;
QD1 AT %QX2.1:BOOL;
CV1:INT;
END_VAR
CONTADOR1(CU := CU1, R := R1, PV := PV1);
QU1:= CONTADOR1.Q;
CV1:= CONTADOR1.CV;