Motion Calculate Transform Position (MCTP)
This information applies to the
CompactLogix
5370, ControlLogix
5570, Compact GuardLogix
5370, GuardLogix
5570, Compact GuardLogix
5380, CompactLogix
5380, CompactLogix
5480, ControlLogix
5580, and GuardLogix
5580 controllers.Use the Motion Calculate Transform Position (MCTP) instruction to calculate the position of a point in one coordinate system to the equivalent point in a second coordinate system.
IMPORTANT:
Tags used for the motion control attribute of instructions should only be used once. Re-use of the motion control tag in other instructions can cause unintended operation. This may result in damage to equipment or personal injury.
Architecture | Standard | Safety |
---|---|---|
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers | Yes | No |
Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers | Yes | No |
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
MCTP(Source System, Target System, Motion Control, Orientation, Translation, Transform Direction, Reference Position, Transform Position);
Operands
Ladder Diagram and Structured Text
Operand | Type | Format | Description | |
---|---|---|---|---|
Source System | COORDINATE_SYSTEM | Tag | Cartesian coordinate system for Cartesian positions of the robot For controllers that support the REF_TO motion data types, the coordinate system operand type can be replaced by the REF_TO_COORDINATE_SYSTEM type. | |
Target System | COORDINATE_SYSTEM | Tag | Non-Cartesian coordinate system that controls the actual equipment. For controllers that support the REF_TO motion data types, the coordinate system operand type can be replaced by the REF_TO_COORDINATE_SYSTEM type. | |
Motion Control | MOTION_INSTRUCTION | Tag | Control tag for the instruction. | |
Translation | REAL[3] | Array | Do you want to offset the target position along the X1, X2, or X3 axis? | |
If | Then | |||
No | Leave the array values at zero. | |||
Yes | Enter the offset distances into the array. Enter the offset distances in coordinate units. Put the offset distance for X1 in the first element of the array, and so on. | |||
Use an array of three REALs even if a coordinate system has only one or two axes. |
Operand | Type | Format | Description | ||||
---|---|---|---|---|---|---|---|
Transform Direction | DINT | Immediate | For Robot Type | To calculate | With the base turned to the | And the robot is | Select |
All | Cartesian Position | Forward | |||||
Cartesian Delta 2D Delta 3D SCARA Delta | Joint Angles | Inverse | |||||
Articulated Independent Articulated Dependent SCARA Independent | Joint Angles | Same Quadrant as the Point | Right Arm Configuration | Inverse Right Arm | |||
Left Arm Configuration | Inverse Left Arm | ||||||
Opposite Quadrant from the Point | Right Arm Configuration | Inverse Right Arm Mirror | |||||
Left Arm Configuration | Inverse Left Arm Mirror | ||||||
Reference Position | REAL[3] | Array | If the transform direction is: | Then enter an array that has the: | |||
Forward | Joint Angles | ||||||
Inverse | Cartesian Positions | ||||||
Transform Position | REAL[3] | Array | Array that stores the calculated position |
Enter the transform direction without spaces. For example, a transform direction of Inverse Left Arm is entered as InverseLeftArm.
See
Structured Text Syntax
for more information on the syntax of expressions within structured text. MOTION_INSTRUCTION Data Type
To see if | Check if this bit is on | Data Type | Notes |
---|---|---|---|
The rung is true | EN | BOOL | Sometimes the EN bit stays on even if the rung goes false. This happens if the rung goes false before the instruction is done or an error has occurred. |
The instruction is done. | DN | BOOL | |
An error happened | ER | BOOL | Identify the error number listed in the error code field of the Motion control tag then, refer to Motion Error Codes. |
The MCTP instruction is similar to the MCT instruction except the MCTP instruction doesn't start a transform. It calculates a position once each time you execute it.
Programming Guidelines
Follow these guidelines to use an MCTP instruction.
MCTP Instruction Guidelines
Guideline | Example and Notes |
---|---|
Toggle the rung from false to true to execute the instruction. | This is a transitional instruction. In a ladder diagram, toggle the Rung-condition-in from false to true each time you want to execute the instruction. |
In structured text, condition the instruction so that it only executes on a transition. | In structured text, instructions execute each time they are scanned. Condition the instruction so that it only executes on a transition. Use either of these methods: Qualifier of an SFC action Structured text construct |
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. A major fault can occur if an uninitialized reference or a reference of the incorrect type is passed to the Coordinate System operands. See
Common Attributes
for operand-related faults.Execution
Ladder Diagram
Condition/State | Action Taken |
---|---|
Prescan | The .EN, .DN, .ER, and .IP bits are cleared to false. |
Rung-condition-in is false | The .EN bit is cleared to false if either the .DN or .ER bit is true. |
Rung-condition-in is true | The .EN bit is set to true and the instruction executes. |
Postscan | N/A |
Structured Text
Condition/State | Action Taken |
---|---|
Prescan | See Prescan in the Ladder Diagram table. |
Normal execution | See Rung-condition-in is false, followed by rung is true in the Ladder Diagram table. |
Postscan | See Postscan in the Ladder Diagram table. |
Error Codes
See
Motion Error Codes (.ERR)
for Motion Instructions.Extended Error Codes
Use Extended Error Codes (EXERR) for more instruction about an error. A major fault can occur if an uninitialized reference or a reference of the incorrect type is passed to the Coordinate System operands. See
Motion Error Codes (.ERR)
for Motion Instructions.Changes to Status Bits
None
Data Flow of MCTP Instruction Between Two Coordinate Systems
The following illustrations show the flow of data when an MCTP Instruction is executed to perform a forward transformation and an inverse transformation. The CS1 indicator represents a Cartesian coordinate system containing X1, X2 and X3 axes as the source of the MCTP instruction. The CS2 indicator represents the joint coordinate system containing J1, J2 and J3 axes as the target of the MCTP instruction.
Data Flow When a Move is Executed with an MCTP Instruction - Forward Transform
Data Flow When a Move is Executed with an MCTP Instruction - Inverse Transform
Examples
Ladder Diagram
Structured Text
MCTP(myMctpSourceSystem, myMctpTargetSystem, myMctpMotionControl, myMctpOrientation, myMctpTranslation, InverseRightArmMirror, myMctpReferencePos, myMctpTransformPos);
Provide Feedback