page 99
Function
INC_ENCODER
Library CRxxxx.LIB
Function symbol
Purpose
Up/down counter to evaluate encoders
Parameter
Function inputs
Function outputs
Description
The function INC_ENCODER is an up/down counter up to a
limit frequency of approx. 10 kHz. Two frequency inputs form an
input pair which is evaluated via the function. A total of 4
incremental encoders can be connected.
The counter can be set to a preset value via PRESET_VALUE.
The value is accepted when PRESET is set to TRUE. PRESET
then has to be reset to FALSE so that the counter becomes
active. Output COUNTER shows the current count.
The outputs UP and DOWN show the current count direction of
the counter. The outputs are TRUE when the counter has
counted in the direction in question in the previous program
cycle. When the counter stops the directional output is reset in
the following program cycle.
Name Data type Description
INIT BOOL TRUE: INC_ENCODER is initialised
FALSE: counter is active
CHANNEL BYTE number of the input pair (0 ... 3)
PRESET_
VALUE
WORD preset counter value
PRESET BOOL TRUE: preset value is accepted
FALSE: counter is active
Name Data type Description
COUNTER WORD actual value
UP BOOL TRUE: counter counts up
DOWN BOOL TRUE: counter counts down