Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018 159
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 Logix Designer 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 Variables Description
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.
Linear and Cubic Spline Interpolation
The resultant calculated cam profiles are fully interpolated. This means that if the
current master position or time does not correspond exactly with a point in the
cam array used to generate the cam profile, the slave axis position is determined by
linear or cubic interpolation between adjacent points. In this way, the smoothest
possible slave motion is provided. The MCCP instruction accomplishes this by
calculating coefficients to a polynomial equation that determines slave position as
a function of master position or time.
Calculating the Cam Profile
Before calculating a cam profile on a specified axis, the MCCP instructions first
checks if the cam profile array has been calculated by checking the value of the first
cam profile element’s Status member. If the Status value is either 0 or 2, the
MCCP proceeds with the calculation of the cam profile. When the cam profile
array has been completely calculated, the MCCP instruction sets the first cam