3 up/down counter (l_fcnt), Up/down counter (l_fcnt), Function library lenzedrive.lib – Lenze DDS Function library Drive User Manual

Page 42: Digital signal processing

Advertising
background image

2.3.3

Up/down counter (L_FCNT)

Function library LenzeDrive.lib

Digital signal processing

2−32

L

LenzeDrive.lib EN 1.7

2.3.3

Up/down counter (L_FCNT)

This FB is a digital up/down counter, that is limited to the value nCmpVal_a.

CTRL

L_FCNT

bClkUp_b

nLdVal_a

bLoad_b

nCmpVal_a

byFunction

bClkDown_b

nOut_a

bEqual_b

Fig. 2−38

Up/down counter (L_FCNT)

VariableName

DataType

SignalType

VariableType

Note

bClkUp_b

Bool

binary

VAR_INPUT

FALSE−TRUE edge = counts up by 1.

bClkDwn_b

Bool

binary

VAR_INPUT

FALSE−TRUE edge = counts down by 1.

nLdVal_a

Integer

analog

VAR_INPUT

Start value

bLoad_b

Bool

binary

VAR_INPUT

·

TRUE = accept start value

·

The input has the highest priority.

nCmpVal_a

Integer

analog

VAR_INPUT

Comparison value

nOut_a

Integer

analog

VAR_OUTPUT

The count value is limited to ±32767.

bEqual_b

Bool

binary

VAR_OUTPUT

TRUE = comparison value reached.

byFunction

Byte

VAR CONSTANT RETAIN

Selection of the function

Parameter codes of the instances

VariableName

L_FCNT1

SettingRange

Lenze

byFunction

C1100

1 ... 2

1

Function

Selection of the
Function

Description

byFunction = 1

·

If the

½count value ½ ³ ½nCmpVal_a ½, the output bEqual_b is set to TRUE. At the next clock cyle, the

counter is reset to the value nLdVal_a and the output bEqual_b is set to FALSE.

byFunction = 2

·

If the

½count value ½ = ½nCmpVal_a ½, the counter stops( bClkUp_b / bClkDwn_b are ignored).

·

bLoad_b = TRUE sets the counter to the value at nLdVal_a and responds to bClkUp_b / bClkDwn_b
again.

Advertising