INC_ENCODER. IFM CR0403

Add to My manuals
231 Pages

advertisement

INC_ENCODER. IFM CR0403 | Manualzz

BasicController CR0403

INC_ENCODER

= Incremental Encoder

Unit type = function block (FB)

Unit is contained in the library ifm_CR0403_Vxxyyzz.LIB

Symbol in CODESYS:

35689

>

Description

35695

INC_ENCODER handles up/down counter functions for the evaluation of encoders.

Two frequency inputs form the input pair which is evaluated by means of the FB.

Permissible limit frequency = 0...1 000 Hz

Via PRESET_VALUE the counter can be set to a preset value. The value is adopted if PRESET is set to TRUE. Afterwards, PRESET must be set to FALSE again for the counter to become active again.

The current counter value is available at the output VALUE. The outputs UP and DOWN indicate the last counting direction of the counter. The outputs are TRUE if the counter has counted in the corresponding direction. If the counter was not changed since the last call of the FB, both the outputs are FLASE.

On input RESOLUTION the resolution of the encoder can be evaluated in multiples:

1 = normal resolution (-536 870 912...536 870 911, identical with the resolution of the encoder),

2 = double evaluation of the resolution (-1 073 741 824...1 073 741 823),

4 = 4-fold evaluation of the resolution (-2 147 483 648...2 147 483 647).

All other values on this input mean normal resolution.

RESOLUTION = 1 counts for every fourth edge

(= resolution of the encoder).

RESOLUTION = 2 counts for every second edge

RESOLUTION = 4 counts for every rising and falling edge

169

>

BasicController CR0403

Parameters of the inputs

Parameter

ENABLE

CHANNEL

PRESET_VALUE

PRESET

RESOLUTION

Data type

BOOL

BYTE

DINT

BOOL

BYTE

Description

TRUE: execute this function element

FALSE: unit is not executed

> Function block inputs are not active

> Function block outputs are not specified number of the input channel pair:

0 = channel pair 0 = inputs I00 + I01

2 = channel pair 1 = inputs I02 + I03 counter start value

FALSE  TRUE (edge):

PRESET_VALUE is loaded to COUNTER

TRUE: Counter ignores the input pulses

FALSE: Counter counts the input pulses evaluation of the encoder resolution:

01 = counts for every fourth edge (= resolution of the encoder)

02 = counts for every second edge

04 = counts for every rising and falling edge

All other values count as "01".

35731

>

Parameters of the outputs

Parameter

VALUE

UP

DOWN

RESULT

Data type

DINT

BOOL

BOOL

BYTE

Description if RESOLUTION = 1:

VALUE = –536 870 912...536 870 911

(= ¼ area of DINT) if RESOLUTION = 2:

VALUE = –1 073 741 824...1 073 741 823

(= ½ area of DINT) if RESOLUTION = 4:

VALUE = –2 147 483 648…2 147 483 647

(= area of DINT)

TRUE: counter counts upwards in the last cycle

FALSE: counter counts not upwards in the last cycle

TRUE: counter counts downwards in the last cycle

FALSE: counter counts not downwards in the last cycle feedback of the function block

(possible messages → following table)

Possible results for RESULT:

Value dec | hex

Description

3

130

138

0

1

2

03

82

8A

00

01

02

FB is inactive

FB execution completed without error – data is valid function block is active (action not yet completed) function block is active

– valid values not yet available channel setting is invalid resolution setting is invalid

35952

170

advertisement

Related manuals

Download PDF

advertisement

Table of contents