Example for the bit assignment of the handwheel
The following table includes an example for rotation direction determination. The pulses are stored in bytes "n+4" and "n+5"
and are measured during the points in time t
The numbers in the following table represent a byte in the PLC.
Evaluation time
t
1
t
2
t
3
t
4
The difference in pulses at times t
Establish the following values:
● Number of pulses, forwards
–
At time t
n
–
At time t
n+1
● Number of pulses, backwards
–
At time t
n
–
At time t
n+1
From this, you determine the resulting value, which is calculated as follows:
Pulses, forwards, t
n+1
–
Pulses, forwards, t
n
–
Pulses, backwards, t
+
Pulses, backwards, t
=
Resulting value
Consider the response time
Note
Sample cycle time
If the scan cycle is large, the entered impulses will not immediately have an effect on the PLC. A reaction in the system is
not caused.
In the PLC, set a scan cycle ≤ 100 ms.
The bytes "n+4" and "n+5" must be retrieved on the PLC side within a second and cyclically. This setting ensures that no
more than 256 pulses can be added between two scans of the handwheel. You need to turn the handwheel approximately
4.5 turns to generate 256 pulses.
The rotary pulse encoder supplies a maximum of 200 pulses per second.
KTP700F Mobile HW, KTP700F Mobile HW/OR
A5E44033674-AA, 08/2018
to t
.
1
4
Pulses, forwards
255 (≙ –1)
10
10
15
and t
allows you to determine the resulting value and thus the direction of rotation.
n
n+1
n+1
n
Handwheel
Pulses, backwards
245 (≙ –11)
245 (≙ –11)
4
5
Evaluation
--
Pulses, forwards: 11
Pulses, backwards: 0
Resulting value: +11
Pulses, forwards: 0
Pulses, backwards: 15
Resulting value: –15
Pulses, forwards: 5
Pulses, backwards: 1
Resulting value: +4
21