Access from the user program, Process data – BECKHOFF KL2521-0000 User Manual
Page 12
Access from the user program
10
KL2521
Access from the user program
Process Data
Input format: Two's complement representation (integer - 1 corresponds to
0xFFFF)
or sign / amount representation (Feature.3) (integer -1 corresponds to
0x8001)
The output frequency is specified within maximum resolution of 15 bits (the
16th bit is used to specify the direction).
Negative process data results in rotation in the opposite direction. In this
case, the internal counter counts to decreasing values.
(relative data)
The output frequency is based on the base frequency that is set in
registers 36 to 39 and the process data (see table).
Output frequency = base frequency x process data / 32767
Highest resolution = 125 mHz
Example:
Base frequency = 100,000 Hz (maximum selected output frequency)
Process data = 0x00FF (255
dec
)
Output frequency = 778.22 Hz
(direct data)
It is possible to enter the frequency directly (Feature.7).
In this case the process data is multiplied by the factor contained in register
42, and directly written to the synthesis chip.
Output frequency = frequency factor x process data x 10 mHz
Highest resolution = 10 mHz
Example:
Frequency factor = 100
Process data = 0x00FF (255
dec
)
Output frequency = 255 Hz
relative data:
Process data
Output value
0x0000
0% DC
0x3FFF
50% of the base frequency, rotation to the right
0x7FFF
100% of the base frequency, rotation to the right
0xC000
50% of the base frequency, rotation to the left
Two's
complement
0x8000
100% of the base frequency, rotation to the left
0xBFFF
50% of the base frequency, rotation to the left
Sign-amount
0xFFFF
100% of the base frequency, rotation to the left