MC_SetPosition (FB)¶
FUNCTION_BLOCK MC_SetPosition
This function block shifts the coordinate system of an axis. Both the set and actual position of the axis are offset by the same amount. No movement is caused by this operation. This recalibration can be used, for instance, for referencing an axis.
The function block can be called while the axis is moving. In this case, the resulting movement of the drive is not affected. The same set positions in increments are sent to the drive as if MC_SetPosition had not been called. Only the set positions in technical units (fSetPosition) are shifted.
Important
ABSOLUTE (mode = FALSE) means that the new axis position is the value of input
Position
.RELATIVE (mode = TRUE) means that the new axis position is the sum of the current axis position and the value of input
Position
.
Note
This function block does not affect the trajectory of already commanded movements. However, the target position of absolute movements commanded after MC_SetPosition will be considered relative to the shifted coordinate system.
- InOut:
Scope
Name
Type
Comment
Inout
Axis
Reference to axis
Input
Execute
BOOL
Rising edge: Starts the execution of the function block.
Position
LREAL
Position unit [u] (means ‘Distance’ if
Mode
= RELATIVE)Mode
BOOL
TRUE
= RELATIVE,FALSE
= ABSOLUTEOutput
Done
BOOL
TRUE
: The position has been shifted.Busy
BOOL
TRUE
: Execution of function block is not finished yet.Error
BOOL
TRUE
: An error has occurred within the function block.ErrorID
SMC_ERROR
Error identification