Motion Calculate Cam Profile (MCCP)
Motion Calculate Cam Profile (MCCP)
Motion Calculate Cam Profile (MCCP)
The Motion Calculate Cam Profile (MCCP) instruction calculates a cam profile based on an array of cam points. An array of cam points may be
established programmatically or by use of the RSLogix 5000 Cam Profile Editor. Each cam point in the cam array consists of a slave position value,
a master position (position cam) or time (time cam) value, and an interpolation type (linear or cubic). The resulting cam profile may be used by a
Motion Axis Position Cam (MAPC) instruction or Motion Axis Time Cam (MATC) instruction to govern the motion of a slave axis according to master
position or time.
Operands
Ladder Diagram
Motion Control MOTION_INSTRUCTION Tag Structure used to access block status parameters.
Cam CAM Array Tag name of the cam array used to compute the cam profile. The numerical array
index indicates the starting cam element in the array used in the cam profile
calculation. Ellipsis launches Cam Profile Editor.
Length UINT Immediate Determines the number of cam elements in the array used in the cam profile
or Tag calculation.
State Slope REAL Immediate This is the boundary condition for the initial slope of the profile. It is valid only for
or Tag a cubic first segment and is used to specify a slope through the first point.
End Slope REAL Immediate This is the boundary condition for the ending slope of the profile. It is valid only
or Tag for a cubic last segment and is used to specify a slope through the last point.
Cam Profile CAM_PROFILE Array Tag name of the calculated cam profile array used as input to MAPC and MATC
instructions. Only the zero array element ([0]) is allowed for the Cam Profile
array. Ellipsis launches Cam Profile Editor.
Structured Text
MCCP(Motion Control, Cam, Length, Start Slope, End Slope, Cam Profile);
The operands are the same as those for the relay ladder MCCP instruction. For the array operands, you do not have to include the array index. If
you do not include the index, the instruction starts with the first element in the array ([0]).
MOTION_INSTRUCTION Structure
Mnemonic Description
.EN (Enable) Bit 31 The enable bit is set when the rung transitions from false-to-true
and stays set until the done bit is set and the rung goes false.
.DN (Done) Bit 29 The done bit is set when the calculate cam instruction has been
successfully executed and the Cam Profile array calculated.
.ER (Error) Bit 28 The error bit indicates when the instruction detects an error, such
as if the cam array is of an illegal length.
Description
The MCCP instruction computes a cam profile based on a given set of points in a specified cam array. The resultant cam profiles generated by this
instruction may be used by subsequent Motion Axis Position Cam (MAPC) or Motion Axis Time Cam (MATC) camming instructions to provide
complex motion of a slave axis with respect to either a master axis position or with respect to time.
Since cam profiles can be directly calculated by the RSLogix 5000 Cam Profile Editor, the main purpose of the MCCP instruction is to provide a
method for calculating cam profiles in real-time based on programmatic changes to the corresponding cam arrays.
The MCCP instruction computes a cam profile based on a given set of points in a specified cam array. The resultant cam profiles generated by this
instruction may be used by subsequent Motion Axis Position Cam (MAPC) or Motion Axis Time Cam (MATC) camming instructions to provide
complex motion of a slave axis with respect to either a master axis position or with respect to time.
Since cam profiles can be directly calculated by the RSLogix 5000 Cam Profile Editor, the main purpose of the MCCP instruction is to provide a
method for calculating cam profiles in real-time based on programmatic changes to the corresponding cam arrays.
Specifying a Cam Array
In order to execute an MCCP instruction, a Cam array tag must be created using the RSLogix Tag Editor or the Cam Profile Editor. The figure
below illustrates how the Cam array tags are established and used as input to the MCCP instruction.
mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 02/07/2017
Motion Calculate Cam Profile (MCCP) Page 2 of 4
The Cam array elements consist of slave (yp) and master (xp) point pairs as well as an interpolation type. Since there is no association with a
specific axis position or time, the x and y point values are unitless. The interpolation type may be specified for each point as either linear or cubic.
Specifying the Cam Profile Tag
To execute a MAPC instruction, a Cam Profile array tag must also be created. Cam Profile array tags may be created by the RSLogix 5000 tag
editor or the MAPC/MATC instructions using the built-in Cam Profile Editor.
The data within the Cam Profile array can be modified at compile time using the Cam Profile Editor, or at run-time with the MCCP instruction. In
the case of run-time changes, a Cam array must be created in order to use the MCCP instruction.
The status parameter is used to indicate that the Cam Profile array element has been calculated. If execution of a camming instruction is
attempted using any uncalculated elements in a cam profile, the MAPC or MATC instructions error. The type parameter determines the type of
interpolation applied between this cam array element and the next cam element.
Cam Profile Array Status Member
The Status member of the first element in the cam profile array is special and used for data integrity checks. For this reason, the MCCP must
always specify the cam profile with the starting index set to 0. This first cam profile element Status member can have the following values.
Status Description
Variables
0 Cam profile element has not been calculated.
1 Cam profile element is being calculated.
2 Cam profile element has been calculated.
n Cam profile element has been calculated and is currently being used by (n-2) or
MATC instructions.
The default values for Start Slope and End Slope are 0 to facilitate a smooth start and end to the cam profile from rest. However, if the axis is
already camming, an appropriate non-zero Start Slope can be specified to match the End Slope of the currently executing cam, to seamlessly
blend the two cam profiles together.
The Start Slope and End Slope values are not applicable when starting or ending the cam profile with linear interpolation.
Important: The MCCP instruction execution completes in a single scan. This instructions should therefore be placed in a separate task to avoid
impacting user program scan time.
In relay ladder, toggle the rung-condition-in from cleared to set each time the instruction should execute.
In structured text, condition the instruction so that it only executes on a transition. For more information, see Structured Text Syntax.
mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 02/07/2017
Motion Calculate Cam Profile (MCCP) Page 3 of 4
Not affected
Fault Conditions
None
Error Codes
None.
Example
When the input instructions are true, the controller changes the speed, acceleration, or deceleration rate of a move profile or jog profile in progress
for axis_1.
Relay Ladder
Structured Text
MCCP(MCCP_1,Cam_1[0],30,1.0,1.0,cam_pro1[1]);
Related Instructions
Motion Axis Position Cam (MAPC)
Motion Axis Time Cam (MATC)
Related Topics
Structured Text Syntax
Motion Error Codes (.ERR)
mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 02/07/2017
Motion Calculate Cam Profile (MCCP) Page 4 of 4
mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 02/07/2017