Материал: m912201e

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

Standard Library Elements

329

Counter

 

 

 

13.4.2CTD

Function Block Decrementer:

The input variables CD and LOAD as well as the output variable Q are type BOOL, the input variable PV and the output variable CV are type INT.

When LOAD_ is TRUE, the counter variable CV will be initialized with the upper limit PV. If CD has a rising edge from FALSE to TRUE, CV will be lowered by 1 provided CV is greater than 0 (i.e., it doesn't cause the value to fall below 0).

Q returns TRUE when CVis equal 0.

Declaration example:

CTDInst : CTD ;

Example in IL:

CAL

CTDInst(CD := VarBOOL1, LOAD := VarBOOL2, PV :=

 

VarINT1)

LD

CTDInst.Q

ST

VarBOOL3

LD

CTDInst.CV

ST

VarINT2

Example in FBD:

Example in ST:

CTDInst(CD:= VarBOOL1, LOAD:=VarBOOL2 , PV:= VarINT1);

VarBOOL3 := CTDInst.Q ;

VarINT2 := CTDInst.CV;

13.4.3CTUD

Function Block Incrementer/Decrementer:

The input variables CU, CD, RESET, LOAD as well as the output variables QU and QD are type BOOL, PV and CV are type INT.

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

330 Standard Library Elements

Counter

If RESET is valid, the counter variable CV will be initialized with 0. If LOAD is valid, CV will be initialized with PV.

If CU has a rising edge from FALSE to TRUE, CV will be raised by 1. If CD has a rising edge from FALSE to TRUE, CV will be lowered by 1 provided this does not cause the value to fall below 0.

QU returns TRUE when CV has become greater than or equal to PV.

QD returns TRUE when CV has become equal to 0.

Declaration example:

CTUDInst : CUTD ;

Example in IL:

CAL CTUDInst(CU := VarBOOL2, RESET := VarBOOL3, LOAD := VarBOOL4, PV := VarINT1)

LD CTUDInst.QU

ST VarBOOL5

LD CTUDInst.QD

ST VarBOOL6

LD CTUDInst.CV

ST VarINT2

Example in FBD:

Example in ST:

CTUDInst(CU := VarBOOL1, CU:= VarBOOL2, RESET :=

VarBOOL3, LOAD:=VarBOOL4 , PV:= VarINT1);

VarBOOL5 := CTUDInst.QU ;

VarBOOL6 := CTUDInst.QD ;

VarINT2 := CTUDInst.CV;

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

Standard Library Elements

331

Timer

 

 

 

13.5 Timer

13.5.1TP

The function block TP is a trigger. TP(IN, PT, Q, ET) means:

IN and PT are input variables of the BOOL and TIME types respectively. Q and ET are output variables of the BOOL and TIME types respectively. If IN is FALSE, Q is FALSE and ET is 0.

As soon as IN becomes TRUE, the time will begin to be counted in milliseconds in ET until its value is equal to PT. It will then remain constant.

Q is TRUE if IN is TRUE and ET is less than or equal to PT. Otherwise it is FALSE.

Q returns a signal for the time period given in PT.

Graphic Display of the TP Time Sequence

Declaration example:

TPInst : TP ;

Example in IL:

CAL TPInst(IN := VarBOOL1, PT := T#5s)

LD TPInst.Q

ST VarBOOL2

Example in FBD:

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

332 Standard Library Elements

Timer

Example in ST:

TPInst(IN := VarBOOL1, PT:= T#5s);

VarBOOL2 :=TPInst.Q;

13.5.2TON

The function block TOD implements a turn-on delay..

TON(IN, PT, Q, ET) means:

IN and PT are input variables of the BOOL and TIME types respectively. Q and ET are output variables of the BOOL and TIME types respectively. If IN is FALSE, Q is FALSE and ET is 0.

As soon as IN becomes TRUE, the time will begin to be counted in milliseconds in ET until its value is equal to PT. It will then remain constant.

Q is TRUE when IN is TRUE and ET is equal to PT. Otherwise it is FALSE.

Thus, Q has a rising edge when the time indicated in PT in milliseconds has run out.

Graphic display of TON behavior over time:

Declaration example:

TONInst : TON ;

Example in IL:

CAL TONInst(IN := VarBOOL1, PT := T#5s)

LD TONInst.Q

ST VarBOOL2

Example in FBD:

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

Standard Library Elements

333

Timer

 

 

 

Example in ST:

TONInst(IN := VarBOOL1, PT:= T#5s);

13.5.3TOF

The function block TOF implements a turn-off delay..

TOF(IN, PT, Q, ET) means:

IN and PT are input variables type BOOL respectively TIME. Q and E are output variabls type BOOL respectively TIME. If IN is TRUE, the outputs are TRU respectively 0.

As soon as IN becomes FALSE, in ET the time will begin to be counted in milliseconds in ET until its value is equal to PT. It will then remain constant.

Q is FALSE when IN is FALSE und ET equal PT. Otherwise it is TRUE.

Thus, Q has a falling edge when the time indicated in PT in milliseconds has run out.

Graphic display of TOF behavior over time:

Declaration example:

TOFInst : TOF ;

Example in IL:

CAL TOFInst(IN := VarBOOL1, PT := T#5s)

LD TOFInst.Q

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32