MC_SetPosition
The
MC_SetPosition
function block sets a new reference coordinate frame for the axis. As a result, the commanded position and actual position of the axis change without causing any motion.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| B | Axis | AXIS_REF | Logical axis reference. | |
| VAR_INPUT |
|
|||
| B | Execute | BOOL | Upon the rising edge of the Execute input, all other inputs are read and the function block becomes operational. If an input needs to be modified, the value will have to be changed and the Execute input will have to be re-triggered. | FALSE |
| B | Position | LREAL | A positive or negative value that defines the new reference coordinate frame for the axis. | LREAL#0.0 |
| E | Mode | BOOL | ABSOLUTE = False (Default), RELATIVE =True. This refers to the coordinate system, not the motor type. | FALSE |
| VAR_OUTPUT | ||||
| B | Done | BOOL | The Done output is set to TRUE when the commanded action has completed successfully. If another function block takes control before the action is completed, the Done output will never become TRUE. This output is reset when Execute becomes FALSE. | |
| B | Busy | BOOL | For function blocks with Execute input, the Busy output is set to TRUE upon the rising edge of the Execute, and set to FALSE when Done, CommandAborted or Error outputs becomes TRUE. In the case of a function block with an Enable input, Busy indicates that the function block is operating, but may not be ready to provide valid outputs. | |
| B | Error | BOOL | The Error output is set to TRUE if an error has occurred during the operation of the function block. The output is cleared when the Execute or Enable input becomes FALSE. | |
| E | ErrorID | UINT | The ErrorID output provides the identifier of the error when there is an active error in the function block execution. The output is cleared when the Execute or Enable input becomes FALSE. | |
Notes
- When Mode=FALSE, the Position input value is treated as an absolute position, and the axis position is defined as such. If Mode=TRUE, the value of the Position input is added to the current commanded position, the sum of which becomes the new commanded position without any motion occurring.
- If the specified axis has a Sigma Series absolute encoder, the absolute encoder offset is calculated and stored in the controller's battery-backed SRAM when this block is executed. The next time the system is powered up, the absolute encoder data is read, and the position is adjusted to reflect the desired position for the machine. It is not necessary to physically move the motor to a zero point and reset the absolute encoder. Parameter 1838 can be used to read or write the absolute encoder offset for maintenance purposes. It is not recommended to frequently set the position of an axis if the axis is set to use the absolute encoder. If an application needs the position of the axis to be set frequently, set the encoder in incremental mode (Pn002.2)
- If Y_ResetAbsoluteEncoder was executed, a power cycle is required before MC_SetPosition can effectively store the absolute encoder offset.
- An error will be generated if executed on an external encoder axis that has the High Speed Output (Coincidence output function) enabled.
Error Description
See the
Function Block ErrorID List
Example
Instance of
MC_SetPosition
setting the axis position to 0.0.
The Logic Analyzer trace for the above example is shown below: