![Kuhnke FIO (V2) Скачать руководство пользователя страница 60](http://html.mh-extra.com/html/kuhnke/fio-v2/fio-v2_manual_2009572060.webp)
Kendrion Kuhnke Automation GmbH
Counter/Posi2, Counter2
60
11/25/2016
4.13.4.7 Operating as A-B-Ref-Counter or Event Counter
(See also page 51: Zähler 1 Optionen (Counter 1 Options))
The counter can be operated as A, B, Ref -Counter with self detection of the
direction or as event counter. The selection is done by the variable
" SelectEncoder_1"
(Set Options see also page 58)
Term2_SelectEncoder_1:=FALSE;
(*A, B, Ref *)
Term2_SelectEncoder_1:=TRUE;
(*Event counter at A*)
(*B=FALSE:down, B=TRUE:up*)
4.13.4.8 Single- und Multiple Counting
This option is valid in the event counter mode only.
(See also page 51: Zähler 1 Optionen (Counter 1 Options))
The counter can count edges (all rising and falling edges) or pulses (only the
rising edges). The selection is done by the variable "SetResolution_1"
(Set Options see also page 58)
Term2_SetResolution_1:=FALSE;
(*all edges*)
Term2_SetResolution_1:=TRUE;
(*Pulses*)
4.13.4.9 Referencing
The counter can be set to preset value when a pulse occurs at the Ref input.
The preset value can be 0, but also any other 32-bit number.
Task:
An encoder with 500 Pulses provides 2000 increments per turn in the all
edges mode.
Every Ref pulse shall set the counter to the preset value 2000.
It shall be counted down to 0 within 1 turn.
(The counting direction is determined by the turning direction of the
encoder.)
PROGRAM Referenzierung
VAR
bInit: BOOL := TRUE;
StepInit: USINT;
bInitReady: BOOL;
Step: USINT;
END_VAR
--------------------------------------------------------------------------------