CNT_DN: Downward counter

The CNT_DN (FB445) block is a slope-controlled downward counter with lower counter limit 0.

Functionality

If an increasing slope exists at input "Count down" [CntDn], the "CNT_DN" block reduces the counter value [CntVal] by one. The counting increments are 1.

Note: In order to recognize a slope, the block must pass two machine cycles. As a result, the counts occur at the earliest after the second machine cycle.

Counter limit.

Reset counter

Set start value.

Inputs

Pin

E

Description

CntDn

p

Count down

CntReset

p

Reset counter.

SetStt

pa

Set start value.

SttVal

pa

Start value.

Outputs

Pin

E

Description

CntVal

a

Counter value

ZeRd

a

Zero reached

Input values

Pin

Description

Data type

Default value

E.g. Engineering unit or Text group

Min.

Max.

CntDn

Count down.

Boolean

0 (No)

No, Yes

 

 

CntReset

Reset counter.

Boolean

0 (No)

No, Yes

 

 

SetStt

Set start value.

Boolean

0 (No)

No, Yes

 

 

SttVal

Start value.

Integer

0

 

 

 

Output values

Pin

Description

Data type

Default value

E.g. Engineering unit or Text group

Min.

Max.

CntVal

Counter value.

Integer

0

 

 

 

ZeRd

Zero reached

Boolean

0 (No)

No, Yes

 

 

Process response

The block is processed with the values at the inputs from the second process cycle onward, as the values at the inputs are considered valid only then. Default values are issued during the first process cycle.

Note: A continuous signal at input [CntUp] is recognized as an increasing slope on startup.

Troubleshooting

Standard (see General rules and information).