Motion Calculate Slave Values (MCSV)
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 Slave Values (MCSV) instruction to calculate the slave value, the slope value, and the derivative of the slope for a given cam profile and a master value.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
MCSV(MotionControl,CamProfile,MasterValue,SlaveValue,SlopeValue,SlopeDerivative)
Operands
There are data conversion rules for mixed data types within an instruction. See
Data Conversion
.Ladder Diagram and Structured Text
Operand | Type | Format | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Motion Control | MOTION_INSTRUCTION | Tag | Structure used to access block status parameters. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Cam Profile | CAM_PROFILE, CAM_PROFILE_EXTENDED CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllersUse the Motion Redefine Position (MRP) instruction to change the command or actual position of an axis. The value specified by Position is used to update the Actual or Command position of Axis. The position redefinition can be calculated on an Absolute or Relative basis. If Absolute is selected the Position value is assigned to the current Actual or Command position. If Relative is selected the Position value is added as a displacement to the current Actual or Command position. The process of redefining the current axis position has no affect on motion in progress as the instruction preserves the current servo following error during the redefinition process. As a result, axis position can be redefined on-the-fly without disturbing axis motion. Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MRP(Axis,MotionControl,Type,PositionSelect,Position); Operands Ladder Diagram and Structured Text
See Structured Text Syntax for more information on the syntax of expressions within structured text.For the operands that require you to select from available options, enter your selection as:
MOTION_INSTRUCTION Structure
Description The MRP instruction directly sets the actual or command position of the specified axis to the specified absolute or relative position. No motion is caused by this instruction—the current axis position is simply redefined. Select or enter the desired Axis, Type, Position Selection, and enter a value or tag variable for the desired New Position. If the targeted axis does not appear in the list of available axes, the axis has not been configured for operation. Use the Tag Editor to create and configure a new axis. The MRP instruction may be used while the axis is moving as well as when it is at rest. MRP is used to redefine position on-the-fly for certain registration, slip compensation, and re-calibration applications.
In this transitional instruction, the relay ladder, toggle the Rung-condition-in from cleared to set each time the instruction should execute. Master Driven Speed Control (MDSC) and the MRP Instruction You can execute an MRP on the Master or the Slave axes or coordinate system when an MDSC is active. The Master axis position is changed when an MRP is executed (goes IP) on the Master while it is moving in MDSC mode; the slave is not affected. Affects Math Status Flags No Major/Minor Faults None specific to this instruction. See Common Attributes for operand-related faults.Execution Ladder Diagram
Structured Text
Error Codes See Error Codes (ERR) for Motion Instructions. Extended Error Codes Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. See Motion Error Codes (.ERR) for Motion Instructions. The following Extended Error codes help to pinpoint the problem when the MRP instruction receives a Servo Message Failure (12) error message.
Extended Error codes for the Parameter Out of Range (13) error code work a little differently. Rather than having a standard enumeration, the number that appears for the Extended Error code refers to the number of the operand as they are listed in the faceplate from top to bottom with the first operand being counted as zero. Therefore for the MRP instruction, an extended error code of 4 would refer to the Position operand’s value. You would then have to check your value with the accepted range of values for the instruction. MRP Changes to Single Axis Status Bits The AxisHomedStatus bit is not impacted by the execution of the MRP instruction. The status is the same before and after the MRP is execution. If the axis has been homed using the absolute home procedure, the AbsoluteReferenceStatus is set. AxisHomedStatus may also be set is the axis has not been subject to a power cycle. AbsoluteReferenceStatus is cleared when the MRP is executed and this is only true to Axis_Servo_Drive axis. This indicates the axis position is no longer referenced to the absolute home position. Examples Example 1 Ladder Diagram Example 2 Ladder Diagram | Array Tag | An array of elements with the array index set to 0. It defines the cam profile used in calculating the slave values. Use the CAM_PROFILE_EXTENDED type for this operand to enable access to double-precision (64-bit LREAL) cam data members. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Master Value | SINT, INT, DINT, or REAL | Immediate or Tag | The exact value along the master axis of the cam profile that is used in calculating the slave values. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Slave Value | REAL | Tag | The value along the slave axis of the cam profile with the master at the specified master value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Slope Value | REAL | Tag | The first derivative of the value along the slave axis of the cam profile with the master at the specified master value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Slope Derivative | REAL | Tag | The second derivative of the value along the slave axis of the cam profile with the master at the specified master value. |
Structured Text
See
Structured Text Syntax
for more information on the syntax of expressions within structured text. Description
The MCSV instruction determines the slave value, the slope value, and the derivative of the slope for a given cam profile and master value. As an extension to the position and time camming functionality, it supplies the values essential for the recovery from faults during camming operations.
Motion Control
These control bits are affected by the MCSV instruction.
Mnemonic | Description |
---|---|
.EN (Enable) Bit 31 | The Enable Bit sets when the rung transitions from false to true. It resets when the rung goes from true to false. |
.DN (Done) Bit 29 | The Done Bit sets when the slave values have been calculated successfully. It resets when the rung transitions from false to true. |
.ER (Error) Bit 28 | The Error Bit sets when the slave values have not been calculated successfully. It resets when the rung transitions from false to true. |
This is a transitional instruction:
- In relay ladder, toggle Rung-condition-in from false to true each time the instruction should execute.
- In structured text, condition the instruction so that it only executes on a transition.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. 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. |
Extended Error Codes
Extended Error codes provide additional instruction-specific information for the error codes that are generic to many instructions. Extended error codes for the Parameter Out of Range (13) error code lists a number that refers to the number of the operand as listed in the faceplate from top to bottom with the first operand being counted as zero. Therefore for the MCSV instruction, an extended error code of 2 would refer to the Master Value operand’s value. You would then have to check your value with the accepted range of values for the instruction. See
Motion Error Codes (.ERR)
for Motion Instructions.MCSV Changes to Status Bits
None
Example
Provide Feedback