MC_SetPosition
The function block MC_SetPosition sets the current axis position to a parameterizable value.
In absolute mode, the actual position is set to the parameterized absolute Position value. In relative mode, the actual position is offset by the parameterized Position value. In both cases, the set position of the axis is set such that any lag error that may exist is retained. The switch Options.ClearPositionLag can be used to clear the lag error.
Relative mode can be used to change the axis position during the motion.
Inputs
VAR_INPUT
Execute : BOOL;
Position : LREAL;
Mode : BOOL; (* RELATIVE=True, ABSOLUTE=False (Default) *)
Options : ST_SetPositionOptions;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
Position | LREAL | Position value to which the axis position is to be set. In absolute mode the actual position is set to this value, in relative mode it is shifted by this value. |
Mode | BOOL | The axis position is set to an absolute value set if Mode = FALSE. Otherwise the axis position is changed relative to the specified Position value. Relative mode can be used for changing the position of an axis during motion. |
Options | ST_SetPositionOptions | Not used at present |
See also: General rules for MC function blocks |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | TRUE if the position was set successfully. |
Busy | BOOL | TRUE as soon as the command is started with "Execute" and as long as the command is processed. If "Busy" is FALSE, the function block is ready for a new order. At the same time, one of the outputs "Done" or "Error" is set. |
Error | BOOL | TRUE, if an error occurs. |
ErrorID | UDINT | If the error output is set, this parameter supplies the error number. |
See also: General rules for MC function blocks |
Requirements
Development environment | PLC libraries to include |
---|---|
TwinCAT 3.1.4024.11 | Tc3_DriveMotionControl |