CMC_GET_UNITS_FROM_INC

This function converts the drive’s position value (DINT) which is exchanged between drive and PLC to the corresponding scaled position unit (LREAL) which is used by the PLCopen Function Blocks.

../_images/f77de4396c87d3150a317f34114c0c79

CMC_GET_UNITS_FROM

Use case:

  • The drive or an IO-device is used to capture an axis encoder position in relation to a binary signal (touch trigger). This position is delivered in [increments].

    If then the position is to be used in the PLCopen context, a unit position is required. It can be difficult to calculate this unit-position. Not just the scaling position units has to be considered but also the position might have experienced several correction measures. Measures like “SetPositionContinuous” or corrections due to modulo position overrun. To create the unit-value which matches a certain increment-value, the function CMC_GET_UNITS_FROM_INC has to be used.

Input:

ACTUAL_POSITION_INC

Data type: DINT

A position [increments], for example captured by the drive as result for a touch trigger

KERNEL

Data type: CMC_MOTION_KERNEL_REAL

Kernel block instance which belongs to the specific axis.

Result:

The position [u], which describes exactly the same position as ACTUAL_POSIITON_INC, just transferred in to the axis coordinate system and delivered in [u].