MC_SetPosition (motion control set position)

The MC_SetPosition instruction shifts the coordinate system of an axis by manipulating the actual position of an axis with the same value without causing any movement.
Operation details:
  • MC_SetPostion can successfully complete only when the axis state is Standstill, continuous Motion (MC_ExecutionMode = 0), or when the on-going motion completes, and ends with a Standstill state (MC_ExecutionMode = 1).
  • MC_SetPosition operates the same as MC_Home when the HomingMode = MC_HOME_DIRECT (0x04), except the MC_Home function block sets the Axis Homed status.
  • When MC_ExecutionMode = 0 (mcImmediately), the execution of the MC_SetPosition function block reports an error if there is ongoing non-continuous motion with the axis.
  • When MC_ExecutionMode = 1 (mcQueued), the actual position setting occurs only when all previous ongoing motion stops. That is, each previous function block must have at least one of the Done, Aborted, or Error outputs equal to True.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L50E and L70E controllers that support motion control.
MC_SetPosition
MC_SetPosition
MC_SetPosition parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction block enable.
  • TRUE: Execute current MC_SetPosition computation.
  • FALSE: There is no computation.
Applies only to ladder diagram programs.
AxisIn
Input
AXIS_REF
FB_AXIS_REF
Use the AXIS_REF data type to define AxisIn.
For FB_Axis (feedback axis), use the  FB_AXIS_REF data type to define AxisIn.
Execute
Input
BOOL
TRUE: Starts setting the axis position.
Position
Input
REAL
The absolute position or relative distance to be set for the axis.
Relative
Input
BOOL
  • TRUE: Set the relative distance for the axis.
  • FALSE: Set the absolute position for the axis.
MC_ExecutionMode
Input
SINT
Values are:
  • 0 (
    mcImmediately
    ): The functionality is immediately valid.
  • 1 (
    mcQueued
    ): The new functionality becomes valid when:
  • All previous motion commands set to one of the following output parameters: Done, Aborted or Error.
  • The axis is not in a moving state.
For (MC_ExecutionMode = 0), this function block successfully completes when the axis state is Disabled or Standstill. The execution of this function block reports an error if there is an ongoing non-Continuous motion with the axis in this mode.
For (MC_ExecutionMode = 1), this function block successfully completed when the axis state is Disabled, Standstill, or the ongoing motion can complete, ending with a Standstill state.
Other input values are reserved currently, and are considered as invalid parameters.
ENO
Output
BOOL
Enable output.
Applies only to ladder diagram programs.
Axis
Output
AXIS_REF
Axis output is read-only in ladder diagram programs.
Done
Output
BOOL
TRUE: The Position has new value.
Busy
Output
BOOL
TRUE: The function block is not finished.
Error
Output
BOOL
Indicates that an error occurred.
  • TRUE: An error is detected.
  • FALSE: No error.
ErrorID
Output
UINT
A unique numeric that identifies the error. The errors for this instruction are defined in Motion control function block error IDs.

MC_SetPosition examples

MC_SetPosition function block diagram example
MC_SetPosition function block diagram example
MC_SetPosition ladder diagram example
MC_SetPosition ladder diagram example
MC_SetPosition structured text example
MC_SetPosition structured text example
Results
Results
Axis monitoring
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal