With this function, the current mechanical position of an axis equipped with an absolute value encoder can be calculated. For this purpose, the encoder position and the accompanying mechanical position must be determined during commissioning of the axis.
Recommended task: |
- |
Libraries used: |
ARITHMETIC_30bd00 or greater |
Additional data type definitions: |
... |
Use of Static-Variables: |
... |
InOut Parameter
Input Parameter
Marking: |
Data type: |
Default: |
Data range: |
Description: |
d_EncPresentPos |
DWORD |
... |
... |
Position of the encoder in increments for which the mechanical position (di_MechPresetPos) is known. This parameter is specified during commissioning. |
di_MechPresentPos |
DINT |
... |
... |
Mechanical position of the axis, if the encoder outputs d_EncPresetPos. This parameter is specified during commissioning. |
d_EncPos |
DWORD |
... |
... |
Current position of the encoder in increments. For this position, the mechanical position of the axis in user units is output. |
|
ud_Units |
UDINT |
... |
... |
Number of user units for the given encoder revolutions (u_Revolution). |
|
u_Revolution |
UINT |
... |
... |
Number of encoder revolutions for the given user units (ud_Units). |
|
u_IncsPerRound |
UINT |
... |
... |
Number of increments per revolution of the encoder. |
|
Output Parameter
Marking: |
Data type: |
Description: |
TB_GetPosAbsEnc |
DINT |
Mechanical position of the axis in user units for the encoder position d_EncPos in increments. |