Allen-Bradley 1756 ControlLogix Instruction Manual
Allen-Bradley 1756 ControlLogix Instruction Manual

Allen-Bradley 1756 ControlLogix Instruction Manual

Logix 5000 controllers
Hide thumbs Also See for 1756 ControlLogix:
Table of Contents

Advertisement

Reference Manual
LOGIX 5000 Controllers Motion Instructions
1756 ControlLogix, 1756 GuardLogix, 1769 CompactLogix, 1769 Compact GuardLogix, 1789
SoftLogix, 5069 CompactLogix, 5069 Compact GuardLogix, Studio 5000 Logix Emulate

Advertisement

Table of Contents
loading

Summary of Contents for Allen-Bradley 1756 ControlLogix

  • Page 1 Reference Manual LOGIX 5000 Controllers Motion Instructions 1756 ControlLogix, 1756 GuardLogix, 1769 CompactLogix, 1769 Compact GuardLogix, 1789 SoftLogix, 5069 CompactLogix, 5069 Compact GuardLogix, Studio 5000 Logix Emulate...
  • Page 2 Flash will cause severe injury or death. Wear proper Personal Protective Equipment (PPE). Follow ALL Regulatory requirements for safe work practices and for Personal Protective Equipment (PPE). Allen-Bradley, Rockwell Software, Rockwell Automation, and TechConnect are trademarks of Rockwell Automation, Inc. Trademarks not belonging to Rockwell Automation are property of their respective companies.
  • Page 3 Summary of changes This manual includes new and updated information. Use these reference tables to locate changed information. Global changes This table identifies changes that apply to all information about a subject in the manual and the reason for the change. For example, the addition of new supported hardware, a software design change, or additional reference material would result in changes to all of the topics that deal with that subject.
  • Page 4 Summary of changes Topic Name Reason Motion Coordinated Path Move (MCPM) page New instruction Motion Calculate Transform Position with New instruction Orientation (MCTPO) page 406 Motion Error Codes page 557 Added new error codes Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 5 Instruction Locator Use this locator to find the applicable Logix5000 controllers instruction manual for each instruction. Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Absolute Value (ABS)
  • Page 6 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Convert to BCD (TOD) Lead-Lag (LDLG) Motion Direct Drive Off (MDF) Convert to Integer (FRD) Low Pass Filter (LPF) Motion Direct Drive On (MDO)
  • Page 7 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Less Than or Equal to (LEQ) LIFO Load (LFL) LIFO Unload (LFU) License Validation (LV) Limit (LIM)
  • Page 8 Instruction Locator Logix5000 Controllers General Instructions Logix5000 Controllers Advanced Process Logix5000 Controllers Motion Instructions Reference Manual 1756-RM003 Control and Drives and Equipment Phase Reference Manual MOTION-RM002 and Sequence Instructions Reference Manual 1756-RM006 Sequencer Load (SQL) Sequencer Output (SQO) Sine (SIN) Square Roost (SQR/SQRT) String Concatenate (CONCAT) String Delete (DELETE)
  • Page 9: Table Of Contents

    Table of contents Preface Studio 5000 environment....................15 Additional resources ......................16 Legal Notices ........................16 Understand Instruction Timing ..................23 Immediate Type Instructions ..................23 Message Type Instructions ....................24 Process Type Instructions ....................25 Write a Motion Application Program ................27 Chapter 1 Motion State Instructions Motion State Instructions ....................
  • Page 10 Table of contents Motion Calculate Slave Values (MCSV) ............. 163 Motion Axis Position Cam (MAPC) ..............166 MAPC Flow Chart (True) ..................190 Motion Axis Time Cam (MATC) ............... 191 MATC Flow Chart (True) ..................209 Chapter 3 Motion Group Instructions ................... 211 Motion Group Instructions Motion Group Stop (MGS) ...................
  • Page 11 Table of contents Motion Run Hookup Diagnostics (MRHD) ............. 330 MRHD Flow Chart (True) ................... 343 Modify Motion Configuration Parameters ..............344 Chapter 6 Multi-Axis Coordinated Multi-Axis Coordinated Motion Instructions ............345 Master Driven Coordinated Control (MDCC) ..........354 Motion Instructions Motion Calculate Transform Position (MCTP) ..........
  • Page 12 Table of contents Chapter 8 Program a velocity profile Definition of Jerk ......................551 Choose a Profile ........................ 551 and jerk rate and tune an Velocity Profile Effects ....................553 S-Curve Profile Tune an S-Curve Profile ....................553 Chapter 9 Motion Error Codes, faults, Motion Error Codes (.ERR) ..................
  • Page 13 Table of contents Chapter 12 Common attributes for Common Attributes ......................663 Index Through Arrays ..................... 663 Motion instructions Immediate values ......................664 Floating Point Values ...................... 664 LINT data types ....................... 666 Data Types ......................... 667 Data Conversions ......................669 Math Status Flags ......................
  • Page 15: Preface

    Preface This manual provides a programmer with details about the available General, Motion, Process, and Drives instruction set for a Logix-based controller. If you design, program, or troubleshoot safety applications that use GuardLogix controllers, refer to the GuardLogix Safety Application Instruction Set Safety Reference Manual , publication 1756-RM095...
  • Page 16: Additional Resources

    Preface These documents contain additional information concerning related Rockwell Additional resources Automation products. Resource Description Industrial Automation Wiring and Grounding Guidelines Provides general guidelines for installing a Rockwell publication 1770-4.1 Automation industrial system. Product Certifications webpage, available at Provides declarations of conformity, certificates, and other http://ab.rockwellautomation.com certification details.
  • Page 17 Preface 2007-2008 Martin Doering 2007 Manuel Hartl 2007 Christoph Ludwig 2007 Patrick Sona 2010 Olivier de Gaalon 2012 Vojtech Kral 2012 Markus Wanner 2013 Joel Low All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1.
  • Page 18 Preface GNU General Public License v3.0 with GCC Runtime Library exception (v3.1), the text of which is available at https://olex-secure.openlogic.com/licenses/base_license/gpl-gcc-v3-license-base Copyright (C) 2009 Free Software Foundation, Inc. GNU Lesser General Public License v2.1, the text of which is available at http://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html .
  • Page 19 Preface Boost Software License 1.0, and BSD 3-clause (University of California Regents), the text of which is available at http://www.boost.org/LICENSE_1_0.txt The package Newlib is licensed under the following licenses: GNU General Public License v2.0 w/Autoconf exception, the text of which is available at http://spdx.org/licenses/GPL-2.0-with-autoconf-exception Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  • Page 20 Preface NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;...
  • Page 21 [i.e., this code cannot simply be copied and put under another distribution licence (including the GNU Public Licence.)] Trademark Notices Allen-Bradley, ControlBus, ControlFLASH, Compact GuardLogix, Compact I/O, ControlLogix, CompactLogix, DCM, DH+, Data Highway Plus, DriveLogix, DPI, DriveTools, Explorer, FactoryTalk, FactoryTalk Administration...
  • Page 22 Preface Performance Drive, Integrated Architecture, Kinetix, Logix5000, Logix 5000, Logix5550, MicroLogix, DeviceNet, EtherNet/IP, PLC-2, PLC-3, PLC-5, PanelBuilder, PowerFlex, PhaseManager, POINT I/O, PowerFlex, Rockwell Automation, RSBizWare, Rockwell Software, RSEmulate, Historian, RSFieldbus, RSLinx, RSLogix, RSNetWorx for DeviceNet, RSNetWorx for EtherNet/IP, RSMACC, RSView, RSView32, Rockwell Software Studio 5000 Automation Engineering &...
  • Page 23: Understand Instruction Timing

    Preface Environmental Compliance Rockwell Automation maintains current product environmental information on its website at http://www.rockwellautomation.com/rockwellautomation/about-us/sustainabili ty-ethics/product-environmental-compliance.page Contact Rockwell Customer Support Telephone — 1.440.646.3434 Online Support — http://www.rockwellautomation.com/support/ Motion instructions use three types of timing sequences: Understand Instruction Timing Description Timing Type The instruction completes in one scan.
  • Page 24: Message Type Instructions

    Preface If the controller: Then: Does not detect an error when the instruction The controller sets the .DN bit. executes The controller sets the .ER bit and stores an error Detects an error when the instruction executes code in the control structure. 3.
  • Page 25: Process Type Instructions

    Preface If the controller: Then: Does not detect an error when the The controller sets the .DN bit. instruction executes Detects an error when the instruction The controller sets the .ER bit and stores an executes error code in the control structure. 7.
  • Page 26 Preface • Sets the enable (.EN) bit. • Clears the done (.DN) bit. • Clears the error (.ER) bit. • Clears the process complete (.PC) bit. 2. The controller initiates the motion process. Then the controller: • Sets the .DN bit. The controller does not detect an error when the instruction executes •...
  • Page 27: Write A Motion Application Program

    Preface 5. When the rung becomes true, the instruction can execute again. To write a motion application program, you can insert motion instructions Write a Motion directly into the ladder diagram application program. The motion instruction set Application Program consists of five groups of motion instructions: •...
  • Page 28 Preface Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 29: Motion State Instructions

    Chapter 1 Motion State Instructions Motion State Instructions Motion state control instructions directly control or change the operating states of an axis. These are the motion state instructions. Available Instructions Ladder Diagram and Structured Text MASD MASR MAFR Function Block Not available Important: Tags used for the motion control attribute of instructions should only be used once.
  • Page 30 Chapter 1 Motion State Instructions The five operating states of a non-CIP axis are: Operating State Description Axis Ready This is the normal power-up state of the axis. In this state: • The servo module drive enable output is inactive. •...
  • Page 31 Motion State Instructions Chapter 1 Pre-Charge The drive is waiting for the DC Bus to fully charge, that is, the DC Bus Up status bit is cleared. Once the DC Bus reaches an operational voltage level, that is, DC Bus Up status bit is set, the axis transitions to the Stopped state.
  • Page 32 Chapter 1 Motion State Instructions Testing When any one of the Run Test request services is sent to the motion axis while in the Stopped state, that is, services that require an active power structure to execute, the axis immediately transitions to the Starting state, that is, the Power Structure Enabled status bit is set.
  • Page 33 Motion State Instructions Chapter 1 Faulted The faulted state is identical to the Stopped state or the Shutdown state with the exception that there are one or more faults active. Faults are latched conditions. Therefore, a Fault Reset is required to clear the faults and, assuming the original fault condition has been removed, the axis transitions to the Axis State of the drive.
  • Page 34 Chapter 1 Motion State Instructions Shutdown When a Shutdown request is issued to the drive or a Shutdown fault action is executed by the drive, the targeted axis immediately transitions to the Shutdown state. The Shutdown state has the same basic characteristics of the Stopped state except that it can be configured via the Shutdown Action attribute to drop the DC Bus power to the drive's...
  • Page 35: Motion Axis Fault Reset (Mafr)

    Motion State Instructions Chapter 1 No Device If the CIP Motion axis in the controller is created, but not currently associated with a drive, the axis state indicates the No Device state. A CIP Motion axis must be associated with a physical drive to function. This condition is checked during the controller Self-test state as qualification for transition to the Initializing state.
  • Page 36 Chapter 1 Motion State Instructions Function Block This instruction is not available in function block. Structured Text MAFR(Axis,MotionControl); Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, ControlLogix 5580, Compact and GuardLogix 5570 controllers GuardLogix 5380, and...
  • Page 37 Motion State Instructions Chapter 1 control faults. Once the appropriate fault action is taken, the MAFR instruction can be used to clear all active fault status bits. Important: The .DN bit is not set immediately. It will be set once the appropriate Motion Module or Drive has completed its required resets, which could take up to several seconds.
  • Page 38 Chapter 1 Motion State Instructions MAFR Changes to Status Bits None Examples When the input conditions are true, the controller clears all motion faults for myAxis. Ladder Diagram Structured Text MAFR(myAxis,myMotionControl); See also Common Attributes page 663 Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557...
  • Page 39: Mafr Flow Chart (True)

    Motion State Instructions Chapter 1 MAFR Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 40: Motion Axis Shutdown (Masd)

    Chapter 1 Motion State Instructions Motion Axis Shutdown (MASD) 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. Controller differences are noted where applicable. Use the Motion Axis Shutdown (MASD) instruction to force a specified axis into the Shutdown state.
  • Page 41 Motion State Instructions Chapter 1 Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, ControlLogix 5570, Compact GuardLogix 5370, 5580, Compact GuardLogix 5380, and GuardLogix 5570 controllers and GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE...
  • Page 42 Chapter 1 Motion State Instructions Another characteristic of the Shutdown state is that any instruction that initiates axis motion is blocked from execution. Attempts to do so result in an execution error. Only by executing one of the Shutdown Reset instructions can motion be successfully initiated.
  • Page 43 Motion State Instructions Chapter 1 Execution Ladder Diagram Condition/State Action Taken Prescan The .EN, .DN, and .ER are cleared to false. Rung-condition-in is false The .EN bit is cleared to false if the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 44 Chapter 1 Motion State Instructions Motion Status Bits Bit Name State Meaning AccelStatus FALSE Axis is not Accelerating. DecelStatus FALSE Axis is not Decelerating. MoveStatus FALSE Axis is not Moving. JogStatus FALSE Axis is not Jogging. GearingStatus FALSE Axis is not Gearing. HomingStatus FALSE Axis is not Homing.
  • Page 45: Masd Flow Chart (True)

    Motion State Instructions Chapter 1 MASD Flow Chart (True) Motion Axis Shutdown Reset This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MASR) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. Use the Motion Axis Shutdown (MASR) instruction to transition an axis from an existing Shutdown state to an Axis Ready state.
  • Page 46 Chapter 1 Motion State Instructions Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MASR(Axis,MotionControl); Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, ControlLogix 5580, Compact and GuardLogix 5570 controllers...
  • Page 47 Motion State Instructions Chapter 1 Description The MASR instruction clears all axis faults and takes the specified axis out of the Shutdown state. If the motion module supports an OK contact, and no other module axis is in the Shutdown state, the MASR instruction results in closure of the module’s OK solid-state relay contact.
  • Page 48 Chapter 1 Motion State Instructions Execution Ladder Diagram Condition/State Action Taken Prescan The .EN, .DN, and .ER are cleared to false. Rung-condition-in is false The .EN bit is cleared to false if the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 49 Motion State Instructions Chapter 1 Structured Text MASR(myAxis, myMotionControl); See also Motion State Instructions page 29 Common Attributes page 663 Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 MASR Flow Chart page 50 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 50: Masr Flow Chart (True)

    Chapter 1 Motion State Instructions MASR Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 51: Motion Direct Drive Off (Mdf)

    Motion State Instructions Chapter 1 Motion Direct Drive Off (MDF) This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, and ControlLogix 5580 controllers. Use the Motion Direct Drive Off (MDF) instruction to deactivate the servo drive and to set the servo output voltage to the output offset voltage.
  • Page 52 Chapter 1 Motion State Instructions MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when the axis' drive signals have been successfully disabled and the drive enable status bit is cleared.
  • Page 53 Motion State Instructions Chapter 1 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, and .ER are cleared to false. Rung-condition-in is false The .EN bit is cleared to false if the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 54 Chapter 1 Motion State Instructions Example Ladder Diagram See also MDF Flow Chart page 55 Structured Text Syntax page 635 MDF Flow Chart (True) page 55 Motion Error Codes (.ERR) page 557 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 55: Mdf Flow Chart (True)

    Motion State Instructions Chapter 1 MDF Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 56: Motion Direct Drive On (Mdo)

    Chapter 1 Motion State Instructions Motion Direct Drive On (MDO) This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, and ControlLogix 5580 controllers. Use the Motion Direct Drive On (MDO) instruction in conjunction with motion modules that support an external analog servo drive interface.
  • Page 57 Motion State Instructions Chapter 1 Operands Ladder Diagram and Structured Text Operand Type Format Description Axis AXIS_SERVO Motion Axis of data type AXIS_SERVO only. Motion Control MOTION_INSTRUCTION Structure used to access instruction status parameters. Drive Output SINT Immediate Voltage to output in % of servo Output Limit or in Volts.
  • Page 58 Chapter 1 Motion State Instructions Description For motion modules with an external servo drive interface, the MDO instruction can be used to directly enable the Drive Enable output of the axis and set the analog output to a specified level determined by the Drive Output parameter. The Drive Output parameter can be expressed as a voltage, or as a percent of the maximum configured output voltage value given by the Output Limit attribute.
  • Page 59 Motion State Instructions Chapter 1 • In relay ladder, toggle the 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. Loss of Feedback When Using an MDO Instruction If you experience a loss of feedback when issuing an MDO instruction and need to move the axis with an MDO instruction, follow these steps: 1.
  • Page 60 Chapter 1 Motion State Instructions 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.
  • Page 61 Motion State Instructions Chapter 1 Example 2 The Drive Output operand is a REAL tag and Drive Units is "Percent" Ladder Diagram Structured Text MDO(myAxis, myMotionControl, myDriveOutput_REAL, percent); See also MDO Flow Chart (True) page 62 Structured Text Syntax page 635 Common Attributes page 663 Motion Error Codes (.ERR)
  • Page 62: Mdo Flow Chart (True)

    Chapter 1 Motion State Instructions MDO Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 63: Motion Drive Start (Mds)

    Motion State Instructions Chapter 1 Motion Drive Start (MDS) 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 Drive Start (MDS) instruction to activate the drive control loops for the specified axis and run the motor at the specified speed.
  • Page 64 Chapter 1 Motion State Instructions Operands Ladder Diagram and Structured Text Operand Type Format Description Axis AXIS_CIP_DRIVE Motion Axis of data type AXIS_CIP_DRIVE only. Motion Control MOTION_INSTRUCTION Structure used to control execution of the motion instruction. Speed SINT Immediate or Tag Defines the initial speed for the DirectVelocityControlStatus Command attribute.
  • Page 65 Motion State Instructions Chapter 1 Description The MDS instruction: • Is only valid for the AXIS_CIP_DRIVE axis data type. • Performs a drive enable if the axis is not in the Running state. • Applies desired DirectVelocityControlStatus Command attribute and/or the DirectTorqueControlStatus Command attributes.
  • Page 66 Chapter 1 Motion State Instructions that require Speed-limited Adjustable Torque (SLAT) modes. SLAT operation mode provides automatic speed control under certain conditions. The SLAT Configuration is an enumerated attribute that determines how the drive controls torque for this axis instance. To support applications that require SLAT control, the Min/Max torque control enumerations provide a feature to automatically switch to and from speed control under certain conditions.
  • Page 67 Motion State Instructions Chapter 1 The DirectVelocityControlStatus bit remains set until it is made inactive via an MAS or MASR instruction, or via an axis fault. Also, when the MDS instruction is initiated without errors, the DirectTorqueControlStatus bit attribute of the MotionStatus axis attribute is set, indicating the DirectTorqueControlStatus Command attribute is active on the axis.
  • Page 68 Chapter 1 Motion State Instructions Fault Action Description Stop Drive The Stop Drive action results in the device both setting the associated bit in the Axis Faults word and bringing the axis to a stop based on the factory set "best" available stopping method. This "best" stopping method includes both the method of decelerating the motor to a stop and the final state of the axis given the expected level of control still available.
  • Page 69 Motion State Instructions Chapter 1 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, and .ER are cleared to false. Rung-condition-in is false The .EN bit is cleared to false if the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 70 Chapter 1 Motion State Instructions Examples Example 1 The Speed operand is a REAL tag and Speed Units is "Units per sec" Ladder Diagram Structured Text MDS(myAxis,myMotionControl,mySpeed_REAL,Unitspersec); Example 2 The Speed operand is a DINT tag and Speed Units is % of Maximum Ladder Diagram Structured Text MDS(myAxis,myMotionControl,mySpeed_DINT,%ofMaximum);...
  • Page 71: Motion Servo Off (Msf)

    Motion State Instructions Chapter 1 Motion Servo Off (MSF) 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. Controller differences are noted where applicable. Use the Motion Servo Off (MSF) instruction to deactivate the drive output for the specified axis and to deactivate the axis' servo loop.
  • Page 72 Chapter 1 Motion State Instructions MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when the axis’...
  • Page 73 Motion State Instructions Chapter 1 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 MSF Instruction If an MSF is issued in Master Driven Mode, the system shuts the servo off. The IP bit of the Master Driven Axis Control (MDAC) instruction does not change on an axis that has its servos turned off.
  • Page 74 Chapter 1 Motion State Instructions Extended Error Codes Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. MSF Changes to Status Bits Axis Status Bits Bit Name State Meaning ServoActionStatus FALSE Axis is in Servo Off state with the servo loop inactive.
  • Page 75 Motion State Instructions Chapter 1 Structured Text MSF(myAxis, myMotionControl); See also MSF Flow Chart page 76 Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 Motion State Instructions page 29 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 76: Msf Flow Chart (True)

    Chapter 1 Motion State Instructions MSF Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 77: Motion Servo On (Mso)

    Motion State Instructions Chapter 1 This information applies to the CompactLogix 5370, ControlLogix 5570, Motion Servo On (MSO) Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. Use the Motion Servo On (MSO) instruction to activate the drive amplifier for the specified axis and to activate the axis' servo control loop.
  • Page 78 Chapter 1 Motion State Instructions Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when the axis’...
  • Page 79 Motion State Instructions Chapter 1 Execution Ladder Diagram Condition/State Action Taken Prescan The .EN, .DN, and .ER are cleared to false. Rung-condition-in is false The .EN bit is cleared to false if the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 80 Chapter 1 Motion State Instructions Motion Status Bits None Examples Example 1 Ladder Diagram Structured Text MSO(myAxis, myMotionControl); See also MSO Flow Chart page 81 Common Attributes page 663 Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 81: Mso Flow Chart (True)

    Motion State Instructions Chapter 1 MSO Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 83: Motion Move Instructions

    Chapter 2 Motion Move Instructions Motion Move Instructions Use the Motion Move instructions to control axis position. Available Instructions Ladder Diagram and Structured Text MCCP MCSV MAPC MATC MDAC Function Block Not available 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.
  • Page 84: Motion Axis Stop (Mas)

    Chapter 2 Motion Move Instructions See also Motion Configuration Instructions page 305 Motion State Instructions page 29 Multi-Axis Coordinated Motion Instructions page 345 Motion Event Instructions page 235 Motion Group Instructions page 211 Motion Axis Stop (MAS) 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.
  • Page 85 Motion Move Instructions Chapter 2 Operands Ladder Diagram Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE Name of the axis.
  • Page 86 Chapter 2 Motion Move Instructions Change Decel DINT Immediate If you want to Then Choose Use the Maximum No = 0 Deceleration rate of the axis. Specify the Yes = 1 deceleration rate. Decel Rate REAL Immediate or Important: The axis could overshoot its target position if you reduce the deceleration while a move is in process.
  • Page 87 Motion Move Instructions Chapter 2 Structured Text This Operand Has These Options Which You Enter as Text Or Enter as a Number Stop Type move gear home tune test timecam positioncam masteroffsetmove directcontrol Change Decel Decel Units Units per sec %ofmaximum Change Decel Jerk Decel Jerk...
  • Page 88 Chapter 2 Motion Move Instructions MOTION_INSTRUCTION Structure To See If Check To See If This Data Type Notes Bit Is Set To A false-to-true transition caused the BOOL The EN bit stays set until the process is complete and instruction to execute. the rung goes false.
  • Page 89 Motion Move Instructions Chapter 2 Example Suppose you use a Motion Axis Jog (MAJ) instruction with an S-curve profile to start a jog. Then you use an MAS instruction with a Stop Type of Jog to stop the jog. In that case, the MAS instruction uses an S-curve profile to stop the jog. Programming Guidelines Risk of Velocity and/or End Position Overshoot If you change move parameters dynamically by any method, that is by changing move dynamics [Motion Change Dynamics...
  • Page 90 Chapter 2 Motion Move Instructions Choose whether to stop all motion or only a If You Want to Stop Then Choose This Stop Type specific type of motion. All motion in process for this axis. The instruction uses a trapezoidal profile and stops the axis.
  • Page 91 Motion Move Instructions Chapter 2 Stop Type for MAS The behavior of the MAS instruction depends on the Stop Type parameter: • Time CAM, stop type moves, and jogs - When you invoke an MAS with Stop Type = Time Cam on an axis that is running in Master Driven Mode, the axis terminates Master Driven Mode, changes to Time Driven Mode, and stops as specified.
  • Page 92 Chapter 2 Motion Move Instructions 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 the .DN or .ER bit is true.
  • Page 93: Motion Axis Home (Mah)

    Motion Move Instructions Chapter 2 MAS Changes to Single Axis Status Bits Motion Status Bits If the Stop Type Is Then NOT All The instruction clears the Motion Status bit for the motion process that you stopped. The instruction clears all Motion Status bits. Bit Name State Meaning...
  • Page 94 Chapter 2 Motion Move Instructions Available Languages Ladder Diagram Function Block This instruction is not available in function block Structured Text MAH(Axis,MotionControl); Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, and ControlLogix 5580, GuardLogix 5570 controllers...
  • Page 95 Motion Move Instructions Chapter 2 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when axis home has been successfully completed or is aborted.
  • Page 96 Chapter 2 Motion Move Instructions Active Homing When the axis Homing Mode is configured as Active, the physical axis is first activated for servo operation. As part of this process, all other motion in process is canceled and appropriate status bits are cleared. The axis is then homed using the configured Home Sequence, which may be Immediate, Switch, Marker, or Switch-Marker.
  • Page 97 Motion Move Instructions Chapter 2 Master Driven Speed Control (MDSC) and the MAH Instruction When either an MDAC or MDCC is active: • If a MAH is executed (goes IP) on a Master axis and the Master axis is not moving, the MDAC or MDCC remains active.
  • Page 98 Chapter 2 Motion Move Instructions Error Codes See Motion 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.
  • Page 99 Motion Move Instructions Chapter 2 Status Bits MAH Changes to Single Axis Status Bits Bit Name State Meaning HomingStatus TRUE Axis is Homing. JogStatus FALSE Axis is no longer Jogging.* MoveStatus FALSE Axis is no longer Moving.* GearingStatus FALSE Axis is no longer Gearing. StoppingStatus FALSE Axis is no loner Stopping.
  • Page 100: Mah Flow Chart (True)

    Chapter 2 Motion Move Instructions MAH Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 101: Motion Axis Jog (Maj)

    Motion Move Instructions Chapter 2 Motion Axis Jog (MAJ) 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. Controller differences are noted where applicable. Use the Motion Axis Jog (MAJ) instruction to move an axis at a constant speed until you tell it to stop.
  • Page 102 Chapter 2 Motion Move Instructions Operands Operand Type Type Format Description (ControlLogix 5580 (CompactLogix 5370, controllers) ControlLogix 5570 controllers) Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE Name of the axis to jog. AXIS_VIRTUAL AXIS_VIRTUAL AXIS_GENERIC AXIS_GENERIC_DRIVE AXIS_SERVO AXIS_SERVO_DRIVE Motion Control MOTION_INSTRUCTION MOTION_INSTRUCTION Control tag for the instruction. Direction DINT DINT...
  • Page 103 Motion Move Instructions Chapter 2 Accel Jerk REAL REAL Immediate or Tag You must always enter values for the Accel and Decel Jerk Decel Jerk REAL REAL Immediate or Tag operands. This instruction only Jerk Units DINT DINT Immediate uses the values if the Profile is configured as S-curve.
  • Page 104 Chapter 2 Motion Move Instructions Structured Text This Operand Has These Options Which You Enter as Text Or Enter as a Number Axis No enumeration MotionControl No enumeration Direction No enumeration Immediate or Tag Speed No enumeration Immediate or Tag SpeedUnits units per sec % of maximum...
  • Page 105 Motion Move Instructions Chapter 2 MOTION_INSTRUCTION Structure To See If Check To See If This Bit Is Data Type Notes Set To A false-to-true transition caused the instruction BOOL The EN bit stays set until the process is complete to execute. and the rung goes false.
  • Page 106 Chapter 2 Motion Move Instructions Guidelines Details In ladder diagram, toggle the rung This is a transitional instruction: condition each time you want to In ladder diagram, toggle the rung-condition-in from cleared to set each time you want to execute the execute the instruction.
  • Page 107 Motion Move Instructions Chapter 2 Structure See Input and Output Parameters Structure for Single Axis Motion Instructions for the input and output parameters that are available for the MAJ instruction via the Master Driven Speed Control (MDSC) function. Before any of these parameters is active, you must execute an MDAC instruction and it must be active (IP bit is set).
  • Page 108 Chapter 2 Motion Move Instructions Extended Error Codes Use Extended Error Codes (EXERR) for more instruction about an error. If ERR is And EXERR is Then Cause Corrective Action Varies An operand is outside its range. The EXERR is the number of the operand that is out of range.
  • Page 109 Motion Move Instructions Chapter 2 MAJ Changes to Instruction Status Bits Bit Name Meaning MotionStatus The motion status bit for your axis. Meaning Number AccelStatus The axis is not accelerating (FALSE state). DecelStatus The axis is not decelerating (FALSE state). MoveStatus The axis is not moving (FALSE state).
  • Page 110 Chapter 2 Motion Move Instructions MaximumSpeedExceeded Sets when the maximum axis speed that is specified in the axis configuration is exceeded during a move (TRUE state). Clears when the velocity is reduced below the limit (FALSE state). MAJ Changes to Single Axis Status Bits If Merge Is Then the Instruction Changes These Bits Bit Name...
  • Page 111 Motion Move Instructions Chapter 2 Examples Ladder Diagram See also Troubleshoot Axis Motion page 608 Structured Text Syntax page 635 Status Bits for Motion Instructions (MAM,MATC,MAJ) When MDAC Is Active page 550 Motion Error Codes (.ERR) page 557 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 112: Motion Axis Move (Mam)

    Chapter 2 Motion Move Instructions This information applies to the CompactLogix 5370, ControlLogix 5570, Motion Axis Move (MAM) Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. Use the Motion Axis Move (MAM) instruction to move an axis to a specified position.
  • Page 113 Motion Move Instructions Chapter 2 Structured Text MAM(Axis, MotionControl, MoveType, Position, Speed, SpeedUnits, AccelRate, AccelUnits, DecelRate, DecelUnits, Profile, AccelJerk, DecelJerk, JerkUnits, Merge, MergeSpeed, LockPosition, LockDirection, EventDistance, CalculatedData); Operands Ladder Diagram Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, GuardLogix 5370, and...
  • Page 114 Chapter 2 Motion Move Instructions Move type DINT DINT Immediate or Use This Move And Enter Type Move an axis to an Absolute absolute position Move an axis a specified Incremental distance from where it is Move a Rotary axis to an Rotary Shortest absolute position in the Path...
  • Page 115 Motion Move Instructions Chapter 2 Accel Rate REAL REAL Immediate or Acceleration rate of the axis in Accel Units Accel Units DINT DINT Immediate Which units do you want to use for the Accel Rate? Units per sec % of Maximum (1) Time (3) Units per MasterUnit Master Units (7)
  • Page 116 Chapter 2 Motion Move Instructions Lock Direction UINT32 UINT32 Immediate Specifies the conditions when the Lock Position should be used. Valid Values = 0-4 Default = None (Enumeration 1-4 are currently not allowed in Time Driven or Time Based modes.) See the Structure section below for more information.
  • Page 117 Motion Move Instructions Chapter 2 None immediateforwardonly Lock Direction immediatereverseonly positionforward positionreverse Event Distance No enumeration Array or 0 Calculated Data No enumeration Array or 0 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...
  • Page 118 Chapter 2 Motion Move Instructions Trapezoidal Move Starting from Standstill Programming Guidelines Risk of Velocity and/or End Position Overshoot If you change move parameters dynamically by any method, that is by changing move dynamics [Motion Change Dynamics (MCD)] instruction or by starting a new instruction before the last one has completed, be aware of the risk of velocity and/or end position overshoot.
  • Page 119 Motion Move Instructions Chapter 2 Use Merge to cancel the motion of other instructions How you want to handle any motion that’s already in process? If you want to And you want to Then set Add the move to any motion Merge = Disabled already in process Merge Speed =...
  • Page 120 Chapter 2 Motion Move Instructions Choose a Move Type for a Rotary Axis Move Type Example Description Absolute Absolute move to 225°. The direction depends on the With an Absolute move, the direction of travel depends on starting position of the axis. the current position of the axis and is not necessarily the shortest path to the end position.
  • Page 121 Motion Move Instructions Chapter 2 Rotary Negative Rotary Negative move from 45° to 225°. Important: Only use a Rotary Shortest Path move if • The Positioning Mode of the axis is Rotary (Rotary axis). • The axis is standing still and not moving. Otherwise the axis could move in the wrong direction.
  • Page 122 Chapter 2 Motion Move Instructions 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 Error Codes (.ERR) for Motion Instructions.
  • Page 123 Motion Move Instructions Chapter 2 Changes to Status Bits Motion Instruction Predefined Data Type Status Bits See Status Bits for Motion Instructions (MAM, MATC, MAJ) When MDAC Is Active. MAM Changes to Single Axis Status Bits Bit Name Meaning MotionStatus The motion status bit for your axis.
  • Page 124 Chapter 2 Motion Move Instructions MoveLockStatus MAM is Locked to Master in MDSC Mode (TRUE state). The bit is cleared when a MGS, MGSD, MAS, or MASD is executed (goes IP). If either the Slave or Master axis (or both) is paused by changing its speed to 0, then the MoveLockStatus bit stays set.
  • Page 125: Motion Axis Gear (Mag)

    Motion Move Instructions Chapter 2 Master Driven Speed Control (MDSC) Merging and Replacement Mode for When programmed in units of seconds, the MAM instruction must start at rest (that is, both start velocity and acceleration must be equal to 0.0). If programmed in units of seconds or Master Units, a runtime error will occur for the MAM on the Slave if the instruction is activated when not at rest.
  • Page 126 Chapter 2 Motion Move Instructions example, 1.345) or Slave Counts to Master Counts (for example, 1:3). The MAG instruction supports specification of the gear ratio in one of two different formats, Real or Fractional, as determined by the Ratio Format input selection. The direction of Slave Axis motion relative to the Master Axis is defined by a very flexible Direction input parameter.
  • Page 127 Motion Move Instructions Chapter 2 Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Slave Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE...
  • Page 128 Chapter 2 Motion Move Instructions Ratio Format BOOLEAN BOOLEAN Immediate The desired ratio specification format. Select either: 0 = real gear ratio 1 = integer fraction of slave encoder counts to master encoder counts. Clutch BOOLEAN BOOLEAN Immediate When Clutch is enabled, motion control ramps the slave axis up to gearing speed at the instruction’s defined Acceleration value.
  • Page 129 Motion Move Instructions Chapter 2 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when axis gear has been successfully initiated.
  • Page 130 Chapter 2 Motion Move Instructions Actual position is the current position of a physical axis as measured by the axis encoder. This is the only valid selection when the master axis’ Axis Type is configured as Feedback Only. Slave to the Command Position When Command Position is entered or selected as the Master Reference source, the slave axis motion is generated from the command position of the master axis as shown below.
  • Page 131 Motion Move Instructions Chapter 2 Gear in the Same Direction When Same is selected or entered as the Direction, the slave axis moves in its positive direction at the specified gear ratio when the master axis moves in its positive direction and vice-versa. Gear in the Opposite Direction When Opposite is selected or entered as the Direction, the slave axis moves in its negative direction at the specified gear ratio when the master axis moves in its...
  • Page 132 Chapter 2 Motion Move Instructions Specifying the gear ratio as a fraction allows the direct implementation of irrational gear ratios (such as 1/3) with no accumulated positioning errors or round off. Since the master and slave count values do not use the axis conversion constants and because they are integers, the actual gear ratio relationship between the slave and master axes exactly match the specified ratio.
  • Page 133 Motion Move Instructions Chapter 2 This clutch function works much like the clutch in a car, allowing the slave axis to be smoothly engaged to the master axis as shown below. Clutch Function Using the clutch feature avoids the uncontrolled acceleration or deceleration that results when electronic gearing is enabled while the master axis is moving.
  • Page 134 Chapter 2 Motion Move Instructions Changing Master Axes The master axis for electronic gearing can be changed at any time, even while gearing is currently enabled. However, since it is possible to have electronic gearing enabled on more than one axis at a time, if a Servo master axis and slave axis are reversed, the axes become cross-coupled and unexpected motion may result.
  • Page 135 Motion Move Instructions Chapter 2 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.
  • Page 136 Chapter 2 Motion Move Instructions Example 2 This example increases the number of operands that require data conversion. See also Structured Text Syntax page 635 MAG Flow Chart (True) page 137 Motion Error Codes (.ERR) page 557 Motion Move Instructions page 83 Common Attributes page 663...
  • Page 137: Mag Flow Chart (True)

    Motion Move Instructions Chapter 2 MAG Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 138: Motion Change Dynamics (Mcd)

    Chapter 2 Motion Move Instructions Motion Change Dynamics (MCD) 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. Controller differences are noted where applicable. Use the Motion Change Dynamics (MCD) instruction to selectively change the speed, acceleration rate, or deceleration rate of a move profile or a jog profile in process.
  • Page 139 Motion Move Instructions Chapter 2 Operands There are data conversion rules for mixed data types within an instruction. See Data Conversion. Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix CompactLogix 5370, ControlLogix 5480, ControlLogix 5580, Compact 5570, Compact GuardLogix 5370, GuardLogix 5380, and GuardLogix and GuardLogix 5570 controllers...
  • Page 140 Chapter 2 Motion Move Instructions Accel Jerk SINT, INT, DINT, or REAL SINT, INT, DINT, or REAL Immediate or You must always enter a value for the Accel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve. Accel Jerk is the acceleration jerk rate for the axis.
  • Page 141 Motion Move Instructions Chapter 2 This Operand Has These Options Which You Enter as Text Or Enter as a Number Axis No enumeration MotionControl No enumeration MotionType move ChangeSpeed Speed No enumeration Immediate or Tag ChangeAccel AccelRate No enumeration Immediate or Tag ChageDecel DecelRate No enumeration...
  • Page 142 Chapter 2 Motion Move Instructions MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when axis change dynamics has been successfully initiated.
  • Page 143 Motion Move Instructions Chapter 2 Pausing Moves The MCD instruction may be used to temporarily pause a move in progress by changing its speed to zero. Use another MCD instruction with a non-zero speed value to complete the move as originally specified. Changing Jog Dynamics When a Motion type of Jog is entered or chosen, the speed, acceleration, and/or deceleration of a Jog in progress may be changed to the specified value.
  • Page 144 Chapter 2 Motion Move Instructions 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.
  • Page 145 Motion Move Instructions Chapter 2 offending axis to access the Axis Properties screen. Go to the Dynamics tab and make the appropriate change to the Maximum Deceleration Value. If the Extended Error number is -1, this means the Coordinate System has a Maximum Deceleration Value of 0.
  • Page 146 Chapter 2 Motion Move Instructions Examples Example 1 Ladder Diagram Structured Text MCD(Axis1,MCD_1,Move,Yes,75,Yes,50,No,0,No,0,No,0,%ofMaximum,%ofM aximum,%ofMaximum,%ofMaximum); Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 147 Motion Move Instructions Chapter 2 Example 2 Ladder Diagram Structured Text MCD(Axis1,mcd_motion_ctrl,Move,Yes,2,Yes,1,No,100,Yes,100.0,Yes,100.0,%o fMaximum,%ofMaximum,%ofMaximum,%ofTime); See also Structured Text Syntax page 635 MCD Flow Chart (True) page 148 Motion Error Codes (.ERR) page 557 Motion Move Instructions page 83 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 148: Mcd Flow Chart (True)

    Chapter 2 Motion Move Instructions MCD Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 149: Motion Redefine Position (Mrp)

    Motion Move Instructions Chapter 2 Motion Redefine Position (MRP) 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. Controller differences are noted where applicable. Use the Motion Redefine Position (MRP) instruction to change the command or actual position of an axis.
  • Page 150 Chapter 2 Motion Move Instructions Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, ControlLogix 5580, Compact Compact GuardLogix 5370, GuardLogix 5380, and and GuardLogix 5570 GuardLogix 5580 controllers controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE...
  • Page 151 Motion Move Instructions Chapter 2 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when the axis' position action has been successfully redefined.
  • Page 152 Chapter 2 Motion Move Instructions Actual Position When Actual is selected or entered as the MRP Position Selection, the New Position is directly applied to the actual position of the physical axis. The command position of the axis is also adjusted along with the new actual position to preserve any position error which exists.
  • Page 153 Motion Move Instructions Chapter 2 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 the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 154 Chapter 2 Motion Move Instructions 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.
  • Page 155: Mrp Flow Chart (True)

    Motion Move Instructions Chapter 2 MRP Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 156: Motion Calculate Cam Profile (Mccp)

    Chapter 2 Motion Move Instructions Motion Calculate Cam This information applies to the CompactLogix 5370, ControlLogix 5570, Profile (MCCP) Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. The Motion Calculate Cam Profile (MCCP) instruction calculates a cam profile based on an array of cam points.
  • Page 157 Motion Move Instructions Chapter 2 Ladder Diagram Operand Type Format Description Motion Control MOTION_INSTRUCTION Structure used to access block status parameters. 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.
  • Page 158 Chapter 2 Motion Move Instructions 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...
  • Page 159 Motion Move Instructions Chapter 2 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.
  • Page 160 Chapter 2 Motion Move Instructions profile element’s Status value to being calculated, or 1, and then sets the Status value of all other cam profile elements to being calculated. As the calculation proceeds, individual cam profile members’ Status values are set to calculated, or 2. When all elements in the cam profile array have been calculated, the first cam profile element’s Status value is also set to calculated.
  • Page 161 Motion Move Instructions Chapter 2 Affects Math Status Flags 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.
  • Page 162 Chapter 2 Motion Move Instructions Examples Example 1 Ladder Diagram Structured Text MCCP(MCCP_1,Cam_1[0],30,1.0,1.0,Cam_pro1[0]); Example 2 Ladder Diagram Structured Text MCCP(mccp_motion_ctrl,cam[0],2,2,10,cam_profile[0]); See also Motion Move Instructions page 83 Structured Text Syntax page 635 Common Attributes page 663 Motion Error Codes (.ERR) page 557 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 163: Motion Calculate Slave Values (Mcsv)

    Motion Move Instructions Chapter 2 Motion Calculate Slave Values This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MCSV) 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 master value.
  • Page 164 Chapter 2 Motion Move Instructions Ladder Diagram and Structured Text Operand Type Format Description Motion Control MOTION_INSTRUCTION Structure used to access block status parameters. Cam Profile CAM_PROFILE Array Tag An array of elements with the array index set to 0. It defines the cam profile used in calculating the slave values.
  • Page 165 Motion Move Instructions Chapter 2 Affects Math Status Flags 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.
  • Page 166: Motion Axis Position Cam (Mapc)

    Chapter 2 Motion Move Instructions Example See also Motion Error Codes (.ERR) page 557 Structured Text Syntax page 635 Common Attributes page 663 Multi-Axis Coordinated Motion Instructions page 345 Data Conversions page 669 Motion Axis Position Cam This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MAPC) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix...
  • Page 167 Motion Move Instructions Chapter 2 The cam profile can also be configured via the Execution Schedule parameter to execute Immediately or Pending completion of a currently executing position cam profile. The cam profile can also be executed Once or Continuously by specifying the desired Execution Mode.
  • Page 168 Chapter 2 Motion Move Instructions Operands Ladder Diagram and Structured Text Type Type CompactLogix 5380, CompactLogix CompactLogix 5370, Operand Format Description 5480, ControlLogix 5580, Compact ControlLogix 5570, Compact GuardLogix 5380, and GuardLogix 5580 GuardLogix 5370, and controllers GuardLogix 5570 controllers AXIS_CIP_DRIVE AXIS_VIRTUAL The name of the axis that the cam profile is...
  • Page 169 Motion Move Instructions Chapter 2 Master Immediate Scales the total distance covered by the master REAL REAL Scaling or Tag axis through the cam profile. Determines if the cam profile is executed only one time or repeatedly: 0 = Once – cam motion of slave axis starts only when the master axis moves into the range defined by the start and end points of the cam profile.
  • Page 170 Chapter 2 Motion Move Instructions When the Master Offset = 0.0, the Master Lock Position is the Master axis absolute position where the slave axis locks to the master axis. If the Master Offset is X, then the Slave axis will lock to the Master axis at the absolute master position value of Master Lock Position –X.
  • Page 171 Motion Move Instructions Chapter 2 ExecutionSchedule immediate pending forwardonly reverseonly bidirectional MasterReference actual command MasterDirection bidirectional forwardonly reverseonly MOTION_INSTRUCTION Structure Mnemonic Description It is set when the rung makes a false-to-true transition and remains set until .EN (Enable) Bit 31 the rung goes false.
  • Page 172 Chapter 2 Motion Move Instructions Position in the direction specified by the Execution Schedule parameter, the slave axis is locked to the master axis position according to the specified Cam Profile beginning at the Cam Lock Position. Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 173 Motion Move Instructions Chapter 2 The cam profile can also be configured to execute Immediately or Pending completion of a currently executing position cam profile via the Execution Schedule parameter. The cam profile can be executed: • once • continuous •...
  • Page 174 Chapter 2 Motion Move Instructions Preserving the Current Camming Direction When Unchanged is selected or entered as the Direction, other position cam parameters may be changed while preserving the current or previous camming direction (same or opposite). This is useful when the current direction is not known or not important.
  • Page 175 Motion Move Instructions Chapter 2 This first cam profile element Status member can have the following values. Status Variables Description Cam profile element has not been calculated. Cam profile element is being calculated. Cam profile element has been calculated Cam profile element has been calculated and is currently being used by (n-2) MAPC or MATC instructions.
  • Page 176 Chapter 2 Motion Move Instructions When a cam profile array is specified by an MAPC instruction, the master and slave values defined by the cam profile array take on the position units of the master and slave axes respectively. By contrast, the Master and Slave Scaling parameters are unitless values that are simply used as multipliers to the cam profile.
  • Page 177 Motion Move Instructions Chapter 2 When Continuous mode is selected, the specified cam profile, once started, is executed indefinitely. With continuous operation, the profile’s master and slave positions are unwound when the position of the master axis moves outside the profile range, causing the cam profile to repeat.
  • Page 178 Chapter 2 Motion Move Instructions Typically, the Cam Lock Position is set to the beginning of the cam profile as shown in the above illustration. Since the starting point of most cam tables is 0, the Cam Lock Position is typically set to 0. Alternatively, the Cam Lock Position can be set to any position within the master range of the cam profile.
  • Page 179 Motion Move Instructions Chapter 2 Important: If the position reference of the master axis is redefined (for example an MRP instruction) after the MAPC instruction executes but before the lock condition is satisfied, the cam profile generator monitors the master axis based on the absolute position reference system in effect prior to the redefine position operation.
  • Page 180 Chapter 2 Motion Move Instructions Pending Cam Execution Alternatively, the MAPC instruction’s execution can be deferred pending completion of a currently executing position cam. An Execution Schedule selection of Pending can thus be used to seamlessly blend two position cam profiles together without stopping motion.
  • Page 181 Motion Move Instructions Chapter 2 cleared. The motion controller keeps track of the master axis and slave axis positions relative to the first profile at the time of the change and uses this information to maintain synchronization between the profiles. If the Execution Schedule of an MAPC instruction is set to Immediate and a position cam profile is currently in process, the MAPC instruction errs.
  • Page 182 Chapter 2 Motion Move Instructions Slaving to the Actual Position When Actual Position is entered or selected as the Master Reference source, the slave axis motion is generated from the actual position of the master axis as shown below. Actual position is the current position of the master axis as measured by its encoder or other feedback device.
  • Page 183 Motion Move Instructions Chapter 2 the cam motion generator from moving backward through the cam profile if the master reverses direction. When the master axis again reverses, resuming motion in the desired direction, the slave axis picks up again when the master reaches the position where it initially reversed.
  • Page 184 Chapter 2 Motion Move Instructions master reference position shift, the MAM instruction must be initiated after the MAPC is initiated. See the Motion Axis Move (MAM) instruction for more information on Master Offset moves. Stopping a Cam Like other motion generators (jog, move, gear) active cams must be stopped by the various stop instructions, such as the Motion Axis Stop (MAS) or the Motion Group Stop (MGS).
  • Page 185 Motion Move Instructions Chapter 2 Important: The MAPC instruction execution completes in a single scan, thus the Done (.DN) bit and the In Process (.IP) bit are set immediately. The In Process (.IP) bit remains set until the initiated PCAM process completes, is superseded by another MAPC instruction, terminated by a Motion Axis Stop command, Merge operation, or Servo Fault Action.
  • Page 186 Chapter 2 Motion Move Instructions 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.
  • Page 187 Motion Move Instructions Chapter 2 Status Bits MAPC Changes to Status Bits If the Execution Schedule is set to Immediate, execution of the MAPC instruction simply sets both the Position Cam Status and the Position Cam Lock Status bits to True. Bit Name State Meaning...
  • Page 188 Chapter 2 Motion Move Instructions Once the MAPC is executing, the state of Position Cam Lock Status is determined by the setting of MasterDirection, and the direction the Master Axis is moving. Bit Name State Meaning Position Cam Status TRUE Position Camming is Enabled.
  • Page 189 Motion Move Instructions Chapter 2 Structured Text MAPC (Axis0, Axis1, MAPC_1,1, Cam_pro1[0], 1.0,1.0, Once, immediate, Mlckpos, Clckpos, Actual, Forwardonly); See also Structured Text Syntax page 635 MAPC Flow Chart (True) page 190 Motion Error Codes (.ERR) page 557 Motion Move Instructions page 83 Common Attributes page 663...
  • Page 190: Mapc Flow Chart (True)

    Chapter 2 Motion Move Instructions MAPC Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 191: Motion Axis Time Cam (Matc)

    Motion Move Instructions Chapter 2 This information applies to the CompactLogix 5370, ControlLogix 5570, Motion Axis Time Cam Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MATC) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. The Motion Axis Time Cam (MATC) instruction provides electronic camming of an axis as a function of time, according to the specified Cam Profile.
  • Page 192 Chapter 2 Motion Move Instructions Function Block This instruction is not available in function block. Structured Text MATC(Axis, MotionControl, Direction, CamProfile, DistanceScaling, TimeScaling, ExecutionMode, ExecutionSchedule, LockPosition, LockDirection, InstructionMode); Operands Ladder Diagram Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, and ControlLogix 5580,...
  • Page 193 Motion Move Instructions Chapter 2 Cam Profile CAM_PROFILE CAM_PROFILE Array Tag name of the calculated cam profile array. Only the zero array element ([0]) is allowed for the Cam Profile array. Ellipsis launches Cam Profile Editor. Distance Scaling REAL REAL Immediate or Scales the total distance covered by the axis through the cam profile.
  • Page 194 Chapter 2 Motion Move Instructions Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, ControlLogix 5580, and GuardLogix 5570 controllers Compact GuardLogix 5380, and GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE The name of the axis to which the cam profile is applied.
  • Page 195 Motion Move Instructions Chapter 2 Execution Mode UINT32 UINT32 Immediate Determines how the cam motion behaves when the time moves beyond the end point of the cam profile. The options are: 0 = Once – When the time cam execution time exceeds the time range in the cam profile, the MATC instruction completes, the axis motion stops, and the Time Cam...
  • Page 196 Chapter 2 Motion Move Instructions For the operands that require you to select from available options, enter your selection as: This Operand Has These Options Which You Enter as Text Or Enter as a Number ExecutionMode once continuous ExecutionSchedule immediate pending Lock Position No enumeration...
  • Page 197 Motion Move Instructions Chapter 2 Camming Direction Cams can be configured to add or subtract their incremental contribution to the axis command position. Control over this behavior is via the Direction parameter. Camming in the Same Direction When Same is selected or entered as the Direction for the MATC instruction, the axis position values calculated from the cam profile are added to the command position of the axis.
  • Page 198 Chapter 2 Motion Move Instructions Specifying the Cam Profile To execute a MATC instruction, a calculated Cam Profile data array tag must be specified. Cam Profile array tags may be created by the Logix Designer tag editor or the MATC instruction using the built-in Cam Profile Editor, or by executing an Motion Calculate Cam Profile (MCCP) instruction on an existing Cam array.
  • Page 199 Motion Move Instructions Chapter 2 Before starting a cam on a specified axis, the MATC instructions checks if the cam profile array has been calculated by checking the value of the first cam profile element’s Status member. If Status is 0 or 1 then the cam profile has not been calculated yet and the MATC instruction errors.
  • Page 200 Chapter 2 Motion Move Instructions When a cam profile array is specified by an MATC instruction, the master coordinate values defined by the cam profile array take on the time units (seconds) and the slave values take on the units of the slave axis. By contrast, the Time and Distance Scaling parameters are unitless values that are simply used as multipliers to the cam profile.
  • Page 201 Motion Move Instructions Chapter 2 Execution Schedule Control over the MATC instruction’s execution schedule is via the Execution Schedule parameter. Note that for the Master Driven Speed Control (MDSC) function, the Execution Schedule equal pending is used in both Master Driven Mode and Time Driven Mode.
  • Page 202 Chapter 2 Motion Move Instructions is typically executed continuously. To stop the axis, the operating profile can be smoothly blended into a deceleration profile such that the axis stops at a known location as shown below. By executing the time cam profile as a Pending cam profile while the current profile is still executing, the appropriate cam profile parameters are set up ahead of time.
  • Page 203 Motion Move Instructions Chapter 2 the initial cam. This method addresses cases where immediate cams would finish before the pending cam could be reliably loaded. After a Pending time cam has been configured, the Time Cam Pending Status bit of the Motion Status word for the specified axis is set to 1 (true). When the pending (new) profile is initiated and becomes the current profile, Time Cam Pending Status bit is immediately cleared as shown below.
  • Page 204 Chapter 2 Motion Move Instructions Stopping a CAM Like other motion generators (for example, jog, move, gear) active cams must be stopped by the various stop instructions, MAS, or MGS. CAM motion must also stop when the ControlLogix processor changes OS modes. The MAS instruction, in particular, must be able to specifically stop the camming process.
  • Page 205 Motion Move Instructions Chapter 2 Affects Math Status Flags 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.
  • Page 206 Chapter 2 Motion Move Instructions Changes to Status Bits Motion Instruction Predefined Data Type Status Bits See Status Bits for Motion Instructions (MAM, MATC, MAJ) When MDAC Is Active. MATC Changes to Single Axis Status Bits Bit Name Meaning The motion status bit for your axis. MotionStatus Bit Number Meaning...
  • Page 207 Motion Move Instructions Chapter 2 Sets when the MDAC instruction executes (TRUE state). Clears when CoordinatedMotionStatus the instruction completes (FALSE state). TransformStateStatus The axis is part of an active transform (TRUE state). ControlledByTransformStatus The axis is moving because of a transform (TRUE state). DirectVelocityControlStatus The axis is not under Direct Velocity Control (FALSE state).
  • Page 208 Chapter 2 Motion Move Instructions Example Ladder Diagram Structured Text MATC(Axis1,matc_motion_ctrl,1,cam_profile[0],2,2,Once,Immediate,0,None, TimeDrivenMode); See also Structured Text Syntax page 635 MATC Flow Chart (True) page 209 Motion Error Codes (.ERR) page 557 Motion Move Instructions page 83 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 209: Matc Flow Chart (True)

    Motion Move Instructions Chapter 2 MATC Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 211: Motion Group Instructions

    Chapter 3 Motion Group Instructions Motion Group Group instructions include all motion instructions that operate on all the axes in the specified group. Instructions that are applied to groups include position strobe, Instructions shutdown control, and stopping instructions. Only one group is supported for each Logix controller.
  • Page 212: Motion Group Stop (Mgs)

    Chapter 3 Motion Group Instructions See also Motion Configuration Instructions page 305 Motion Move Instructions page 83 Motion State Instructions page 29 Multi-Axis Coordinated Motion Instructions page 345 Motion Event Instructions page 235 Motion Group Stop (MGS) 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.
  • Page 213 Motion Group Instructions Chapter 3 Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MGS(Group,MotionControl, StopMode); Operands Ladder Diagram and Structured Text Operand Type Format Description Group MOTION_GROUP Name of the group of axes to perform operation on Motion Control MOTION_INSTRUCTION Structure used to access instruction status parameters.
  • Page 214 Chapter 3 Motion Group Instructions MOTION_INSTRUCTION Structure Mnemonic Description .DN (Done) Bit 29 It is set when the group Programmed Stop has been successfully initiated for all axes in the group. .ER (Error) Bit 28 It is set to indicate that the instruction detected an error, such as if you specified an unconfigured group.
  • Page 215 Motion Group Instructions Chapter 3 Each axis may be configured to use any of these five stop modes. The following is a description of the effect of each these five stopping modes as they apply to an individual axis in the specified group. Mode Description Fast Stop...
  • Page 216 Chapter 3 Motion Group Instructions In addition to the ways the various stopping modes affect the Motion Drive Start (MDS) instruction were described in the previous table, all these modes also clear the MDS In Process (.IP) bit and clear the DirectVelocityControlStatus bit in the Motion Status attribute.
  • Page 217 Motion Group Instructions Chapter 3 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. Status Bits MGS Changes to Single Axis Status Bits If the Stop Type is...
  • Page 218 Chapter 3 Motion Group Instructions Ladder Diagram Structured Text MGS(Motion,MGG_1,Programmed); See also Motion Drive Start (MDS) page 63 MGS Flow Chart (True) page 219 Motion Error Codes (.ERR) page 557 Motion Group Instructions page 211 Common Attributes page 663 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 219: Mgs Flow Chart (True)

    Motion Group Instructions Chapter 3 MGS Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 220: Motion Group Shutdown (Mgsd)

    Chapter 3 Motion Group Instructions Motion Group Shutdown This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MGSD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Use the Motion Group Shutdown (MGSD) instruction to force all axes in the designated group into a Shutdown state.
  • Page 221 Motion Group Instructions Chapter 3 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 The enable bit indicates when the instruction is enabled. It remains set until servo messaging completes and Rung-condition-in goes false. .DN (Done) Bit 29 The done bit indicates when the instruction sets the group of axes to the shutdown operating state. .ER (Error) Bit 28 The error bit indicates when the instruction detects an error, such as if messaging to the servo module failed.
  • Page 222 Chapter 3 Motion Group Instructions 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.
  • Page 223 Motion Group Instructions Chapter 3 Error Codes See Motion 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.
  • Page 224 Chapter 3 Motion Group Instructions Ladder Diagram Structured Text MGSD(Motion,MGSD_2); See also Motion Drive Start (MDS) page 63 Motion Drive Start (MDS) page 63 Structured Text Syntax page 635 Common Attributes page 663 Motion Error Codes (.ERR) page 557 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 225: Mgsd Flow Chart (True)

    Motion Group Instructions Chapter 3 MGSD Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 226: Motion Group Shutdown Reset (Mgsr)

    Chapter 3 Motion Group Instructions This information applies to the CompactLogix 5370, ControlLogix 5570, Motion Group Shutdown Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Reset (MGSR) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Use the Motion Group Shutdown Reset (MGSR) instruction to transition a group of axes from the shutdown operating state to the axis ready operating state.
  • Page 227 Motion Group Instructions Chapter 3 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 The enable bit indicates when the instruction is enabled. It remains set until servo messaging completes and Rung-condition-in goes false. .DN (Done) Bit 29 The done bit indicates when the instruction resets the group of axes from the shutdown operating state. .ER (Error) Bit 28 The error bit indicates when the instruction detects an error, such as if messaging to the servo module failed.
  • Page 228 Chapter 3 Motion Group Instructions 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.
  • Page 229: Mgsr Flow Chart (True)

    Motion Group Instructions Chapter 3 Structured Text Syntax page 635 Motion Error Codes (ERR) page 557 Common Attributes page 663 MGSR Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 230: Motion Group Strobe Position (Mgsp)

    Chapter 3 Motion Group Instructions Motion Group Strobe Position This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MGSP) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Use the Motion Group Strobe Position (MGSP) instruction to latch the current Command and Actual Position of all axes in the specified group at a single point in time.
  • Page 231 Motion Group Instructions Chapter 3 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set when the group of axes have been successfully set to Shutdown state.
  • Page 232 Chapter 3 Motion Group Instructions 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 the .DN or .ER bit is true. Rung-condition-in is true The .EN bit is set to true and the instruction executes.
  • Page 233: Mgsp Flow Chart (True)

    Motion Group Instructions Chapter 3 MGSP Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 235: Motion Event Instructions

    Chapter 4 Motion Event Instructions Motion Event Instructions These are the motion event instructions. Available Instructions Ladder Diagram and Structured Text MAOC MDOC Function Block Not available Important: Tags used for the motion control attribute of instructions should only be used once. Reuse of the motion control tag in other instructions can cause unintended operation.
  • Page 236: Motion Arm Watch (Maw)

    Chapter 4 Motion Event Instructions Motion Arm Watch (MAW) 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. Controller differences are noted where applicable. Use the Motion Arm Watch (MAW) instruction to arm motion module watch position event checking for the specified axis.
  • Page 237 Motion Event Instructions Chapter 4 Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE...
  • Page 238 Chapter 4 Motion Event Instructions MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set to true when the rung makes a false-to-true transition and remains set to true until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set to true when the axis watch event checking has been successfully armed.
  • Page 239 Motion Event Instructions Chapter 4 To successfully execute a MAW instruction, the targeted axis must be configured as either a Servo or Feedback Only axis. Otherwise, the instruction errs. Important: The instruction execution may take multiple scans to execute because it requires multiple coarse updates to complete the request.
  • Page 240 Chapter 4 Motion Event Instructions Extended Error Codes Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. The following Extended Error codes help to pinpoint the problem when the MAW instruction receives a Servo Message Failure (12) error message.
  • Page 241 Motion Event Instructions Chapter 4 MAW Flow Chart page 242 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 242: Maw Flow Chart (True)

    Chapter 4 Motion Event Instructions MAW Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 243: Understand A Programming Example

    Motion Event Instructions Chapter 4 Understand a Programming The following figure shows rungs to redefine the axis position of a motion control example application program using the Motion Arm Watch (MAW) instruction. Watch Position Example The following example shows the ladder logic to: •...
  • Page 244 Chapter 4 Motion Event Instructions Executing this instruction also clears the In Process bit associated with the controlling Motion Arm Watch (MAW) instruction. Available Languages Ladder Diagram Use the Motion Disarm Watch (MDW) instruction to disarm watch-position event-checking for an axis. This instruction has the affect of clearing both the Watch Event Status and Watch Armed Status bits in the axis data structure.
  • Page 245 Motion Event Instructions Chapter 4 MOTION_INSTRUCTION Structure Mnemonic Description .EN (Enable) Bit 31 It is set to true when the rung makes a false-to-true transition and remains set to true until the servo message transaction is completed and the rung goes false. .DN (Done) Bit 29 It is set to true when the axis watch event checking has been successfully disarmed.
  • Page 246 Chapter 4 Motion Event Instructions 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.
  • Page 247 Motion Event Instructions Chapter 4 Ladder Diagram Structured Text MDW(Axis1,MDW_1); See also Motion Event Instructions page 235 Motion Error Codes (.ERR) page 557 Common Attributes page 663 Structured Text Syntax page 635 MDW Flow Chart page 248 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 248: Mdw Flow Chart (True)

    Chapter 4 Motion Event Instructions MDW Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 249: Motion Arm Registration (Mar)

    Motion Event Instructions Chapter 4 Motion Arm Registration (MAR) 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. Controller differences are noted where applicable. Use the Motion Arm Registration (MAR) instruction to arm registration event checking for the specified axis.
  • Page 250 Chapter 4 Motion Event Instructions Operands Ladder Diagram Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE Name of the axis to perform operation on AXIS_GENERIC AXIS_GENERIC...
  • Page 251 Motion Event Instructions Chapter 4 For the operands that require you to select from available options, enter your selection as: This Operand Has These Options Which You Enter as Text Or Enter as a Number TriggerCondition positive_edge negative_edge WindowedRegistration disabled enabled MOTION_INSTRUCTION Structure Mnemonic...
  • Page 252 Chapter 4 Motion Event Instructions Multiple registration events may be active at any time for a given axis, but only one may be active per registration input. Each event is monitored independently and may be checked using the appropriate RegEventStatus bit. Windowed Registration When the Windowed Reg checkbox is checked, the selected trip state only results in a registration event if it occurs when the axis is within the window defined by...
  • Page 253 Motion Event Instructions Chapter 4 Position Window for Rotary Axis Rearming an MAR Instruction If your application requires rapid and continuous detection of a registration sensor, we recommend that you use the following logic: Ladder Logic for Continuous Registration Detection Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 254 Chapter 4 Motion Event Instructions To rearm the MAR instruction, the rung must change from false to true. The rate at which this logic functions depends on the following: • program scan time • motion task coarse update rate Important: In large I/O connections, force values can slow down the rate at which the controller processes repetitive motion registration.
  • Page 255 Motion Event Instructions Chapter 4 Error Codes See Motion 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. The following Extended Error codes help to pinpoint the problem when the MAR instruction receives a Servo Message Failure (12) error message.
  • Page 256 Chapter 4 Motion Event Instructions Example Ladder Diagram Structured Text MAR(Axis1, MAR_2, Positive_Edge, enabled, minmarpos_1, maxmarpos_1, 1); See also Motion Event Instructions page 235 Motion Error Codes (.ERR) page 557 Structured Text Syntax page 635 Common Attributes page 663 MAR Flow Chart page 257 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 257: Mar Flow Chart (True)

    Motion Event Instructions Chapter 4 MAR Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 258: Motion Disarm Registration (Mdr)

    Chapter 4 Motion Event Instructions Motion Disarm Registration This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MDR) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. Use the Motion Disarm Registration (MDR) instruction to disarm the specified motion module registration input event checking for the specified axis.
  • Page 259 Motion Event Instructions Chapter 4 Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, ControlLogix CompactLogix 5480, 5570, Compact GuardLogix 5370, ControlLogix 5580, Compact and GuardLogix 5570 controllers GuardLogix 5380, and GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE...
  • Page 260 Chapter 4 Motion Event Instructions To successfully execute a MDR instruction, the targeted axis must be configured as either a Servo or Feedback Only axis. Otherwise, the instruction errors. Important: The instruction execution may take multiple scans to execute because it requires multiple coarse updates to complete the request.
  • Page 261 Motion Event Instructions Chapter 4 Extended Error Codes Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. The following Extended Error codes help to pinpoint the problem when the MDR instruction receives a Servo Message Failure (12) error message.
  • Page 262: Motion Arm Output Cam (Maoc)

    Chapter 4 Motion Event Instructions See also Motion Event Instructions page 235 Motion Error Codes (.ERR) page 557 Common Attributes page 663 Structured Text Syntax page 635 Motion Arm Output Cam (MAOC) 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.
  • Page 263 Motion Event Instructions Chapter 4 be executed Once, Continuously or Persistently by specifying the desired Execution Mode. Persistent behavior allows the output cam to become disarmed when the cam position exceeds the output cam range, and rearmed when cam position returns to within range. Output Cam range is defined by input parameters CamStartPosition and CamEndPosition.
  • Page 264 Chapter 4 Motion Event Instructions Operands There are data conversion rules for mixed data types within an instruction. See Data Conversion. Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, ControlLogix 5580, Compact GuardLogix 5370, Compact GuardLogix and GuardLogix 5570...
  • Page 265 Motion Event Instructions Chapter 4 Output Cam OUTPUT_CAM OUTPUT_CAM Array Tag An array of OUTPUT_CAM elements. The elements do not need to be ordered and the array size is determined by the number of cam elements specified. The array size is limited by the available memory of the Logix controller.
  • Page 266 Chapter 4 Motion Event Instructions Execution Schedule UINT32 UINT32 Immediate Selects when to arm the Output Cam. Options are: 0 = Immediate – Output Cam is armed at once. 1 = Pending – Output cam is armed when the cam position of a currently executing Output Cam moves beyond its cam start or cam end position.
  • Page 267 Motion Event Instructions Chapter 4 Structured Text 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]). See Structured Text Syntax for more information on the syntax of expressions within structured text.
  • Page 268 Chapter 4 Motion Event Instructions One possible side effect of a pending MAOC instruction existing when the Output Cam is armed and the axis moves is that one or more outputs could begin executing based on the configuration of the pending MAOC instruction. MOTION_INSTRUCTION Structure Mnemonic Description...
  • Page 269 Motion Event Instructions Chapter 4 Specifying the Output Cam To execute a MAOC instruction, a calculated Output Cam data array tag must be specified. Output Cam array tags may be created by the Logix Designer tag editor or the MAOC instruction using the built-in Output Cam Editor. The data defines the specifics for each Output Cam element.
  • Page 270 Chapter 4 Motion Event Instructions Latch Type Depending on the selected LatchType, the corresponding output bit is set according to the following table: Latch Type Behavior Inactive The output bit is not changed. Position The output bit is set when the axis enters the compensated cam range.
  • Page 271 Motion Event Instructions Chapter 4 Unlatch Type The following diagram shows the effect of the selected latch type on the output bit for different compensated cam and enable bit combinations as function of position. Latch Type Behavior Inactive The output bit is not changed. Position The output bit is reset when the axis enters the compensated cam range.
  • Page 272 Chapter 4 Motion Event Instructions The following diagram shows the effect of the selected unlatch type on the output bit for different compensated cam and enable bit combinations as function of time. Left and Right Cam Positions The Left and Right cam positions define the range of an Output Cam element. If the latch or unlatch type is set to "Position"...
  • Page 273 Motion Event Instructions Chapter 4 • If you select an unlatch type less than 0 or greater than 5, a value of "Inactive" is used and the user is warned with an instruction error Illegal Output Cam. • If you select a left cam position greater than or equal to the right cam position and the latch or unlatch type is set to Position or Position and Enable, the Output Cam element is not considered and the user is warned with an instruction error Illegal Output Cam.
  • Page 274 Chapter 4 Motion Event Instructions The following diagram shows the effect of the output compensation on the relationships between the axis, input, and output Offset and Delay Compensation The offset provides position compensation, while the latch and unlatch delay provides time delay compensation for the latch and unlatch operation. The following diagram shows the effect of the compensation values on an Output Cam element.
  • Page 275 Motion Event Instructions Chapter 4 Mode Compensation Depending on the selected mode, the compensated output bit is set according to the following table. Mode Behavior Normal The output bit is set, when the output of the latch and unlatch operation becomes active. The output bit is reset, when the output of the latch and unlatch operation becomes inactive.
  • Page 276 Chapter 4 Motion Event Instructions Output Compensation Array Checks The following output compensation array checks are used with the MAOC instruction. If you select a latch and unlatch delay combination that results in a compensated cam of less than minimum width, the width of the compensated cam is set to the minimum.
  • Page 277 Motion Event Instructions Chapter 4 Execution Mode Depending on the selected execution mode, the Output Cam behavior may differ, when the cam position moves beyond the cam start or cam end position. Mode Behavior Once When the cam position moves beyond the cam start or cam end position, the Output Cam is disarmed and the Process Complete bit of the Motion Instruction is set.
  • Page 278 Chapter 4 Motion Event Instructions Reference Depending on the selected reference, the Output Cam is connected to either the actual or command position of the axis. Important: The MAOC instruction execution completes in a single scan, thus the Done (.DN) bit and the In Process .IP bit are set immediately.
  • Page 279 Motion Event Instructions Chapter 4 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 they are listed in the faceplate from top to bottom with the first operand being counted as zero.
  • Page 280 Chapter 4 Motion Event Instructions Status Bits MAOC Effects Status Bits Status bits may be used to determine if an MAOC instruction can be initiated. The MAOC instruction affects the following status words in the Motion Axis Structure: • OutputCamStatus •...
  • Page 281 Motion Event Instructions Chapter 4 Also, if an axis fault exists when an MAOC instruction is initiated, the instruction errs. Example Ladder Diagram Structured Text MAOC(Axis1, ExecutionTarget1, MotionControl1, Output1, Input1, OutputCam1[0], CamStartPosition1, CamEndPosition1, OutputComp1[0], Persistent, Immediate, AxisArmPosition1, CamArmPosition1, actual); See also MAOC Flow Chart (True) page 297 Motion Error Codes (.ERR)
  • Page 282: Scheduled Output Module

    Chapter 4 Motion Event Instructions Scheduled Output Module The 1756-OB16IS, 1732E-OB8M8SR, and 1756-OB16IEFS Scheduled Output modules are designed to work in conjunction with the MAOC motion instruction to provide position based output control (also known as PLS). The MAOC instruction by itself allows position based output control by using the position of any motion axis in ControlLogix, and CompactLogix for the 1732E-OB8M8SR module, as the position reference and any output or boolean as the output.
  • Page 283 Motion Event Instructions Chapter 4 performance. Status of each schedule is reported in the output echo connection and reflected in the input image for the module. The scheduled output functionality relies on CST (Coordinated System Time) timestamp in the 1756-OB16IS module. At least one controller in the chassis must be a CST time master.
  • Page 284 Chapter 4 Motion Event Instructions Usage with MAOC Instruction When used with motion and the MAOC instruction, values in the output image are controlled by the Motion Planner firmware in the controller. The Motion Planner triggers the data to be sent to the module. Although, the normal program or task scan also triggers data to be sent to the module.
  • Page 285 Motion Event Instructions Chapter 4 Tip: For the 1756-OB16IS module, outputs 0 to 7 can be forced by forcing the Data Bit to 0 or 1 and its corresponding bit in the ScheduleMask to 0. For outputs 8 to 15, only the Data Bit needs to be forced.
  • Page 286 Chapter 4 Motion Event Instructions Each Time Slot stores the information described in the following table. Topic Description Latch Event Mask When a latch event is detected, the time slot in which it belongs is calculated and the bit in the Latch Event Mask corresponding to the output bit of the latch is set. Unlatch Event Mask When an unlatch event is detected, the time slot in which it belongs is calculated and the bit in the Unlatch Event Mask corresponding to the output bit of the unlatch is set.
  • Page 287 Motion Event Instructions Chapter 4 The minimum width of a cam element corresponds to the width of a time slot, or 1/16 the coarse update period. I/O Subsystem You can specify the Output parameter of an MAOC instruction as either a memory tag or an Output Module’s data tag.
  • Page 288 Chapter 4 Motion Event Instructions Array of 16 Schedule Structures Field Size Description Schedule ID 1 byte Valid ID’s are 1 to 16 for the 1756-OB16IS and 1732E-OB8M8SR modules, 1...32 for the 1756-OB16IEFS module. Any other value indicates that the schedule is not to be considered. Sequence Number 1 byte The scheduled output modules will maintain a copy of the...
  • Page 289: Specifying The Output Cam

    Motion Event Instructions Chapter 4 Specifying the Output Cam To execute a MAOC instruction, a calculated Output Cam data array tag must be specified. Output Cam array tags may be created by the Logix Designer application tag editor or the MAOC instruction using the built-in Output Cam Editor.
  • Page 290 Chapter 4 Motion Event Instructions Latch Type Depending on the selected LatchType, the corresponding output bit is set according to the following table: Latch Type Behavior Inactive The output bit is not changed. Position The output bit is set when the axis enters the compensated cam range. Enable The output bit is set when the enable bit becomes active.
  • Page 291 Motion Event Instructions Chapter 4 Unlatch Type The following diagram shows the effect of the selected latch type on the output bit for different compensated cam and enable bit combinations as function of position. Latch Type Behavior Inactive The output bit is not changed. Position The output bit is reset when the axis enters the compensated cam range.
  • Page 292 Chapter 4 Motion Event Instructions The following diagram shows the effect of the selected unlatch type on the output bit for different compensated cam and enable bit combinations as function of time. Left and Right Cam Positions The Left and Right cam positions define the range of an Output Cam element. If the latch or unlatch type is set to Position or Position and Enable with the enable bit active, the left and right cam positions specify the latch or unlatch position of the output bit.
  • Page 293: Specifying Output Compensation

    Motion Event Instructions Chapter 4 Output Cam Array Checks The following output cam array checks are used with the MAOC instruction. If you select Then Instruction error an output bit less than 0 or greater than 31 the Output Cam element is not considered a latch type less than 0 or greater than 3 a value of Inactive is used an unlatch type less than 0 or greater than 5...
  • Page 294 Chapter 4 Motion Event Instructions Offset and Delay Compensation The offset provides position compensation, while the latch and unlatch delay provides time delay compensation for the latch and unlatch operation. The following diagram shows the effect of the compensation values on an Output Cam element.
  • Page 295 Motion Event Instructions Chapter 4 Mode Compensation Depending on the selected mode, the compensated output bit is set according to the following table. Mode Behavior When the output of the latch and unlatch operation The output bit is set becomes active. Normal the output of the latch and unlatch operation The output bit is reset...
  • Page 296 Chapter 4 Motion Event Instructions Output Compensation Array Checks The following output compensation array checks are used with the MAOC instruction. If you select Then Instruction error a latch and unlatch delay combination that results in a the width of the compensated cam is set to the minimum. compensated cam of less than minimum width a mode less than 0 or greater than 3 a Normal mode is considered...
  • Page 297: Maoc Flow Chart (True)

    Motion Event Instructions Chapter 4 MAOC Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 298: Motion Disarm Output Cam (Mdoc)

    Chapter 4 Motion Event Instructions Motion Disarm Output Cam This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MDOC) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. The Motion Disarm Output Cam (MDOC) instruction initiates the disarming of one or more Output Cams connected to the specified axis.
  • Page 299 Motion Event Instructions Chapter 4 Execution SINT, INT, or DINT SINT, INT, or DINT Immediate or The execution target Target defines the specific Output Cam from the set connected to the named axis. Behavior is determined by the following: 0...7 – Output Cams executed in the Logix controller.
  • Page 300 Chapter 4 Motion Event Instructions Description The MDOC instruction disarms a specific or all output cams for a specified axis depending on the selected disarm type. The axis provides the position input to the Output Cam. The execution target defines a specific Output Cam from the set that is connected to the specified axis.
  • Page 301 Motion Event Instructions Chapter 4 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 they are listed in the faceplate from top to bottom with the first operand being counted as zero.
  • Page 302 Chapter 4 Motion Event Instructions Status Bits MDOC Effects Status Bits The MDOC instruction affects the following status words in the Motion Axis Structure: • OutputCamStatus • OutputCamPendingStatus • OutputCamLockStatus • OutputCamTransitionStatus Each above is a DINT with bits 0 to 7 corresponding to the 8 execution targets.
  • Page 303: Mdoc Flow Chart (True)

    Motion Event Instructions Chapter 4 MDOC Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 305: Motion Configuration Instructions

    Chapter 5 Motion Configuration Instructions Motion Configuration Configuration instructions include all motion instructions that are used to establish and apply servo configuration parameters to an axis. This group of Instructions instructions includes hookup diagnostic instructions and tuning instructions. Use the motion configuration instructions to tune an axis and run diagnostics tests for the servo system.
  • Page 306: Motion Apply Axis Tuning (Maat)

    Chapter 5 Motion Configuration Instructions • A marker test • A commutation test (for PM motors only) • Determine important motor parameters The motion configuration instructions are: If you want to: Use this instruction: Compute a complete set of servo gains and dynamic limits MAAT based on a previously executed MRAT instruction.
  • Page 307 Motion Configuration Instructions Chapter 5 Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MAAT(Axis,MotionControl); Operands There are data conversion rules for mixed data types within an instruction. See Data Conversions. Ladder Diagram and Structured Text Operand Type Format...
  • Page 308 Chapter 5 Motion Configuration Instructions Description The MAAT instruction is used to execute a series of computations resulting in values for gain and dynamic configuration parameters on the specified axis. As part of the work performed by MAAT, these resultant configuration parameters are applied so that the axis is ready for full servo operation.
  • Page 309 Motion Configuration Instructions Chapter 5 Axis Parameter Data Type Units Meaning Damping Factor Real Damping Factor used to calculate the gains. Tuning Velocity Real pos units/sec Top Speed of Tuning Profile. Tune Accel Real pos units/sec Calculated Acceleration Time of Tuning Profile.
  • Page 310 Chapter 5 Motion Configuration Instructions If the External Vel Servo Drive configuration bit parameter is FALSE, indicating interface to an external torque servo drive, the following output parameters are generated. Axis Parameter Data Type Units Meaning Pos Proportional Gain Real 1/msec Position Servo Loop Proportional Gain.
  • Page 311 Motion Configuration Instructions Chapter 5 Affects Math Status Flags 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 the .DN or .ER bit is set to true.
  • Page 312 Chapter 5 Motion Configuration 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 MAAT instruction receives a Servo Message Failure (12) error message.
  • Page 313: Maat Flow Chart (True)

    Motion Configuration Instructions Chapter 5 MAAT Flow Chart (True) Motion Run Axis Tuning (MRAT) 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. Controller differences are noted where applicable. Use the Motion Run Axis Tuning (MRAT) to command the motion module to run a tuning motion profile for the specified axis.
  • Page 314 Chapter 5 Motion Configuration Instructions stored in the Axis Object for subsequent use with the Motion Apply Axis Tuning (MAAT) instruction. Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MRAT(Axis,MotionControl); Operands Ladder Diagram and Structured Text Operand Type Type...
  • Page 315 Motion Configuration Instructions Chapter 5 Description - AXIS_SERVO, AXIS_SERVO_DRIVE The MRAT instruction is used to execute a tuning motion profile on the specified axis. During this brief tuning motion profile, the motion module makes timing and velocity measurements that serve as input data for a subsequent Motion Apply Axis Tuning (MAAT) instruction.
  • Page 316 Chapter 5 Motion Configuration Instructions Tuning Velocity Profile when True If the External Vel Servo Drive configuration bit parameter is FALSE, indicating interface to an external torque servo drive, only one pulse is applied to the axis. The tuning velocity profile is shown below. Tuning Velocity Profile when False Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 317 Motion Configuration Instructions Chapter 5 The axis configuration parameters that MRAT generates as output depend on the External Drive configuration. If the External Vel Servo Drive configuration bit parameter is TRUE, indicating interface to an external velocity servo drive, the following output parameters are generated.
  • Page 318 Chapter 5 Motion Configuration Instructions Description - AXIS_CIP_DRIVE The MRAT instruction is used to execute a tuning motion profile on the specified CIP axis. MRAT requires no explicit input parameters; simply enter or select the desired physical axis. If the targeted axis does not appear in the list of available axes, the axis has not been configured for operation.
  • Page 319 Motion Configuration Instructions Chapter 5 Based on the above configuration parameters, MRAT execution generates a motion event on the specified axis that consists of a triangular velocity profile. The tuning procedure will measure maximum acceleration and deceleration rates based on ramps to and from the Tuning Speed. Thus, the accuracy of the measured acceleration and deceleration capability is reduced by tuning at a speed other than the desired operating speed of the system.
  • Page 320 Chapter 5 Motion Configuration Instructions Tune Status Parameter Conditions may occur that make it impossible for the controller to properly perform the tuning operation. When this is the case, the tuning process is automatically aborted and a tuning fault reported that is stored in the Tune Status output parameter (GSVable).
  • Page 321 Motion Configuration Instructions Chapter 5 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.
  • Page 322 Chapter 5 Motion Configuration Instructions Examples When the input conditions are true, the controller commands the servo module to run a tuning motion profile for axis1. Ladder Diagram See also MRAT Flow Chart (True) page 323 Motion Configuration Instructions page 305 Structured Text Syntax page 635 Common Attributes...
  • Page 323: Mrat Flow Chart (True)

    Motion Configuration Instructions Chapter 5 MRAT Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 324: Motion Apply Hookup Diagnostics (Mahd)

    Chapter 5 Motion Configuration Instructions Motion Apply Hookup This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, and ControlLogix 5580 Diagnostics (MAHD) controllers. The Motion Apply Hookup Diagnostics (MAHD) instruction is used to apply the results of a previously run the Motion Run Hookup Diagnostics (MRHD) instruction to generate a new set of encoder and servo polarities based on the Observed Direction of motion during the test.
  • Page 325 Motion Configuration Instructions Chapter 5 Ladder Diagram and Structured Text Operand Type Format Description Axis AXIS_SERVO Name of the axis to perform operation on. AXIS_SERVO_DRIVE Motion Control MOTION_INSTRUCTI Structure used to access instruction status parameters. Diagnostic Test UDINT Immediate Selects the specific test for the motion module to run: 0 = motor/encoder hookup test 1 = encoder hookup test...
  • Page 326 Chapter 5 Motion Configuration Instructions input configuration values for the MAHD instruction. See the MRHD instruction description for more information. MAHD requires specification of the Diagnostic Test to apply and the Observed Direction of motion during the previous Motion Run Hookup Diagnostics (MRHD) instruction test process. Enter or select the Diagnostic Test and the Observed Direction and the desired physical axis.
  • Page 327 Motion Configuration Instructions Chapter 5 Axis Parameter Data Type Units Meaning Encoder Polarity Negative Boolean Inverts the sense of the encoder feedback input to the motion module. To successfully execute a MAHD instruction running the Motor Encoder Test, the targeted axis must be configured as either a Servo or Feedback Only axis type. If any of these conditions are not met than the instruction errs.
  • Page 328 Chapter 5 Motion Configuration Instructions Error Codes See Motion 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).
  • Page 329: Mahd Flow Chart (True)

    Motion Configuration Instructions Chapter 5 MAHD Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 330: Motion Run Hookup Diagnostics (Mrhd)

    Chapter 5 Motion Configuration Instructions Motion Run Hookup Diagnostics This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, (MRHD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Controller differences are noted where applicable. Use the Motion Run Hookup Diagnostics (MRHD) instruction to command the motion module to run any one of three different diagnostics on the specified axis as selected by the Diagnostic Test.
  • Page 331 Motion Configuration Instructions Chapter 5 Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Axis AXIS_CIP_DRIVE AXIS_CIP_DRIVE Name of the axis to perform...
  • Page 332 Chapter 5 Motion Configuration Instructions Description - AXIS_SERVO, AXIS_SERVO_DRIVE The MRHD instruction is used to execute various test diagnostics on the specified axis to test the integrity and, in some cases, the polarity of servo field connections. There are currently test diagnostics supporting drive hookup, encoder hookup, marker hookup and motion module OK contact hookup.
  • Page 333 Motion Configuration Instructions Chapter 5 disables the drive. The control reflects this condition through the Test Status axis output parameter. This usually indicates that either the cabling to the drive or the cabling to the encoder is incorrect. Running MRHD with the Encoder Hookup Test selected is an effective method of isolating the problem to the encoder or drive.
  • Page 334 Chapter 5 Motion Configuration Instructions Test Status Conditions may occur that make it impossible for the control to properly perform the test operation. When this is the case, the test process is automatically aborted and a test fault is reported and stored in the Test Status output parameter. It is also possible to manually abort a test process using a MAS instruction which results in a test fault reported by the Test Status parameter.
  • Page 335 Motion Configuration Instructions Chapter 5 The MRHD instruction uses the CIP axis configuration parameters as input and output. The input configuration parameters that the MRHD uses are shown in the table below. Axis Parameter Data Type Units Meaning Hookup Test Distance Real Position Units Distance that the axis must travel to satisfy the...
  • Page 336 Chapter 5 Motion Configuration Instructions Hookup Test Feedback USINT Reports the direction of axis travel during the last Direction 1 hookup test, as detected by the drive's feedback 1 device. 0 = The drive’s feedback 1 device detected a positive direction, that is, increasing counts. 1 = The drive’s feedback 1 device detected a negative direction, that is, decreasing counts.
  • Page 337 Motion Configuration Instructions Chapter 5 Axis Parameter Data Type Units Meaning Hookup Test Status USINT Returns the status of the last Run Hookup Test service on the targeted drive axis. The Hookup Test Status attribute can be used to determine when the hookup test service has successfully completed.
  • Page 338 Chapter 5 Motion Configuration Instructions Axis Parameter Data Type Units Meaning Hookup Test Status USINT Returns the status of the last Run Hookup Test service on the targeted drive axis. The Hookup Test Status attribute can be used to determine when the hookup test service has successfully completed.
  • Page 339 Motion Configuration Instructions Chapter 5 Commutation Test The Commutation test only applies to PM motors. This test applies current to the motor to align the rotor and check for proper phasing of a UVW encoder or Hall sensor, if applicable. Finally, the test measures the commutation offset. Tip: For linear stages, make sure there is enough travel.
  • Page 340 Chapter 5 Motion Configuration Instructions Test Status This parameter returns the status of the last Run Hookup Test service on the targeted drive axis. Conditions may occur that make it impossible for the control to properly perform the test operation. When this is the case, the test process is automatically aborted and a test fault is reported and stored in the Hookup Test Status output parameter.
  • Page 341 Motion Configuration Instructions Chapter 5 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.
  • Page 342 Chapter 5 Motion Configuration Instructions Status Bits MRHD Changes to Status Bits Bit Name State Meaning DriveEnableStatus TRUE The axis is in Drive Control state. The Drive Enable output is active while the Tuning Profile is running. TestStatus TRUE The axis is running a testing process. Examples When the input conditions are true, the controller runs the encoder diagnostic test on axis1.
  • Page 343: Mrhd Flow Chart (True)

    Motion Configuration Instructions Chapter 5 MRHD Flow Chart (True) Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 344: Modify Motion Configuration Parameters

    Chapter 5 Motion Configuration Instructions Modify Motion In your ladder logic program, you can modify motion configuration parameters using the SSV instruction. For example, you can change position loop gain, Configuration Parameters velocity loop gain, and current limits within your program. Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 345: Multi-Axis Coordinated Multi-Axis Coordinated Motion Instructions

    Chapter 6 Multi-Axis Coordinated Motion Instructions Multi-Axis Coordinated Use the Multi-Axis Coordinated Motion Instructions to move up to six axes in a coordinate system. Motion Instructions Available Instructions Ladder Diagram and Structured Text MCLM MCCM MCCD MCSD MCSR MCTP MDCC MCTPO MCPM MCTO...
  • Page 346 Chapter 6 Multi-Axis Coordinated Motion Instructions Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 347 Multi-Axis Coordinated Motion Instructions Chapter 6 Delta J1J2J6 Coordinate System Delta J1J2J3J6 Coordinate System Delta J1J2J3J4J5 Coordinate System The multi-axis coordinated motion instructions are: Use this instruction: Stopping the axes of a Coordinate System or cancel a transform. Initiating a single or multi-dimensional linear Coordinated move for the specified axes MCLM within a Cartesian Coordinate System.
  • Page 348 Chapter 6 Multi-Axis Coordinated Motion Instructions Initiating a reset of all of the axes of the specified Coordinate System from the shutdown MCSR state to the axis ready state and clear the axis faults. Starting a transform that links two Coordinate Systems together. This instruction is only available on supported controllers.
  • Page 349 Multi-Axis Coordinated Motion Instructions Chapter 6 Step=2 If Step=2 then Move1 is already happening. Move2 goes into the queue and waits for Move1 to complete. When Move1 is complete, Move2 moves the axes to a position of 10, 5. And once Move2 is in process and there is room in the queue, Step=3.
  • Page 350 Chapter 6 Multi-Axis Coordinated Motion Instructions When an instruction completes, it is removed from the queue and there is space for another instruction to enter the queue. Both bits always have the same value because you can queue only one pending instruction at a time. If the application requires several instructions to be executed in sequence, then the bits are set using these parameters.
  • Page 351 Multi-Axis Coordinated Motion Instructions Chapter 6 Move1.DN Move1.IP Move1.AC Move1.PC Move2.DN Move2.IP Move2.AC Move2.PC cs1.MoveTransitionStatus cs1.MovePendingStatus cs1.MovePendingQueueFullStatus Bit States at Transition Points of Blended Move Using No Decel Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 352 Chapter 6 Multi-Axis Coordinated Motion Instructions The following table shows the bit status at the various transition points shown in the preceding graph with termination type of No Decel. For No Decel termination type distance-to-go for transition point TP2 is equal to deceleration distance for the Move1 instruction.
  • Page 353 Multi-Axis Coordinated Motion Instructions Chapter 6 Command Tolerance termination type distance-to-go for transition point TP2 is equal to Command Tolerance for the Coordinate System cs1. Move1.DN Move1.IP Move1.AC Move1.PC Move2.DN Move2.IP Move2.AC Move2.PC cs1.MoveTransitionStatus cs1.MovePendingStatus cs1.MovePendingQueueFullStatus Bit States at Transition Points of Blended Move Using Follow Contour Velocity Constrained or Unconstrained Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 354: Motion Instructions Master Driven Coordinated Control (Mdcc)

    Chapter 6 Multi-Axis Coordinated Motion Instructions The following table shows the bits status at the transition points. Move1.DN Move1.IP Move1.AC Move1.PC Move2.DN Move2.IP Move2.AC Move2.PC cs1.MoveTransitionStatus cs1.MovePendingStatus cs1.MovePendingQueueFullStatus See also Choose a Termination Type page 500 Speed, Acceleration, Deceleration, and Jerk Enumerations for Coordinated Motion page 489 Status Bits for Motion Instructions when (MCLM, MCCM) when...
  • Page 355 Multi-Axis Coordinated Motion Instructions Chapter 6 Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MDCC (SlaveCoordinateSystem, MasterAxis, MotionControl, MasterReference, NominalMasterVelocity); Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 356 Chapter 6 Multi-Axis Coordinated Motion Instructions Operands Ladder Diagram and Structured Text Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers GuardLogix 5580 controllers Slave System COORDINATE_SYSTEM COORDINATE_SYSTEM...
  • Page 357 Multi-Axis Coordinated Motion Instructions Chapter 6 Master Reference The Master Reference for an MDCC instruction selects the Master Axis position source. The enumerations for Master Reference Axis are: Actual – Slave motion is generated from the actual (current) position of the Master Axis as measured by its encoder or other feedback device.
  • Page 358 Chapter 6 Multi-Axis Coordinated Motion Instructions Note that you have the option to browse for enumerations in the Structured Text Editor as shown below. Outputs Mnemonic Description .EN (Enable) Bit 31 The enable bit is set when the rung transitions from false-to-true and stays set until the rung goes false.
  • Page 359 Multi-Axis Coordinated Motion Instructions Chapter 6 in the MDCC instruction into a pending state. The parameters in the pending MDCC instruction are changed if you execute a succeeding MDCC instruction before a new MCLM or MCCM instruction is activated. The MDCC becomes active (AC bit is set) only when all queued motion is complete and the motion queue is empty.
  • Page 360 Chapter 6 Multi-Axis Coordinated Motion Instructions Error Codes See Motion Error Codes (ERR) for Motion Instructions. Verification Errors An invalid or No Master Axis will cause new errors to be generated when verified by the programming software. The following conditions may cause this error: •...
  • Page 361: Motion Calculate Transform Position (Mctp)

    Multi-Axis Coordinated Motion Instructions Chapter 6 Motion Calculate This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Transform Position (MCTP) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Important: You can also use this instruction with the following controllers: 1756-L6 controllers 1756-L7S controllers 1769-L18ERM controllers...
  • Page 362 Chapter 6 Multi-Axis Coordinated Motion Instructions Operands Ladder Diagram and Structured Text Operand Type Format Description Source System COORDINATE_SYSTEM Cartesian coordinate system for Cartesian positions of the robot Target System COORDINATE_SYSTEM Non-Cartesian coordinate system that controls the actual equipment Motion Control MOTION_INSTRUCTION Control tag for the instruction.
  • Page 363 Multi-Axis Coordinated Motion Instructions Chapter 6 MOTION_INSTRUCTION Data Type To see if Check if this Data Type Notes bit is on The rung is true 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.
  • Page 364 Chapter 6 Multi-Axis Coordinated Motion Instructions Affects Math Status Flags 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.
  • Page 365 Multi-Axis Coordinated Motion Instructions Chapter 6 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.
  • Page 366 Chapter 6 Multi-Axis Coordinated Motion Instructions 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); Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 367: Motion Coordinated Transform With Orientation (Mcto)

    Multi-Axis Coordinated Motion Instructions Chapter 6 See also Motion Error Codes (.ERR) page 557 Multi-Axis Coordinated Motion Instructions page 345 Common Attributes page 663 Structured Text Syntax page 635 Motion Coordinated Transform This information applies to the Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
  • Page 368 Chapter 6 Multi-Axis Coordinated Motion Instructions ATTENTION: If instruction operands are changed while in Run mode, the pending edits must be accepted and the controller mode cycled from Program to Run for the changes to take effect. Configuration The following table provides the operands used to configure the instruction. These operands cannot be changed at runtime.
  • Page 369 Multi-Axis Coordinated Motion Instructions Chapter 6 Important: Do not write to any instruction output tag under any circumstances. Affects Math Status Flags Major/Minor Faults None specific to this instruction. See Index Through Arrays for array-indexing faults. Execution Ladder Diagram Condition/State Action Taken Prescan Same as Rung-condition-in is false.
  • Page 370 Chapter 6 Multi-Axis Coordinated Motion Instructions to the joint target position along a non-Cartesian path. While MCTO instruction is active, the system maintains the coordinate system related data for Cartesian and Robot coordinate systems. This diagram illustrates the transformation from a Cartesian coordinate system(X,Y,Z,Rx,Ry,Rz) to a Delta robot geometry with 5 axes (J1J2J3J4J5).
  • Page 371 Multi-Axis Coordinated Motion Instructions Chapter 6 Configure an MCTO instruction The following illustration shows how to configure an MCTO instruction, with the Cartesian coordinate system as the source and the Delta 5 axis geometry as the target. Configure the source and target coordinate systems in the coordinate system dialog box.
  • Page 372 Chapter 6 Multi-Axis Coordinated Motion Instructions Data flow during inverse transform when MCTO is active When MCTO is active, during inverse transform, the instruction uses the current cartesian positions and geometry configuration to compute the corresponding joint angle positions. MCTO returns an Error 61 when moving both Cartesian and Joint coordinate systems simultaneously.
  • Page 373 Multi-Axis Coordinated Motion Instructions Chapter 6 Extended Error codes Extended Error codes help to further define the error message given by the instruction. Their meaning is dependent upon the Error Code with which they are associated. Error EX_ERROR Description Code Code Value Out Of Range (base angle) Any orientation angle...
  • Page 374 Chapter 6 Multi-Axis Coordinated Motion Instructions Error EX_ERROR Description Code Code Connection Conflict Transform Invalid Delta Configuration Link Length1 must not be equal to LinkLength2 End Effector Offset1 Re must not be negative For Delta J1J2J6 and Delta J1J2J3J6 End Effector Offset3(D3) must not be negative (Link length 1 + Rb - Re) must be less than link length 2 (Link length 1 + Rb –...
  • Page 375 Multi-Axis Coordinated Motion Instructions Chapter 6 Error EX_ERROR Description Code Code Orientation Axis Not Virtual Extended error code 3 : Rx axis must be virtual if transforms are enabled. Extended error code 4 : Ry axis must be virtual if transforms are enabled.
  • Page 376 Chapter 6 Multi-Axis Coordinated Motion Instructions Ladder Diagram When MCTO is active, with a move to Cartesian positions X = 7.361, Y = -4.25, Z = -928.18, Rx = 180, Ry = 30 and Rz = -30, the MCTO computes the corresponding Joint angle as shown in the following diagram.
  • Page 377: Motion Coordinated Path Move (Mcpm)

    Multi-Axis Coordinated Motion Instructions Chapter 6 Consider that the MCTO is programmed with tool frame offsets also enabled for Ry = 50 along with the work frame offsets. MCTO will now compute the Cartesian positions with respect to the end of the new work frame and tool frame. After programming a move to the same end position the corresponding Joint angle positions are as shown in the following diagram.
  • Page 378 Chapter 6 Multi-Axis Coordinated Motion Instructions Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MCPM (CoordinateSystem, MotionControl, Path, Length, Dynamics, LockPosition, LockDirection); Operands Important: Do not use the same tag name for more than one instruction in the same program.
  • Page 379 Multi-Axis Coordinated Motion Instructions Chapter 6 Inputs The following table explains the instruction inputs. The inputs may be field device signals from input devices or derived from user logic. Operand Data Type Format Description Path PATH_DATA See PATH_DATA Structure Length DINT Immediate Tag This input is immediate and indicates the length...
  • Page 380 Chapter 6 Multi-Axis Coordinated Motion Instructions Operand Scroll, List, or Check Box Data Type Default Notes Bit 0 to 3 – Applies only to Articulated Robot Configuration List of Bit values : DINT and SCARA geometries. Set to zero for Bit0 –...
  • Page 381 Multi-Axis Coordinated Motion Instructions Chapter 6 Operand Scroll, List, or Check Box Data Type Default Notes Acceleration Jerk List of Constant or Value REAL % of Time accelerating For all axes always See Acceleration Jerk section below. Applies to acceleration and orientation acceleration.
  • Page 382 Chapter 6 Multi-Axis Coordinated Motion Instructions Position This is a one dimensional array, whose dimension is defined to be at least equivalent to the number of axes specified in the coordinate system, 6 in Cartesian coordinate system where X, Y, Z, Rx, Ry, Rz are values of the TCP with reference to a reference frame.
  • Page 383 Multi-Axis Coordinated Motion Instructions Chapter 6 Dynamics Data Profile • Trapezoidal31 (0): When the value is set to 0 the profile setting takes precedence over the acceleration Jerk and deceleration Jerk value (values are defaulted to 0%), as a result the velocity profile is always trapezoidal. See Profile topic in MCLM for more details.
  • Page 384 Chapter 6 Multi-Axis Coordinated Motion Instructions • Speed is programmed in Coordination Units per Second or Coordination Units per Master Unit. • Acceleration and Deceleration in Coordination Units per Seconds Coordination Units per second Master Units • Orientation Speed is programmed in Degrees per Second or Degrees per Master Unit.
  • Page 385 Multi-Axis Coordinated Motion Instructions Chapter 6 • If the Slave is accelerating at 5 Degrees/MU2 and master is running at constant speed 2 MU/sec (aM=0), the slave acceleration would be: 5*2*2 = 20 Degrees/Second2. • If the Slave is accelerating at 5 Degrees/MU2, its instantaneous speed is 3 Degrees/MU and the Master is running at speed 2 MU /sec and acceleration 4 MU /sec2 then the slave acceleration is: 5*2*2 + 3*4 = 32 Degrees/Second2.
  • Page 386 Chapter 6 Multi-Axis Coordinated Motion Instructions • For deceleration jerk calculation in Engineering Units, use this calculation: Orientation Speed Orientation speed is a vector speed, its value is applied as a single orientation vector composed of Rx Ry and Rz as orthogonal components. For example if the Orientation speed is 5 Deg/Sec.
  • Page 387 Multi-Axis Coordinated Motion Instructions Chapter 6 Affects Math Status Flags Major/Minor Faults None specific to this instruction. See Index Through Arrays for array-indexing faults. Execution Ladder Diagram Condition/State Action Taken Prescan Same as Rung-condition-in is false. Rung-condition-in is false The .EN, .DN, and .ER are cleared to false. Rung-condition-in is true and The .EN bit is set to true and the instruction executes.
  • Page 388 Chapter 6 Multi-Axis Coordinated Motion Instructions Extended Error Codes Extended Error codes provide additional instruction-specific information for the Error Codes that are generic to other instructions. See Motion Error Codes (ERR) for Motion Instructions. Extended Error Codes meaning depends on the Error Codes they are associated with.
  • Page 389 Multi-Axis Coordinated Motion Instructions Chapter 6 Error Code Extended Error Description Code (.ERR) (.EXERR) 0 thru 5 Axis Position overflow The range for position depends on the conversion constant of the axis. Maximum positive position = 2,147,483,647 / conversion constant of the axis. Maximum negative position = -2,147,483,648 / conversion constant of the axis.
  • Page 390 Chapter 6 Multi-Axis Coordinated Motion Instructions Error Code Extended Error Description Code (.ERR) (.EXERR) MCPM Path Data Invalid Value in MCPM Path Data Move Type If the move type is not either absolute or incremental, the instruction will report this error. MCPM Path Data Invalid Value in MCPM Path Data TT Type If any term types other than 0, 1 and 6 are specified, the instruction will report this error.
  • Page 391 Multi-Axis Coordinated Motion Instructions Chapter 6 Error Code Extended Error Description Code (.ERR) (.EXERR) MCPM Dyn Data Invalid Value MCPM Dyn Data Orientation Decel If the orientation decel is zero or negative or INF or NAN, the instruction will report this error. Diagnostic Codes and Corrective Actions Example Ladder Diagram...
  • Page 392: Motion Coordinated Change Dynamics (Mccd)

    Chapter 6 Multi-Axis Coordinated Motion Instructions Motion Coordinated Change This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Dynamics (MCCD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. The Motion Coordinated Change Dynamics (MCCD) instruction starts a change in the path dynamics of the specified coordinate system.
  • Page 393 Multi-Axis Coordinated Motion Instructions Chapter 6 Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MCCD(CoordinateSystem, MotionControl, MotionType, ChangeSpeed, Speed, SpeedUnits, ChangeAccel, AccelRate, AccelUnits, ChangeDecel, DecelRate, DecelUnits, ChangeAccelJerk, AccelJerk, ChangeDecelJerk, DecelJerk, JerkUnits, Scope); Operands There are data conversion rules for mixed data types within an instruction.
  • Page 394 Chapter 6 Multi-Axis Coordinated Motion Instructions Inputs The following table explains the instruction inputs. Operand Type Format Description Coordinate System COORDINATE_SYSTEM Coordinated group of axes. Motion Control MOTION_INSTRUCTION Structure used to access instruction status parameters. Motion Type DINT immediate 1 = Coordinated Move Change Speed DINT immediate...
  • Page 395 Multi-Axis Coordinated Motion Instructions Chapter 6 Decel Jerk SINT, INT, DINT, or REAL immediate tag You must always enter a value for the Decel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve. Decel Jerk is the deceleration jerk rate for the coordinate system.
  • Page 396 Chapter 6 Multi-Axis Coordinated Motion Instructions Change Decel 0 = No 1 = Yes Decel Rate No enumeration immediate or tag Decel Units unitspersec2 %ofmaximum unitspermasterunit2 Change Accel Jerk 0 = No 1 = Yes Accel Jerk No enumeration immediate or tag You must always enter a value for the Accel operand.
  • Page 397 Multi-Axis Coordinated Motion Instructions Chapter 6 Description MCCD is a transitional instruction: • In relay ladder, toggle the 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.
  • Page 398 Chapter 6 Multi-Axis Coordinated Motion Instructions Change Accel The Change Accel operand determines whether or not to change the acceleration of the coordinated motion profile. • No - no change is made to the acceleration of the coordinated motion. • Yes - the acceleration of the coordinated motion is changed by the value defined in the Accel Rate and Accel Units operands.
  • Page 399 Multi-Axis Coordinated Motion Instructions Chapter 6 Impact of Changes to Acceleration and Deceleration Values on Motion Profile The following graph illustrates what could happen when a MCCD instruction is used to reduce the acceleration as velocity approaches maximum. The new acceleration Jerk Rate becomes smaller, further limiting the maximum change in acceleration.
  • Page 400 Chapter 6 Multi-Axis Coordinated Motion Instructions Effect of Change to Deceleration Change Accel Jerk The Change Accel Jerk operand determines whether or not to change the acceleration jerk of the coordinated motion profile. • No - no change is made to the acceleration jerk of the coordinated motion. •...
  • Page 401 Multi-Axis Coordinated Motion Instructions Chapter 6 Decel Jerk Decel Jerk defines the maximum deceleration jerk for the programmed move. For more information on calculating Decel Jerk, refer to the Jerk Units below. Jerk Units The jerk units define the units that are applied to the values entered in the Accel Jerk and Decel Jerk operands.
  • Page 402 Chapter 6 Multi-Axis Coordinated Motion Instructions Scope Choosing Active Motion for the Scope operand specifies that the changes affect only the motion dynamics of the active coordinated motion instruction. Choosing Active and Pending Motion specifies that the changes affect the motion dynamics of the active coordinated motion instruction and any pending coordinated motion instruction in the queue.
  • Page 403 Multi-Axis Coordinated Motion Instructions Chapter 6 For the Error Code 54 – Maximum Deceleration Value is Zero, if the Extended Error returns a positive number (0-n) it’s referring to the offending axis in the coordinate system. Go to the Coordinate System Properties General Tab and look under the Brackets ([ ])column of the Axis Grid to determine which axis has a Maximum Deceleration value of 0.
  • Page 404 Chapter 6 Multi-Axis Coordinated Motion Instructions Affects Math Status Flags Major/Minor Faults None specific to this instruction. See Index Through Arrays for array-indexing faults. Execution Ladder Diagram Condition/State Action Taken Prescan The .EN, .DN, and .ER 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.
  • Page 405 Multi-Axis Coordinated Motion Instructions Chapter 6 Example Ladder Diagram Structured Text MCCD(myMccdCoordinateSystem, myMccdMotionControl, CoordinatedMove, Yes, MyMccdSpeed, Unitspersec, Yes, MyMsccdAccelRate, Unitspersec2, Yes, MyMccdDecelRate, Unitspersec2, Yes, 100.0, Yes, 100.0, %ofTime, ActiveMotion); See also Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 Multi-Axis Coordinated Motion Instructions page 345...
  • Page 406: Motion Calculate Transform Position With Orientation (Mctpo)

    Chapter 6 Multi-Axis Coordinated Motion Instructions Motion Calculate Transform This information applies to the Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Position with Orientation (MCTPO) Use the MCTPO instruction to calculate the position of a point in one coordinate system to the equivalent point in a second coordinate system.
  • Page 407 Multi-Axis Coordinated Motion Instructions Chapter 6 Configuration The following table provides the operands used to configure the instruction. These operands cannot be changed at runtime. Operand Data Type Format Description Cartesian System COORDINATE_SYSTEM Cartesian coordinate system used to program the moves.
  • Page 408 Chapter 6 Multi-Axis Coordinated Motion Instructions Execution Ladder Diagram Condition/State Action Taken Prescan Same as Rung-condition-in is false. Rung-condition-in is false The .EN, .DN, .ER are cleared to false. Rung-condition-in is true and .EN bit is false The .EN bit is set to true and the instruction executes. Rung-condition-in is true and .EN bit is true Postscan Same as Rung-condition-in is false.
  • Page 409 Multi-Axis Coordinated Motion Instructions Chapter 6 Operand Data Type Format Description Robot Turns Counters INT16[4] A counter indicating the number of times the 180 degree point is crossed in the +/- direction that the respective axis has turned. If Transform Direction is Forward, the value is computed by the system and returned via this tag.
  • Page 410 Chapter 6 Multi-Axis Coordinated Motion Instructions Error Code EX_ERROR Code Description Connection Conflict Transform Source Dimension Error Transform dimension of the Cartesian coordinate system is < 2. Connection Conflict Transform Target Dimension Error Robot coordinate system Transform Dimension is equal to zero. Connection Conflict Transform Axes Overlap Error An axis is a member of both the Cartesian and Robot systems.
  • Page 411 Multi-Axis Coordinated Motion Instructions Chapter 6 Error Code EX_ERROR Code Description Connection Conflict Transform Invalid Delta Configuration Link Length1 must not be equal to LinkLength2 End Effector Offset1 Re must not be negative For Delta J1J2J6 and Delta J1J2J3J6 End Effector Offset3(D3) must not be negative (Link length 1 + Rb - Re) must be less than link length 2 (Link length 1 + Rb –...
  • Page 412 Chapter 6 Multi-Axis Coordinated Motion Instructions Error Code EX_ERROR Code Description Joint Angle Beyond Limits This indicates the error condition when the Joint 4 in a 5 axis Delta goes beyond turns counter range limit (45899.99 -45900). Ext Error 4 : Joint J4 Beyond Limit Joint Angle Beyond Limits This indicates error condition when the Joint 5 in a 5 axis Delta goes beyond +/-179, +179...
  • Page 413 Multi-Axis Coordinated Motion Instructions Chapter 6 This example illustrates the MCTPO instruction with Transform Direction as Forward. The target positions are guided into the Reference position operand as input. The instruction computes the corresponding Cartesian positions and turns counter as the output. Structured Text MCTPO(CS1, CS2, MCTPo1[0], BaseFrame, ToolFrame, Forward, refPos[0], transPos[0], robotConfig[0], TurnsCounter[0]);...
  • Page 414: Motion Coordinated Circular Move (Mccm)

    Chapter 6 Multi-Axis Coordinated Motion Instructions Motion Coordinated Circular This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Move (MCCM) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Use the MCCM instruction to initiate a two or three-dimensional circular coordinated move for the specified axes within a Cartesian coordinate system.
  • Page 415 Multi-Axis Coordinated Motion Instructions Chapter 6 Important: Risk of Velocity and/or End Position Overshoot If you change move parameters dynamically by any method, that is by changing move dynamics (MCD or MCCD) or by starting a new instruction before the last one has completed, be aware of the risk of velocity and/or end position overshoot.
  • Page 416 Chapter 6 Multi-Axis Coordinated Motion Instructions Function Block This instruction is not available in function block. Structured Text MCCM (CoordinateSystem, MotionControl, MoveType, Position, CircleType, Via/Center/Radius, Direction, Speed, SpeedUnits, AccelRate, AccelUnits, DecelRate, DecelUnits, Profile, AccelJerk, DecelJerk, JerkUnits,Terminationtype, Merge, Mergespeed, CommandTolerance, LockPosition, LockDirection, EventDistance, CalculatedData);...
  • Page 417 Multi-Axis Coordinated Motion Instructions Chapter 6 Speed Units SINT, INT, or DINT Immediate 0 = Units per Sec 1 = % of Maximum 4= Units per MasterUnit Accel Rate SINT, INT, DINT, or REAL Immediate or Tag [coordinate units] Accel Units SINT, INT, or DINT Immediate 0 = Units per Sec...
  • Page 418 Chapter 6 Multi-Axis Coordinated Motion Instructions Command Tolerance REAL Immediate Real or Tag The position on a coordinated move where blending should start. This parameter is used in place of Command Tolerance in the Coordinate System if Termination Type 6 is used. Tip: Termination type 2 is identical to Termination Type 6 except the Command Tolerance...
  • Page 419 Multi-Axis Coordinated Motion Instructions Chapter 6 Use the entries in this table as a guide when entering structured text operands. This Operand Has These Options Which You Enter as Text Or as Coordinate System No enumeration Motion Control No enumeration Move Type No enumeration 0 (Absolute)
  • Page 420 Chapter 6 Multi-Axis Coordinated Motion Instructions Jerk Units Unitspersec %ofmaximum %oftime 2 (use this value to get started) unitspermasterunit3 %oftimemasterdriven Termination Type No enumeration 0 = Actual Tolerance 1 = No Settle 2 = Command Tolerance 3 = No Decel 4 = Follow Contour Velocity Constrained 5 = Follow Contour Velocity Unconstrained 6 = Command Tolerance Programmed...
  • Page 421 Multi-Axis Coordinated Motion Instructions Chapter 6 Motion Control The following control bits are affected by the MCCM instruction. Mnemonic Description .EN (Enable) Bit 31 The Enable bit is set when the rung transitions from false to true and resets when the rung goes from true to false. .DN (Done) Bit 29 The Done bit sets when the coordinated instruction has been verified and queued successfully.
  • Page 422 Chapter 6 Multi-Axis Coordinated Motion Instructions in the same manner as with linear axes. When the axis position exceeds the Unwind parameter, an error is generated. • The sign of the specified position array is interpreted by the controller as the direction for the move.
  • Page 423 Multi-Axis Coordinated Motion Instructions Chapter 6 Via/Center/Radius Depending on the selected Move Type and Circle Type, the via/center/radius position parameter defines the absolute or incremental value of a position along the circle, the center of the circle, or the radius of the circle as defined in the following table.
  • Page 424 Chapter 6 Multi-Axis Coordinated Motion Instructions Direction The Direction operand defines the rotational direction of a 2D circular move as either clockwise or counterclockwise according to the right-hand screw rule. For a 3D circular move the direction is either Shortest or Longest. In both 2D and 3D it can also indicate if the circular move is to be a full circle.
  • Page 425 Multi-Axis Coordinated Motion Instructions Chapter 6 Accel Jerk Accel Jerk defines the maximum acceleration jerk for the programmed move. For more information on calculating Accel Jerk, refer to the Jerk Units section below. Decel Jerk Decel Jerk defines the maximum deceleration jerk for the programmed move. For more information on calculating Decel Jerk, refer to the Jerk Units section below.
  • Page 426 Chapter 6 Multi-Axis Coordinated Motion Instructions Important Consideration If you program tangent circles with different Jerk rates (Decel Jerk of first circle and Accel Jerk of the second circle), then you might get a slight velocity discontinuity at the intersection of the two circles. The size of the discontinuity depends on magnitude of the Jerk difference.
  • Page 427 Multi-Axis Coordinated Motion Instructions Chapter 6 • If a Command Tolerance value of 100% is used for the last in the sequence then: SafetyMargin3 = CUP * MAS else SafetyMargin3 = CUP * MAS * .02 • Final SafetyMargin = SafetyMargin1 + SafetyMargin2 + SafetyMargin3 Once a sequence is programmed and verified, it will repeat.
  • Page 428 Chapter 6 Multi-Axis Coordinated Motion Instructions Merge Speed The Merge Speed operand defines whether the current speed or the programmed speed is used as the maximum speed along the path of the coordinated move when Merge is enabled. Current speed is the vector sum of all motion (for example, jogs, MAM’s, and geared motion) for all axes defined in the current coordinate system.
  • Page 429 Multi-Axis Coordinated Motion Instructions Chapter 6 Target Position Entry Dialog Box Fields Feature Description Axis Name This column has the names of each axis in the coordinate system named in the ladder faceplate. These names are not editable. Target Position/Target Increment The values in this column are numeric.
  • Page 430 Chapter 6 Multi-Axis Coordinated Motion Instructions Absolute Radius Target column is entitled Target Position. Radius column is entitled Radius. Set Targets = Actuals button is active. Set Vias = Actuals button is inactive (appears dimmed). Incremental Radius Target column is entitled Target Increment. Radius Column is entitled Radius.
  • Page 431 Multi-Axis Coordinated Motion Instructions Chapter 6 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.
  • Page 432 Chapter 6 Multi-Axis Coordinated Motion Instructions Referenced Error Code and Extended Error Instruction Parameter Description Number Numeric Indicator Parameter Out Of Range (13) Coordinate System Number of primary axes is not 2 or 3. Parameter Out Of Range (13) Move Type Move Type is either less than 0 or greater than 1.
  • Page 433 Multi-Axis Coordinated Motion Instructions Chapter 6 Coordinate System Status Bits Bit Name Meaning MotionStatus Sets when the MCCM instruction is active and the Coordinate System is connected to its associated axes. Coordinated Motion Status Bits Bit Name Meaning AccelStatus Sets when vector is accelerating. Clears when a blend is in process or when vector move is at speed or decelerating.
  • Page 434 Chapter 6 Multi-Axis Coordinated Motion Instructions CoorMotionLockStatus Set when an axis lock is requested for an MCLM or MCCM instruction and the axis has crossed the Lock Position. Cleared when an MCLM or MCCM is initiated. For the enumerations Immediate Forward Only and Immediate Reverse Only, the bit is set immediately when the MCLM or MCCM is initiated.
  • Page 435 Multi-Axis Coordinated Motion Instructions Chapter 6 Example 1 Ladder Diagram Example 2 Via/Center/Radius parameter as an array type. Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 436 Chapter 6 Multi-Axis Coordinated Motion Instructions Ladder Diagram Structured Text MCCM(myMccmCoordinateSystem, myMccmMotionControl, myMccmMoveType, myMccmPosition[0], myMccmCircleType, myMccmRadius[0], myMccmDirection, myMccmSpeed, Unitspersec, myMccmAccelRate, Unitspersec2, myMccmDecelRate, Unitspersec2, Trapezoidal, 100.0, 100.0, %ofTime, myMccmTermType, CoordinatedMotion, Programmed, 0, 0, None, 0, 0); See also Structured Text Syntax page 635 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 437: Motion Coordinated Linear Move (Mclm)

    Multi-Axis Coordinated Motion Instructions Chapter 6 Motion Error Codes (.ERR) page 557 Multi-Axis Coordinated Motion Instructions page 345 Common Attributes page 663 Motion Coordinated Linear This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Move (MCLM) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
  • Page 438 Chapter 6 Multi-Axis Coordinated Motion Instructions Available Languages Ladder Diagram Function Block This instruction is not available in function block. Structured Text MCLM (CoordinateSystem, MotionControl, MoveType, Position, Speed, Speedunits, Accelrate, Accelunits, Decelrate, Decelunits, Profile, Acceljerk, Deceljerk, Jerkunits, TerminationType, Merge, Mergespeed, CommandTolerance,LockPosition, LockDirection, EventDistance, CalculatedData);...
  • Page 439 Multi-Axis Coordinated Motion Instructions Chapter 6 Operands There are data conversion rules for mixed data types within an instruction. See Data Conversion. Ladder Diagram and Structured Text The Motion Coordinated Linear Move (MCLM) instruction performs a linear move using up to three (3) axes statically coupled as primary axes in a Cartesian coordinate system.
  • Page 440 Chapter 6 Multi-Axis Coordinated Motion Instructions the Accel and Decel Jerk Decel Jerk SINT, INT, DINT, or REAL Immediate or Tag operands. This instruction only uses the values if the Profile Jerk Units SINT, INT, or DINT Immediate operand is configured as S-curve. Enter the jerk rates in these Jerk Units.
  • Page 441 Multi-Axis Coordinated Motion Instructions Chapter 6 Lock Direction UINT32 Immediate Specifies the conditions when the Lock Position should be used. See the Structure section below for more information. Event Distance REAL ARRAY or 0 Array Tag The position(s) on a move measured from the end of the move.
  • Page 442 Chapter 6 Multi-Axis Coordinated Motion Instructions Accel Jerk No enumeration Immediate or tag You must always enter a value for the Accel and Decel Jerk operands. This instruction only uses the values if the Profile is configured as S-curve. Use these values to get started. Decel Jerk No enumeration Accel Jerk = 100 (% of Time)
  • Page 443 Multi-Axis Coordinated Motion Instructions Chapter 6 Motion Control The following control bits are affected by the MCLM instruction. Mnemonic Description .EN (Enable) Bit 31 The Enable bit is set when the rung transitions from false to true and resets when the rung goes from true to false.
  • Page 444 Chapter 6 Multi-Axis Coordinated Motion Instructions Move Type The Move Type operand specifies the method used to indicate the coordinated move path. The Move Type can be either Absolute or Incremental. • Absolute - the axes move via a linear path to the position defined by the position array at the Speed, Accel Rate and Decel Rate as specified by the operands.
  • Page 445 Multi-Axis Coordinated Motion Instructions Chapter 6 Speed Units The Speed Units operand defines the units applied to the Speed operand either directly in coordinate units of the specified coordinate system or as a percentage of the maximum values defined in the coordinate system. Accel Rate The Accel Rate operand defines the maximum acceleration along the path of the coordinated move.
  • Page 446 Chapter 6 Multi-Axis Coordinated Motion Instructions Velocity Profile Effects Profile ACC/DEC Motor Priority of control Highest to Lowest Trapezoidal Fastest Worse Acc/Dec Velocity Position S-Curve 2X Slower Best Jerk Acc/Dec Velocity Position Trapezoidal The trapezoidal velocity profile is the most commonly used profile since it provides the most flexibility in programming subsequent motion and the fastest acceleration and deceleration times.
  • Page 447 Multi-Axis Coordinated Motion Instructions Chapter 6 • MAJ • MCS • MAM • MCCD • MAS • MCCM • MCD • MCLM The calculated Jerk Rate produces triangular acceleration and deceleration profiles, as shown in the following diagram. S-curve Accel/Decel Time For an S-curve move, the Jerk rate is determined based on the programmed velocity, acceleration, and deceleration values, not on the length of the move.
  • Page 448 Chapter 6 Multi-Axis Coordinated Motion Instructions Accel Jerk Accel Jerk defines the maximum acceleration jerk for the programmed move. For more information on calculating Accel Jerk, refer to the Jerk Units section below. Decel Jerk Decel Jerk defines the maximum deceleration jerk for the programmed move. For more information on calculating Decel Jerk, refer to the Jerk Units section below.
  • Page 449 Multi-Axis Coordinated Motion Instructions Chapter 6 SafetyMargin1 = CUP * MAS else SafetyMargin1 = CUP * MAS * .02 2. For all other moves in the blending sequence between first and last: SafetyMargin2 = CUP * MAS * .02 * number of blending moves between 1st and last 3.
  • Page 450 Chapter 6 Multi-Axis Coordinated Motion Instructions the activation of this instruction, and will result in superimposed motion on the affected axes. • All Motion Any currently executing single axis motion instructions involving any axes defined in the specified coordinate system and any currently executing coordinated motion instructions are terminated.
  • Page 451 Multi-Axis Coordinated Motion Instructions Chapter 6 calculated from point C (the point of the merge). However, a circle must exist from point F (the calculated end of the deceleration) to the end of the merged move. Merging in Incremental Mode The Merge for coordinated motion operates differently from a merge on an MAM.
  • Page 452 Chapter 6 Multi-Axis Coordinated Motion Instructions Feature Description Axis Name These fields list the names of each axis contained in the Coordinate System. You cannot alter the axis names in this dialog. Target Position/Target Increment This field contains the endpoint or increment of the coordinated move as specified in the instruction faceplate.
  • Page 453 Multi-Axis Coordinated Motion Instructions Chapter 6 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.
  • Page 454 Chapter 6 Multi-Axis Coordinated Motion Instructions Referenced Error Code and Extended Error Instruction Parameter Description Number Numeric Indicator Parameter Out Of Range (13) Move Type Move Type is either less than 0 or greater than Parameter Out Of Range (13) Position The position array is not large enough to provide positions for all the axes in the...
  • Page 455 Multi-Axis Coordinated Motion Instructions Chapter 6 Coordinate System Status Bits Bit Name Meaning MotionStatus Sets when the MCLM instruction is active and the Coordinate System is connected to its associated axes. Coordinated Motion Status Bits Bit Name Meaning AccelStatus Sets when vector is accelerating. Clears when a blend is in process or when vector move is decelerating.
  • Page 456 Chapter 6 Multi-Axis Coordinated Motion Instructions CoordinateSystemLockStatus Set when an axis lock is requested for an MCLM or MCCM instruction and the axis has crossed the Lock Position. Cleared when an MCLM or MCCM is initiated. For the enumerations Immediate Forward Only and Immediate Reverse Only, the bit is set immediately when the MCLM or MCCM is initiated.
  • Page 457 Multi-Axis Coordinated Motion Instructions Chapter 6 Examples Ladder Diagram Structured Text MCLM(myMclmCoordinateSystem, myMclmMotionControl, myMclmMoveType, myMclmPosition[0], myMclmSpeed, Unitspersec, myMclmAccelRate, Unitspersec2, myMclmDecelRate, Unitspersec2, Trapezoidal, 100.0, 100.0, %ofTime, myMclmTermType, CoordinatedMotion, Programmed, 0, 0, None, 0, 0); See also Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 458: Motion Coordinated Shutdown (Mcsd)

    Chapter 6 Multi-Axis Coordinated Motion Instructions Multi-Axis Coordinated Motion Instructions page 345 Common Attributes page 663 Data Conversions page 669 Motion Coordinated This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Shutdown (MCSD) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers.
  • Page 459 Multi-Axis Coordinated Motion Instructions Chapter 6 Operands Ladder Diagram and Structured Text Operand Type Format Description Coordinate System COORDINATE_SYSTEM Coordinated group of axes. Motion Control MOTION_INSTRUCTION Structure used to access instruction status parameters. See Structured Text Syntax for more information on the syntax of expressions within structured text.
  • Page 460 Chapter 6 Multi-Axis Coordinated Motion Instructions Master Driven Speed Control (MDSC) and the MCSD Instruction When the coordinate system is shut down: • The IP bit of the Master Driven Coordinate Control (MDCC) instruction is reset on an axis that is shutdown. •...
  • Page 461 Multi-Axis Coordinated Motion Instructions Chapter 6 Axis Status Bits Bit Name Meaning CoordinatedMoveStatus Cleared Coordinate System Status Bits Bit Name Meaning ShutdownStatus Sets when MCSD is executed and all associated axes are shutdown. ReadyStatus Cleared after MCSD executes. Coordinated Motion Status Bits Bit Name Meaning AccelStatus...
  • Page 462: Motion Coordinated Shutdown Reset (Mcsr)

    Chapter 6 Multi-Axis Coordinated Motion Instructions Motion Coordinated Shutdown This information applies to the CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Reset (MCSR) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Use the Motion Coordinated Shutdown Reset (MCSR) instruction to reset all axes in a coordinate system.
  • Page 463 Multi-Axis Coordinated Motion Instructions Chapter 6 Coordinate System The Coordinate System operand specifies the set of motion axes that define the dimensions of a Cartesian coordinate system. For this release the coordinate system supports up to three (3) primary axes. Only the axes configured as primary axes (up to 3) are included in the coordinate velocity calculations.
  • Page 464 Chapter 6 Multi-Axis Coordinated Motion Instructions 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. MCSR Changes to Status Bits: Status Bits provide a means for monitoring the progress of the motion instruction.
  • Page 465: Motion Coordinated Stop (Mcs)

    Multi-Axis Coordinated Motion Instructions Chapter 6 See also Structured Text Syntax page 635 Motion Error Codes (.ERR) page 557 Multi-Axis Coordinated Motion Instructions page 345 Common Attributes page 663 Structured Text Syntax page 635 Motion Coordinated Stop (MCS) 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.
  • Page 466 Chapter 6 Multi-Axis Coordinated Motion Instructions Important: Risk of Velocity and/or End Position Overshoot If you change move parameters dynamically by any method, that is by changing move dynamics (MCD or MCCD) or by starting a new instruction before the last one has completed, be aware of the risk of velocity and/or end position overshoot.
  • Page 467 Multi-Axis Coordinated Motion Instructions Chapter 6 Ladder Diagram and Structured Text Operand Type Format Description Coordinate System COORDINATE_SYSTEM Name of the coordinate system. Motion Control MOTION_INSTRUCTION Control tag for the instruction. Stop Type DINT Immediate If you want to Choose this Stop Type Stop all motion for the axes All (0) - For each axis, all of the coordinate system...
  • Page 468 Chapter 6 Multi-Axis Coordinated Motion Instructions Change Decel Jerk SINT, INT, or DINT Immediate 0 = No 1 = Yes Decel Jerk SINT, INT, DINT, or REAL Immediate or You must always enter a value for the Decel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve.
  • Page 469 Multi-Axis Coordinated Motion Instructions Chapter 6 Coordinated Transform This stop type cancels the transforms associated with the specified coordinate system. All transform-related motion stops on all associated target coordinate systems. However, source coordinate axes will continue to move as instructed. Example If four coordinate systems are linked via three transforms.
  • Page 470 Chapter 6 Multi-Axis Coordinated Motion Instructions The MCS All instruction clears the pending Master Axis for all future coordinated motion instructions. However, MCS ALL on the Master axis does not break the MDSC link. The AC bit of the MDCC instruction is reset when the axis is stopped. The instruction queue is cleared when an MCS All or MCS Coordinated is executed (goes IP).
  • Page 471 Multi-Axis Coordinated Motion Instructions Chapter 6 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.
  • Page 472 Chapter 6 Multi-Axis Coordinated Motion Instructions How Stop Types Affect Transforms an Axis Motion Example Suppose you have this situation. Where: • Coordinate system 1 (CS1) contains the X, Y, and Z axes. • Coordinate system 2 (CS2) contains the Y, Z, and S axes. •...
  • Page 473 Multi-Axis Coordinated Motion Instructions Chapter 6 MCS on CS2 The MCLM instruction on CS2 will stop. The MAM on Y will stop. The MAM on S will stop. The MAM on Z will continue. T1 is canceled. Axes ABC will stop due to canceling the transform. MCS on CS3 The MCLM instruction on CS2 will continue.
  • Page 474 Chapter 6 Multi-Axis Coordinated Motion Instructions MAS on Y Move The MCLM instruction on CS2 will continue. The MAM on Y will stop. The MAM on S will continue. The MAM on Z will continue. T1 stays active. Axes ABC will follow the respective CS2 axes. MAS on Z The MCLM instruction on CS2 will continue.
  • Page 475 Multi-Axis Coordinated Motion Instructions Chapter 6 Example Ladder Diagram Structured Text MCS(myMcsCoordinateSystem,myMcsMotionControl,All,Yes,myMcsDecelRat e,Unitspersec2,Yes,100.0,%ofTime); See also Common Action Table for Slave and Master Axis page 531 Motion Error Codes (.ERR) page 557 Multi-Axis Coordinated Motion Instructions page 345 Common Attributes page 663 Data Conversions page 669 Structured Text Syntax...
  • Page 476: Motion Coordinated Transform (Mct)

    Chapter 6 Multi-Axis Coordinated Motion Instructions This information applies to the CompactLogix 5370, ControlLogix 5570, Motion Coordinated Compact GuardLogix 5370, GuardLogix 5570, Compact GuardLogix 5380, Transform (MCT) CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers. Important: You can use this instruction with the following controllers: 1756-L6 controllers 1756-L7 controllers 1756-L7S controllers...
  • Page 477 Multi-Axis Coordinated Motion Instructions Chapter 6 Operands Ladder Diagram and Structured Text Operand Type Format Description Source System COORDINATE_SYSTEM Coordinate system that you use to program the moves. Typically this is the Cartesian coordinate system. Target System COORDINATE_SYSTEM Non-Cartesian coordinate system that controls the actual equipment Motion Control MOTION_INSTRUCTION...
  • Page 478 Chapter 6 Multi-Axis Coordinated Motion Instructions MOTION_INSTRUCTION Data Type To see if Check if this Data Type Notes bit is on The rung is true 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.
  • Page 479 Multi-Axis Coordinated Motion Instructions Chapter 6 Data Flow When a Move is executed with an MCT Instruction - Forward Transform Data Flow When a Move is Executed with an MCT Instruction - Inverse Transform Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 480 Chapter 6 Multi-Axis Coordinated Motion Instructions Programming Guidelines Follow these guidelines to use an MCT instruction. Important: Do not let the robot get fully stretched or fold back on itself. Otherwise it can start to move at a very high speed. In those positions, it loses its configuration as a left or right arm.
  • Page 481 Multi-Axis Coordinated Motion Instructions Chapter 6 Important: You may see truncation error in the precision of computations. This happens when both of these conditions are true: • The conversion constants of the virtual Cartesian axes in a transformation are small, such as 8000 counts/position unit.
  • Page 482 Chapter 6 Multi-Axis Coordinated Motion Instructions Move the robot to a left- or right-arm starting position Do you want the robot to move like a left arm or a right arm? Before you start the transform, move the robot to a resting position that gives it the arm side that you want (left or right).
  • Page 483 Multi-Axis Coordinated Motion Instructions Chapter 6 In structured text, condition the instruction so that it only executes on a transition Start the transform before you start any motion. In structured text, instructions execute each time they are scanned. Condition the instruction so that it only executes on a transition.
  • Page 484 Chapter 6 Multi-Axis Coordinated Motion Instructions Then, execute the instruction again. To execute the instruction, toggle the rung-condition-in from false to true. If you change the geometry of the equipment, execute the instruction again. Specify and execute more than one orientation angle in the Orientation operand of the MCTP instruction The rotations around X, Y, Z are entered in the following order: The first element from the first MCTP orientation operand array is used to...
  • Page 485 Multi-Axis Coordinated Motion Instructions Chapter 6 The second element from the second MCTP orientation operand is used to specify Y rotation. The third element from the third MCTP orientation operand is used to specify Z rotation. Example The following table shows before and after rotation orders. Note that the order of rotations in n-Dimensions is not commutative.
  • Page 486 Chapter 6 Multi-Axis Coordinated Motion Instructions MCT Instruction Guidelines Affects Math Status Flags 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.
  • Page 487 Multi-Axis Coordinated Motion Instructions Chapter 6 Extended Error Codes See Motion Error Codes (ERR) for Motion Instructions. Use Extended Error Codes (EXERR) for more instruction about an error. EXERR Corrective Action Notes Assign both coordinate systems to the motion group. Check that you are using the correct source You cannot use the same coordinate system as and target systems.
  • Page 488 Chapter 6 Multi-Axis Coordinated Motion Instructions Changes to Status Bits The instruction changes these status bits when it executes. To see if Check the tag for the And this bit A coordinate system is the source of an active Coordinate System TransformSourceStatus transform.
  • Page 489: Speed, Acceleration, Deceleration, And Jerk Enumerations For Coordinated Motion

    Multi-Axis Coordinated Motion Instructions Chapter 6 Speed enumerations Speed, acceleration, deceleration, and jerk Common enumerations are used for the speed parameter of all motion enumerations for instructions. Some instructions accept only limited subset of the speed coordinated motion enumerations. Checks for valid unit combinations are done at instruction execution time.
  • Page 490 Chapter 6 Multi-Axis Coordinated Motion Instructions Acceleration and deceleration enumerations The following enumerations are defined for Acceleration and Deceleration Unit parameters for motion instructions. Enumeration Description Mode Compatibility Notes Units per sec2 % Maximum Existing Enumeration Time Reserved for Time based programming Reserved Existing Enumeration Reserved...
  • Page 491 Multi-Axis Coordinated Motion Instructions Chapter 6 • If Speed units are Master units, then acceleration, deceleration, and jerk units must be Master units too. • All unsupported unit combinations result in an error at runtime when the instruction is executed. Jerk enumerations The following enumerations are defined for time driven and MDSC driven Jerk units.
  • Page 492 Chapter 6 Multi-Axis Coordinated Motion Instructions Seconds Not Implemented Not Implemented Not Implemented (Time Driven Mode Units) Units per MasterUnits (Master Driven Mode Units) % of Time-Master Driven Incompatible combinations of Time and Incompatible combinations of Time and Master Driven Mode. An error occurs when (Master Driven Master Driven Mode.
  • Page 493 Multi-Axis Coordinated Motion Instructions Chapter 6 The following table shows acceptable combinations of Acceleration Units and Jerk Units when Speed Units are in Seconds. Acceleration (Speed in Seconds) Units per sec % Maximum Units per MasterUnit2 Master Units Seconds (Time Driven (Time Driven (Master Driven (Master Driven...
  • Page 494: Returned Calculated Data Parameter For Coordinated System Motion Instruction

    Chapter 6 Multi-Axis Coordinated Motion Instructions The following table shows acceptable combinations of Acceleration Units and Jerk Units when Speed is in Master Units. Acceleration (Speed in MasterUnits) Units per sec % Maximum Units per MasterUnit Master Units Seconds (Time Driven (Time Driven (Master Driven (Master Driven...
  • Page 495 Multi-Axis Coordinated Motion Instructions Chapter 6 Mode Returned Calculated Data Parameter Master The returned Calculated Data parameter is the incremental delta Master position that is needed to make the Slave Coordinate System move from the point at which Driven Slave Coordinate System is locked to the Master and starts moving along the programmed path to the point where distance to go is less than the specified Event Distance.
  • Page 496: Status Bits For Motion Instructions (Mclm, Mccm) When Mdcc Is Active

    Chapter 6 Multi-Axis Coordinated Motion Instructions See also Input and Output Parameters Structure for Coordinate System Motion Instructions page 511 Status Bits for Motion The following table describes the predefined data type status bits for motion instruction MCLM and MCCM. Instructions (MCLM, MCCM) when MDCC Is Active Bit Name...
  • Page 497 Multi-Axis Coordinated Motion Instructions Chapter 6 CalculatedDataAvailable Indicates that the requested data has been returned in the Calculated Data array element and that the Logix Designer application has updated the output data in the Calculated Data parameter. Only one status bit is used to indicate all Calculated Data is available.
  • Page 498 Chapter 6 Multi-Axis Coordinated Motion Instructions Coordinated Motion Status Bits Bit Name Meaning CoordinateMotionStatus Set when an axis lock is requested for an MCLM or MCCM instruction and the axis has crossed the Lock Position. Cleared when an MCLM or MCCM is initiated. AccelStatus Sets when vector is accelerating.
  • Page 499: Change Between Master Driven And Time Driven Modes For Coordinated Motion Instructions

    Multi-Axis Coordinated Motion Instructions Chapter 6 Change between master driven Changing the motion mode between Master Driven and Time Driven Mode and vice versa is automatically performed when another motion instruction (such as, and time driven modes for MCLM and MCCM) is activated if the new instruction has been programmed in Coordinated Motion a different mode than the active motion instruction.
  • Page 500: Choose A Termination Type

    Chapter 6 Multi-Axis Coordinated Motion Instructions If the second Master Axis is moving while the transfer is being made, then you may look at the TrackingMaster instruction status bit of the motion instruction that is performing the transfer to determine when the transfer is finished. This bit is set when the acceleration or deceleration on the Slave Coordinate System is complete.
  • Page 501 Multi-Axis Coordinated Motion Instructions Chapter 6 accelerate or decelerate across multiple moves. 5 - Follow Contour Velocity Unconstrained use a specified Command Tolerance The command position gets within the Command 6 - Command Tolerance Position Tolerance of the coordinate system. Programmed To make sure that this is the right choice for you: •...
  • Page 502 Chapter 6 Multi-Axis Coordinated Motion Instructions 2, 6 - Command Tolerance The instruction stays active until the command position gets within the Command Tolerance of the Coordinate System. At that point, the instruction is complete and a queued MCLM or MCCM instruction can start. If you don’t have a queued MCLM or MCCM instruction, the axes stop at the target position.
  • Page 503 Multi-Axis Coordinated Motion Instructions Chapter 6 5 - Follow Contour Velocity This termination type is similar to the contour velocity Unconstrained constrained. It has these differences: • Use this termination type to get a triangular velocity profile across several moves. This reduces jerk. •...
  • Page 504 Chapter 6 Multi-Axis Coordinated Motion Instructions Velocity Profile of Two Collinear Moves When the Second Move has a Lower Velocity than the First Move and Termination Type 2 or 6 is Used The following illustration show the velocity profile of two collinear moves using a Command Tolerance (2) termination type.
  • Page 505 Multi-Axis Coordinated Motion Instructions Chapter 6 Velocity Profile of Two Collinear Moves When the Second Move has a Lower Velocity than the First Move and Termination Type 3, 4, or 5 is Used This illustration shows a velocity profile of two collinear moves. The second MCLM instruction has a higher velocity than the first MCLM instruction and one of these termination types are used: •...
  • Page 506 Chapter 6 Multi-Axis Coordinated Motion Instructions Refer to the following Example of a Symmetric Profile for more details. Important: We recommend that you terminate any sequence of moves by either Termination Type 0 or 1, that is, TT0 or TT1. To guarantee that your trajectory is symmetric, you must terminate any sequence of moves by either Termination Types 0 or 1.
  • Page 507 Multi-Axis Coordinated Motion Instructions Chapter 6 controller to optimize the velocity profile, reduce the CPU load, and guarantee a symmetric profile. How To Get a Triangular Velocity Profile If you want to program a pick and place action in four moves, minimize the Jerk rate, and use a triangular velocity profile.
  • Page 508 Chapter 6 Multi-Axis Coordinated Motion Instructions Termination Type 5 The axes accelerate to the speed that you want. You must calculate the starting speed for each move in the deceleration-half of the profile. Blending Moves at Different Speeds You can blend MCLM and MCCM instructions where the vector speed of the second instruction is different from the vector speed of the first instruction.
  • Page 509: Common Action Table For Slave Coordinate System And Master Axis

    Multi-Axis Coordinated Motion Instructions Chapter 6 Faster 2 - Command Tolerance 3 - No Decel 6 - Command Tolerance Programmed 4 - Contour Velocity Constrained 5 - Contour Velocity Unconstrained Common Action Table for All commands in the following table are for the Slave Coordinate System. Slave Coordinate System Instruction Parameters...
  • Page 510 Chapter 6 Multi-Axis Coordinated Motion Instructions Status Only Not Changed Stop Motion Reset Fault Action Disable DRV Reset Shutdown Reset Note that if the same Slave Coordinate System is controlled by multiple Master Axes, if one MDCC relationship that contains the Slave Coordinate System is broken, then all MDCC relationships that contain the Slave Coordinate System will be broken.
  • Page 511: Input And Output Parameters Structure For Coordinate System Motion Instructions

    Multi-Axis Coordinated Motion Instructions Chapter 6 Input and Output Parameters The middle column of the table below identifies which parameter is applicable to each coordinate system motion instruction, that is, to MCLM and MCCM. Structure for Coordinate System Before any of the parameters identified in the first column below may be used in Motion Instructions the MCLM or MCCM instruction, you must execute an MDCC instruction and it must be active (IP bit is set).
  • Page 512 Chapter 6 Multi-Axis Coordinated Motion Instructions Enumeration Definition Description None Indicates that the Lock Position is not active. If Lock Direction is set to None and the Master Driven mode is selected by the speed parameter of the motion instruction, the system will error. Conversely, if Lock direction is not set to a value other than None and the speed parameter units indicate Time Driven mode, an error is also...
  • Page 513 Multi-Axis Coordinated Motion Instructions Chapter 6 Lock Position Data Type Description Valid Default Values Lock Position in Master Driven Mode Default = 0.0 IMMEDIATE The position on the Master Axis where a Slave Coordinate System should start after the move has been initiated on the Slave Coordinate System when executing in Master Driven Mode.
  • Page 514 Chapter 6 Multi-Axis Coordinated Motion Instructions Command Tolerance Data Type Description Valid Default Values The position on a coordinated move where blending should start. Valid = 0.0 IMMEDIATE When Termination Type 6 is used, the Command Tolerance on the instruction faceplate is used REAL or instead of the value for the Command Tolerance that is configured in the Coordinate System.
  • Page 515 Multi-Axis Coordinated Motion Instructions Chapter 6 Output Parameters The following describes the output parameters. Calculated Data Data Type Description Valid and Default Values REAL This is the Master Distance(s) (or time) needed for the Slave Coordinated System to travel from the beginning of the move to the Default = 0 (no Calculated ARRAY or 0 Event Distance point.
  • Page 516 Chapter 6 Multi-Axis Coordinated Motion Instructions If a MCD or MCCD is executed (indicated by status bit going IP), the CalculatedDataAvailable (CDA) bit will be cleared. The Calculated Data for the move will be recomputed using the new dynamics parameters. Only those items of the Calculated Data array whose Event Distance hasn’t been reached yet are recomputed;...
  • Page 517 Multi-Axis Coordinated Motion Instructions Chapter 6 Master Distance (X in the diagram) needed for the slave to move 15.0 units starting when the Master is locked at a position at 8.0. The incremental value of X is returned in the Calculated Data parameter.
  • Page 518 Chapter 6 Multi-Axis Coordinated Motion Instructions 5 Move Segments are specified Event Distance = ED Command Tolerance = CT • MCLM1 Y100; TT2 ED=50 CT=100 • MCLM2 X200; TT2 ED=100 CT=20 • MCLM3 Y-100; TT1 ED=100 CT=20 • MCLM4 X200; TT2 ED=100 CT=20 •...
  • Page 519: Returned Calculated Data Parameter For Coordinated System Motion Instruction

    Multi-Axis Coordinated Motion Instructions Chapter 6 Returned Calculated Data Parameter for The returned Calculated Data value for Coordinated System Motion instructions is outlined in the table. Coordinated System Motion Instruction Mode Returned Calculated Data Parameter Master Driven The returned Calculated Data parameter is the incremental delta Master position that is needed to make the Slave Coordinate System move from the point at which Slave Coordinate System is locked to the Master and starts moving along the programmed path to the point where distance to go is less than the specified Event Distance.
  • Page 520 Chapter 6 Multi-Axis Coordinated Motion Instructions Time Driven The returned data in the Calculated Data parameter is the total time in seconds that is needed to make the Slave Coordinate System move from the move’s start point to a point where distance to go is less than the specified Event Distance. If the specified data in the Event Distance is array element is 0.0, then the time it takes the entire move to complete is returned.
  • Page 521: Mdsc Functionality

    Chapter 7 MDSC Functionality The Master Driven Speed Control (MDSC) function provides the ability to synchronize one or more motion axes to a common Master Axis. The MDSC uses the Motion Master Driven Axis Control (MDAC) instruction, which assigns a Master:Slave relationship for single axes.
  • Page 522 Chapter 7 MDSC Functionality Function Block This instruction is not available in function block. Structured Text MDAC (SlaveAxis, MasterAxis, MotionControl, MotionType, MasterReference); Operands Ladder Diagram Operand Type Type Format Description CompactLogix 5380, CompactLogix 5370, CompactLogix 5480, ControlLogix 5570, Compact ControlLogix 5580, Compact GuardLogix 5370, and GuardLogix 5380, and GuardLogix 5570 controllers...
  • Page 523 MDSC Functionality Chapter 7 Master Axis AXIS_CONSUMED AXIS_CONSUMED Any configured Single Axis that the Slave Axis follows. AXIS_CIP_DRIVE AXIS_SERVO The Master Axis can be any AXIS_VIRTUAL AXIS_SERVO_DRIVE axis that has been configured. AXIS_GENERIC Ellipsis launches Axis AXIS_GENERIC_DRIVE properties dialog. AXIS_CIP_DRIVE AXIS_VIRTUAL Motion Control MOTION_INSTRUCTION MOTION_INSTRUCTION...
  • Page 524 Chapter 7 MDSC Functionality • On the Master Axis: MASD, MCSD, or MGSD If there is an active MDAC (All) on a Slave, then setting the MDAC instruction to a Motion Type other than All causes a runtime error. To be able to reassign the Master once anything other than the All option is used, you must execute any of the following: •...
  • Page 525 MDSC Functionality Chapter 7 Use different control words on all MDAC instructions. If the same control word is used for the active and pending MDAC, the IP bit of the pending MDAC will not work properly. When separate axis control words are used for the active and the pending MDAC instructions, the active and the pending MDAC will both have their IP bits set.
  • Page 526 Chapter 7 MDSC Functionality See Structured Text Syntax for more information on the syntax of expressions within structured text. Note that you have the option to browse for enumerations in the Structured Text Editor as shown in the following. MOTION_INSTRUCTION Bit Leg Definitions for MDAC Mnemonic Description .EN (Enable) Bit 31...
  • Page 527 MDSC Functionality Chapter 7 A MATC with an Execution Schedule of Pending always uses the Instruction mode of the active MATC; Lock Position and Lock Direction are ignored. This is explained further in the following example. Assume that there are four instructions executed in the following order: •...
  • Page 528 Chapter 7 MDSC Functionality Structured Text Condition/State Action Taken Prescan See Prescan in the Ladder Diagram table. Normal execution See Rung-condition-in is false in the Ladder Diagram table. Postscan See Postscan in the Ladder Diagram table. Error Codes See Motion Error Codes (.ERR) for run time errors for motion instructions when MDAC is active.
  • Page 529: Changing Between Master Driven And Time Driven Modes For Single Axis Motion Instructions

    MDSC Functionality Chapter 7 Example 2 Ladder Diagram See also Common Action Table for Slave and Master Axis page 531 Motion Error Codes (.ERR) page 557 Motion Move Instructions page 83 Structured Text Syntax page 635 Common Attributes page 663 Changing Between Master Changing the motion mode between Master Driven and Time Driven mode and vice versa is automatically performed when a new motion instruction, such as,...
  • Page 530 Chapter 7 MDSC Functionality Different Time Driven and Master Driven modes can be used for different motion types for superimposed motion. For example, the MAM can be in Time Drive mode and the MAJ can be in Master Driven mode for the same Slave Axis. Changing the Master Axis The following sequence of events must be followed to transfer a Slave Axis from one Master Axis to a second Master Axis:...
  • Page 531: Common Action Table For Slave And Master Axis

    MDSC Functionality Chapter 7 When the acceleration of the Tracking Master bit in the instruction Control Word is cleared, it is not sensitive to the acceleration due to the master being accelerated. The master is only sensitive to the acceleration of the slave caused by a programmed change in the speed of two successive instructions.
  • Page 532 Chapter 7 MDSC Functionality The MDAC link is broken when the following instructions are executed on the slave axis: • MAS (All), MCS (All), MGS, MASD, MCSD, MGSD, a mode change. • The MAS (anything other than All) and MCS (coordinated) do not break the MDAC link.
  • Page 533: Input And Output Parameters Structure For Single Axis Motion Instructions

    MDSC Functionality Chapter 7 The MDAC link is broken on the Master Axis when the following instructions are executed on the Master Axis: • MASD, MCSD, and MGSD. The MAS and MCS instructions for any • Stop Type, including All, do not break the MDAC link. •...
  • Page 534 Chapter 7 MDSC Functionality MDSC Lock Direction Parameter Description Input Data Type Description Value Parameter Lock Direction Immediate This parameter is used for both Time Driven and Default = 0 Master Driven mode. In master driven mode the Lock 0 = None Direction is used by the axis specified as the Master 1 = Immediate For ward Only Axis in the MDAC instruction.
  • Page 535 MDSC Functionality Chapter 7 Input Parameter Data Type Description Value Lock Position IMMEDIATE REAL or Lock Position in Master Driven Mode Default = 0 After the slave axis motion has been initiated by a MAM or MATC, it goes IP but does not start moving until the master axis crosses the Master Lock Position.
  • Page 536 Chapter 7 MDSC Functionality Event Distance The position(s) on a move measured from the end of the move. Default = 0 ARRAY This is an array of input values that specifies the incremental distances along the move on the Slave. Each member of No Event the array is measured as follows: Distance...
  • Page 537 MDSC Functionality Chapter 7 Output Parameter Description Output Data Type Description Value Parameter Calculated Data REAL The calculated output for the Event Distance input parameter, that is the Master Distance(s) (or time) Default = 0 measured from the beginning of the move to the Event Distance point. No calculated Data array or a ARRAY or 0 The returned Calculated Data value is dependent on the following:...
  • Page 538: Speed, Acceleration, Deceleration, And Jerk Enumerations

    Chapter 7 MDSC Functionality Master Distance X Speed, Acceleration, Common enumerations are used for the speed parameter of all motion instructions. Some instructions accept only a limited subset of the speed Deceleration, and Jerk enumerations. Checks for valid unit combinations are done at instruction Enumerations execution time.
  • Page 539 MDSC Functionality Chapter 7 • When speed is specified in time unit (seconds), the specified time is the total time of the move, including acceleration and deceleration time. • When speed is specified in Master distance units, the specified distance is the total master distance of the move, including acceleration and deceleration distance of the Master Axis.
  • Page 540 Chapter 7 MDSC Functionality Logix Designer application version 19 and earlier MAM instruction programmed as rate. Position 50.0 mm (start 0.0) Speed 10.0 mm/sec Accel 40.0 mm/sec2 Decel 40.0 mm/sec2 So Travel_Distance = area under the curve [accel + at_speed + decel] Travel_Distance = 50 mm Travel_Distance = 50 mm [1.25 mm + 47.5 mm + 1.25 mm...
  • Page 541 MDSC Functionality Chapter 7 Programming Time in Logix Designer Application Version 20 and Later In Logix Designer application, version V20 and later you can program the accel and decel and the total time of the move directly. Logix Designer application version 20 and later MAM instruction programmed as time.
  • Page 542 Chapter 7 MDSC Functionality Acceleration and Deceleration Enumerations The following enumerations are defined for Acceleration and Deceleration Unit parameters for motion instructions. Acceleration and Deceleration Unit Parameter Descriptions Mode Enumerations Compatibility Time 0 = Units per sec2 Existing Enumeration 1 = % Maximum Existing Enumeration 2 = Reser ved 3 = Seconds...
  • Page 543 MDSC Functionality Chapter 7 • Speed, Acceleration, Deceleration, and Jerk must always be programmed in the same mode or you get an error. • If Speed units are Seconds, then Acceleration, Deceleration, and Jerk units must be seconds too. • If Speed units are Master units, then Acceleration, Deceleration, and Jerk units must be Master units too.
  • Page 544 Chapter 7 MDSC Functionality Acceleration Units and Jerk Units when Speed Units are Units per Second Jerk Units Acceleration and Deceleration Units Units per sec2 % Maximum Seconds Units per Master Units MasterUnit2 (Master (Time Driven Mode (Time Driven Mode (Time Driven (Master Driven Mode...
  • Page 545 MDSC Functionality Chapter 7 Units per New Enumeration MasterUnits3 Implemented (Master Driven Mode Units) % of Time -Master New Enumeration Incompatible combinations of Time and Master Driven mode. An error Driven Implemented occurs when you verify the routine. (Master Driven Mode Units) Master Units Not Implemented...
  • Page 546: Time Based Planning

    Chapter 7 MDSC Functionality The following table shows acceptable combinations of Acceleration Units and Jerk Units when Speed is in Master Units. Acceleration Units and Jerk Units when Speed is in Master Units Speed Units in Master Units Acceleration (Speed in MasterUnits) Units per sec2 % Maximum Seconds...
  • Page 547 MDSC Functionality Chapter 7 If the sum of the Acceleration and Deceleration time is greater than the total time as specified by the speed, the Acceleration and Deceleration time is reduced proportionately so the total specified time in the Speed Parameter is met. The Speed, when programmed in seconds, takes priority over Acceleration and Deceleration, which in turn takes priority over Jerk.
  • Page 548 Chapter 7 MDSC Functionality Important: Time based planning is not implemented for coordinated moves in Logix Designer application, version 20. Dynamics in seconds are incompatible with Merge Speed = Current. This will result in error 94, MDSC_UNITS_CONFLICT. Dwells You have the option to program a dwell by using Time Based Programming in either Time Driven mode or Master Driven mode.
  • Page 549 MDSC Functionality Chapter 7 Path Fidelity The path fidelity (remaining on path) is maintained through the full range of Master dynamics of Speed, Acceleration, Deceleration, and Jerk in Master Driven mode. This means that the move path does not change as the Master speed is changed with an MCD.
  • Page 550: Active

    Chapter 7 MDSC Functionality Status Bits for Motion The following table describes the predefined data type status bits for motion instruction MAM, MATC, and MAJ. Instructions (MAM, MATC, MAJ) When MDAC Is Active Status Bits for Motion Instructions when an MDAC Instruction is Active Description .EN (Enable) The Enable bit is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung...
  • Page 551: Program A Velocity Profile Definition Of Jerk

    Chapter 8 Program a velocity profile and jerk rate and tune an S-Curve Profile Use this chapter to program a velocity profile and jerk rate, and tune an S-Curve Profile. Jerk is the rate of change of acceleration or deceleration. Definition of Jerk Example: If acceleration changes from 0 to 40 mm/s...
  • Page 552 Chapter 8 Program a velocity profile and jerk rate and tune an S-Curve Profile If you want Choose This Profile Considerations • Fastest acceleration and Jerk does not limit the acceleration Trapezoidal deceleration times and deceleration time. • More flexibility in programming •...
  • Page 553: Velocity Profile Effects

    Program a velocity profile and jerk rate and tune an S-Curve Profile Chapter 8 Velocity Profile Effects The table summarizes the differences between profiles. Profile ACC/DEC Motor Priority of Control Type Time Stress Highest To Lowest Trapezoidal Fastest Worst Acc/Dec Velocity Position S-Curve...
  • Page 554 Chapter 8 Program a velocity profile and jerk rate and tune an S-Curve Profile To tune an s-curve profile, use the following steps: Important: In this procedure, you increase the jerk. This increases the stress on the equipment and load. Make sure you can identify when the equipment or load has reached its jerk limit.
  • Page 555 Program a velocity profile and jerk rate and tune an S-Curve Profile Chapter 8 If There Is Then Which Results In NOT too much jerk Reduce the % of Time Too much jerk Increase the % of Time 5. Repeat steps 3 and 4 until you have the desired balance between smoothness and cycle time.
  • Page 556 Chapter 8 Program a velocity profile and jerk rate and tune an S-Curve Profile Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 557: Motion Error Codes, Faults, And Attributes

    Chapter 9 Motion Error Codes, faults, and attributes This chapter provides an overview of the error codes, faults and attributes for motion instructions. Motion Error Codes (.ERR) This table lists the error codes for Logix Designer software motion instructions. Motion Instruction Error Codes Descriptions Error Corrective Action or Cause Notes...
  • Page 558 Chapter 9 Motion Error Codes, faults, and attributes At least one axis is not configured to a physical motion module or has not been Axis Not Configured assigned to a Motion Group. For single axis instructions: the Extended Error code for MAG, MDAC, MAPC, MAM, MAJ, MATC, and MCD is defined as: 1 = Slave axis 2 = Master Axis...
  • Page 559 Motion Error Codes, faults, and attributes Chapter 9 You have an illegal segment type in the cam element. Illegal Cam Type You have an illegal order of cam elements. Illegal Cam Order You tried to execute a cam profile while it is being calculated. Cam Profile Being Calculated The cam profile array you tried to execute is in use.
  • Page 560 Chapter 9 Motion Error Codes, faults, and attributes You have specified one 1 point radius or "drawn a line" centerpoint, viapoint and Circular Start End Error no centerpoint radius or plane centerpoint, viapoint can be determined. The programmed centerpoint is not equidistant from start and end point. Circular R1 R2 Mismatch Error Contact Rockwell Automation Support.
  • Page 561 Motion Error Codes, faults, and attributes Chapter 9 The axis moved too far and the controller cannot store the position. To prevent Axis Position Overflow this error, Set up soft travel limits that keep the axis within the position range. The range for position depends on the conversion constant of the axis.
  • Page 562 Chapter 9 Motion Error Codes, faults, and attributes Look for source or target axes that are configured as rotary positioning mode. Axes In Transform Must Be Linear Change them to linear positioning mode. A transform works only with linear axes. Wait until the transform that you are canceling is completely canceled.
  • Page 563 Motion Error Codes, faults, and attributes Chapter 9 Error on MGSR, if a MASD or MGS (programmed) is executed while the MGSR is Partial Group Shutdown Reset. still in process. If your application program is actively executing an MGSR instruction and you try Do not overlap the MASD instruction or MGS stop instruction with Stop Mode = to execute an MASD instruction or MGS stop instruction with Stop Mode = Programmed on an active MGSR instruction.
  • Page 564 Chapter 9 Motion Error Codes, faults, and attributes If the Master Axis is changed and the new slave speed is less than 5% of the MDSC Invalid Slave Speed Reduction. original slave speed for Single Axis instructions, or 10%, depending on the move of the original Slave Coordinate System speed, then this error will occur and the change will not be allowed.
  • Page 565 Motion Error Codes, faults, and attributes Chapter 9 Operands of MCS should be set as follows. Otherwise the instruction will error. MCS Units conflict. 1. If Change Decel is set to Yes, then Decel Units must be % of Maximum. Units per Sec2 is not acceptable because different decel value is needed for Cartesian and orientation axes.
  • Page 566 Chapter 9 Motion Error Codes, faults, and attributes Orientation axes (Rx, Ry, and Rz) must be virtual if the coordinate system is Orientation axis is not virtual. involved in the MCTO or MCTPO transforms. Refer to the online help for the instruction for extended error code definitions. It identifies the orientation axis.
  • Page 567 Motion Error Codes, faults, and attributes Chapter 9 Generated Errors in Overlap Instances The following table lists additional overlap instances that will generate errors. Active Stopping Instruction MGSD Initiated Second Stop Mode = Stop Mode = Stop Mode Stop Type Stop Type = Stop Type All Stop...
  • Page 568: Handle Motion Faults

    Chapter 9 Motion Error Codes, faults, and attributes Stop Type = Coordinated Move Error #78 Error #78 Error #78 Error #7 Error #78 Error #78 Stop Type = Coordinated Error #78 Error #78 Error #78 Error #7 Error #78 Error #78 Transform All Stop Types Except Error #78...
  • Page 569: Motion Attributes

    Motion Error Codes, faults, and attributes Chapter 9 Understanding Minor/Major Faults Several faults can occur that are not caused by motion instructions. For example, a loss of encoder feedback or an actual position exceeding an over-travel limit will cause faults. The motion faults are considered Type II faults with error codes from 1 to 32.
  • Page 570 Chapter 9 Motion Error Codes, faults, and attributes Data Type Groups The motion attributes are divided into groups, which are designated by a G and a number. These groups depend on the specific data type, and an axis may be associated with many groups.
  • Page 571 Motion Error Codes, faults, and attributes Chapter 9 Motion Attributes The following table lists all of the attributes associated with motion (in alphabetical order). Variable: Data Type Instruction Description AccelerationCommand REAL G11/Status The current acceleration reference to the output summing junction for the specified axis. Represents the output of the inner velocity control loop.
  • Page 572 Chapter 9 Motion Error Codes, faults, and attributes AttributeErrorCode G11/Status Returns the appropriate CIP error code when an Axis Configuration fault occurs. It is not reset to zero until the motion module is reconfigured. AttributeErrorID G11/Status Retains the identification associated with the error code returned when an Axis Configuration fault occurred.
  • Page 573 Motion Error Codes, faults, and attributes Chapter 9 AxisDataType SINT G3/Interface Determines which data template, memory format, and set of attributes are created and applied for this axis instance. It can only be set as part of an axis create service. Value: Meaning 0 feedback 1 consumed...
  • Page 574 Chapter 9 Motion Error Codes, faults, and attributes AxisFaultBits DINT G1/Status The axis fault bits for your axis. Bit Name Meaning Set if there is one or more fault conditions PhysicalAxisFault reported by the physical axis. Set when a serious fault has occurred with the motion module associated with the selected axis.
  • Page 575 Motion Error Codes, faults, and attributes Chapter 9 AxisInfoSelect1 DINT GSV/SSV G1/Configuration Enables periodic data updates for selected servo/drive status attributes. It is designed to reduce the flow of unnecessary data for the Servo/SERCOS module. Value: Meaning 0 none 1 Position Command 2 Position Feedback 3 Aux.
  • Page 576 Chapter 9 Motion Error Codes, faults, and attributes AxisResponseBits DINT G1/Status The axis fault bits for your axis. Bit Name Meaning Abort Process When set, the servo module accepts that the Acknowledge tuning or test process has been canceled. When set, the servo module accepts that the Shutdown axis has been forced into the shutdown Acknowledge...
  • Page 577 Motion Error Codes, faults, and attributes Chapter 9 AxisStatusBits DINT G1/Status The axis status bits for your axis. Bit Name Meaning Set when the associated axis motor control function is tracking ServoActionStatus command reference from the controller. Set when the power structure associated with the axis is currently enabled.
  • Page 578 Chapter 9 Motion Error Codes, faults, and attributes Set when axis motion is driven by the Direct Velocity Control and Direct Torque Control functions. In this mode, the Motion Planner functionality is disabled so any attempt to move the axis with a Motion Planner instruction, such as, MAM, MAJ, MAG, and so on results in an instruction error.
  • Page 579 Motion Error Codes, faults, and attributes Chapter 9 AxisStructureAddress DINT G1/Interface Used to return the actual physical address in memory where the axis instance is located. AxisType GSV/SSV G11/Configuration Establishes the intended use for the axis. This value also controls the behavior of the servo module's Axis Status LEDs and the Logix Designer application uses the current configured type to control the look of its tab dialogs.
  • Page 580 Chapter 9 Motion Error Codes, faults, and attributes DampingFactor REAL GSV/SSV G11/Configuration The value used in calculating the maximum position servo bandwidth during the execution of the MRAT instruction. It controls the dynamic response of the servo axis. The default value of 0.8 should work fine for most applications DCBusVoltage DINT G10/Status...
  • Page 581 Motion Error Codes, faults, and attributes Chapter 9 FeedbackNoiseFault Sets when simultaneous transitions of feedback of A and B are detected by the servo module. AuxFeedbackFault Sets when the differential electrical signal for one or more of the feedback channels are at same level or loss of feedback power or common electrical connection between servo module or drive...
  • Page 582 Chapter 9 Motion Error Codes, faults, and attributes CommutationFault Sets when the commutation feedback source has a problem that prevents the drive from receiving accurate or reliable motor shaft information to perform commutation. DriveOvercurrentFault Sets when the drive output current exceeds the drive’s predefined operating limits.
  • Page 583 Motion Error Codes, faults, and attributes Chapter 9 DriveStatusBits DINT G10/Status These are the status bits for the drive. Bit Name Meaning ServoActionStatus Set when servo loops on the associated axis is enabled and able to follow commands. DriveEnableStatus Set when drive’s power structure associated with the axis has been activated.
  • Page 584 Chapter 9 Motion Error Codes, faults, and attributes VelocityLockStatus Set when the magnitude of the physical axis Velocity Feedback is within the configured Velocity Window of the current velocity command. VelocityStandstillStatus Set when the magnitude of the physical axis Velocity Feedback is within the configured Velocity Standstill Window of zero speed.
  • Page 585 Motion Error Codes, faults, and attributes Chapter 9 DriveWarningBits DINT G10/Status These are the status bits for the drive. Bit Name Meaning DriveOverloadWarning Set when motor load limit is exceeded. It gives the control program a chance to reduce motor loading to avoid a shutdown situation.
  • Page 586 Chapter 9 Motion Error Codes, faults, and attributes DriveFaultNormallyClosed This attribute controls sense of the (Servo) Drive Fault input to the servo module. 2-31 Reserved (Servo Drive) 3-31 Reserved (Servo) FeedbackFaultAction SINT GSV/SSV G11/Configuration Sets the type of action to be taken when a Feedback Fault is encountered. Value/Meaning 0 = shutdown - most severe action to a fault;...
  • Page 587 Motion Error Codes, faults, and attributes Chapter 9 HomeConfigurationBits DINT GSV/SSV G6/Configuration Bit Name Meaning Reserved This determines the normal state of the home limit switch used by the homing sequence. The normal HomeSwitchNormallyClosed state of the switch is its state prior to being engaged by the axis during the homing sequence.
  • Page 588 Chapter 9 Motion Error Codes, faults, and attributes HomeSequence SINT GSV/SSV G6/Configuration The homing sequence type for your axis. Value: Meaning: 0 immediate (default) 1 switch 2 marker 3 switch then marker HomeSpeed REAL GSV/SSV G7/Configuration Controls the speed of the jog profile used in the first leg of an active homing sequence.
  • Page 589 Motion Error Codes, faults, and attributes Chapter 9 MaximumSpeed REAL GSV/SSV G8/Configuration This is used by various motion instructions to determine the steady-state speed of the axis. This value for the axis is automatically set to the tuning speed by the MAAT instruction.
  • Page 590 Chapter 9 Motion Error Codes, faults, and attributes ModuleFaultBits DINT G11/Status Module Fault information is passed from a physical module or device to the controller via an 8-bit value contained in the header of the Synchronous Input connection assembly. These fault bits are updated every coarse update period by the Motion Task Bit Name Meaning...
  • Page 591 Motion Error Codes, faults, and attributes Chapter 9 MotionStatusBits DINT G1/Status The motion status bits for your axis. Bit Name Meaning AccelStatus Used to determine if the axis is currently being commanded to accelerate. DecelStatus Used to determine if the axis is currently being commanded to decelerate.
  • Page 592 Chapter 9 Motion Error Codes, faults, and attributes TimeCamStatus Set when a Tcam profile is currently in progress. PositionCamPendingStatus Set if a Pcam motion profile is waiting for another to end. This is initiated by executing an MAPC instruction with Pending execution selected.
  • Page 593 Motion Error Codes, faults, and attributes Chapter 9 MoveLockStatus Set when the master axis satisfies the Lock Direction request of a Motion Axis Move (MAM) Instruction. If the Lock Direction is Immediate Forward Only or Immediate Reverse Only the MoveLockStatus bit will be set immediately when the MAM is initiated.
  • Page 594 Chapter 9 Motion Error Codes, faults, and attributes MasterOffsetMoveLockStatus Set when the master axis satisfies the Lock Direction request of a Master Offset Move executed using MAM instruction. If the Lock Direction is Immediate Forward Only or Immediate Reverse Only the MasterOffsetMoveLockStatus bit will be set immediately when the MAM is initiated.
  • Page 595 Motion Error Codes, faults, and attributes Chapter 9 MotorThermalFaultAction SINT Sets the type of action performed when a motor thermal fault occurs. Value/Meaning: 0 = shutdown – most severe action to a fault and is reserved for faults that could endanger machinery or personnel.
  • Page 596 Chapter 9 Motion Error Codes, faults, and attributes OutputOffset REAL GSV/SSV G9/Configuration The fixed value used to offset the drift caused by the cumulative drive offsets of the servo module DAC output and the servo drive input. This value added is to the Servo Output.
  • Page 597 Motion Error Codes, faults, and attributes Chapter 9 PositionPolarity G10/Configuration Maps directly to the SERCOS IDN. It is automatically set based on the current Drive Polarity Settings. All command bits are set according to the Command polarity bit value and all feedback bits are set according to the Feedback Polarity bit setting. PositionProportionalGain REAL GSV/SSV...
  • Page 598 Chapter 9 Motion Error Codes, faults, and attributes ProgrammedStopMode SINT GSV/SSV G8/Configuration Determines how a specific axis is to stop when the ControlLogix processor has a critical processor mode change or when an explicit MGS instruction is executed with its stop mode set to programmed. Value: Meaning: 0 = Fast Stop (default) –...
  • Page 599 Motion Error Codes, faults, and attributes Chapter 9 SercosErrorCode G10/Status Used to identify the source of the drive parameter update failure that results in the AxisConfigurationFault. The error codes are derived from the IEC-1394 SERCOS Interface standard. ServoFaultBits DINT G11/Status Bit Name Meaning PosSoftOvertravelFault...
  • Page 600 Chapter 9 Motion Error Codes, faults, and attributes ServoLoopConfiguration GSV/SSV G11/Configuration Determines the specific configuration of the servo loop topology when the AxisType is set to servo. When AxisType is set to feedback only, it is used to select the feedback port. It also established several advanced drive configuration attributes that are part of the SERCOS interface standard.
  • Page 601 Motion Error Codes, faults, and attributes Chapter 9 ServoStatusBits DINT G9/Status The status bits for your servo loop Bit Name Meaning ServoActionStatus Set when servo action is enabled. DriveEnableStatus Set when drive is enabled. AxisShutdownStatus Set when axis is in shutdown state.
  • Page 602 Chapter 9 Motion Error Codes, faults, and attributes StartMasterOffset REAL G4/Status the position offset that is applied to the master side of the position cam when the last MAM instruction with the move type set to either Absolute Master Offset or Incremental Master Offset was executed.
  • Page 603 Motion Error Codes, faults, and attributes Chapter 9 TorqueDataScalling G10/Configuration This advanced scaling attribute maps directly to the SERCOS IDNs. It is automatically configured to the appropriate default. It is read-only. TorqueDataScalingFactor G10/Configuration This advanced scaling attribute maps directly to the SERCOS IDNs. It is automatically configured to the appropriate default.
  • Page 604 Chapter 9 Motion Error Codes, faults, and attributes Torque Threshold REAL GSV/SSV G10/Configuration Maps directly to the SERCOS IDNs and is automatically configured to reasonable default values. Manipulation is not needed unless motivated by a specific application requirement. TuneAcceleration REAL G11/Status Returns the measured acceleration value from the last run MRAT instruction.
  • Page 605 Motion Error Codes, faults, and attributes Chapter 9 TuningConfigurationBits DINT GSV/SSV G11/Configuration The tuning configuration bits for your axis Bit Name Meaning TuningDirectionReverse It determines the direction of the tuning motion profile initiated by the MRAT instruction. If set (true), goes in reverse or negative direction.
  • Page 606 Chapter 9 Motion Error Codes, faults, and attributes VelocityDataScaling G10/Configuration This advanced scaling attribute maps directly to the SERCOS IDNs. It is automatically configured to the appropriate default. It is read-only. VelocityDataScalingExp G10/Configuration This advanced scaling attribute maps directly to the SERCOS IDNs. It is automatically configured to the appropriate default.
  • Page 607 Motion Error Codes, faults, and attributes Chapter 9 VelocityOffset G11/Configuration Used to provide a dynamic velocity correction to the output of the position servo loop. It can be tied into custom outer control loop algorithms using Function Block programming. VelocityPolarity G10/Configuration Maps directly to the SERCOS IDN.
  • Page 608: Understand Motion Status And Configuration Parameters

    Chapter 9 Motion Error Codes, faults, and attributes Understand Motion You can read motion status and configuration parameters in your ladder logic program using two methods. Status and Configuration Method Example Parameters Directly accessing the Axis faults MOTION_GROUP and AXIS structures Motion status Servo status Using the GSV instruction...
  • Page 609 Motion Error Codes, faults, and attributes Chapter 9 Look For Cause When you use an S-curve profile, jerk determines how fast an axis can change its acceleration and deceleration. • An S-curve profile has to get acceleration to zero before the axis can slow down.
  • Page 610 Chapter 9 Motion Error Codes, faults, and attributes Trapezoidal The axis slows down as soon as you start the stopping instruction. S-curve Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 611 Motion Error Codes, faults, and attributes Chapter 9 Corrective Action Revision 15 or earlier Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 612 Chapter 9 Motion Error Codes, faults, and attributes Revision 16 or later Leave bit 0 of the DynamicsConfigurationBits attribute for the axis turned ON. Otherwise, this corrective action will not work. For more information. Use the following path: Help >Index>GSV/SSV Objects>Axis>Dynamics Configuration Bits Revision 16 and later lets you increase the deceleration jerk of an Motion Action Stop (MAS) instruction to get a quicker stop.
  • Page 613 Motion Error Codes, faults, and attributes Chapter 9 Look For Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 614 Chapter 9 Motion Error Codes, faults, and attributes Cause When you use an S-curve profile, jerk determines how fast an axis can change its acceleration and deceleration. • When the stopping instruction starts, the controller recalculates jerk and builds a new S-curve profile. •...
  • Page 615 Motion Error Codes, faults, and attributes Chapter 9 Stop while accelerating and reduce the acceleration rate Trapezoidal S-curve The stopping instruction reduces the acceleration of the axis. It now takes longer to bring the acceleration to zero. The axis continues past its The axis slows down as soon as you start the stopping instruction.
  • Page 616 Chapter 9 Motion Error Codes, faults, and attributes Or, set up your instructions like the following. Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 617 Motion Error Codes, faults, and attributes Chapter 9 Why is there a delay when I stop and then restart a jog? While an axis is jogging at its target speed, you stop the axis. Before the axis stops completely, you restart the jog. The axis continues to slow down before it speeds Example You use a Motion Axis Stop (MAS) instruction to stop a jog.
  • Page 618 Chapter 9 Motion Error Codes, faults, and attributes Look For For Stop Type, the instruction that stops the axis keeps the S-curve profile. Suppose you use an Motion Axis Stop (MAS) instruction with the Stop Type set to Jog. In that case, the axis keeps the profile of the Motion Axis Jog (MAJ) instruction that started the axis.
  • Page 619 Motion Error Codes, faults, and attributes Chapter 9 Cause When you use an S-curve profile, jerk determines how fast an axis can change its acceleration and deceleration. • An S-curve profile has to get acceleration to zero before the axis can speed up again.
  • Page 620 Chapter 9 Motion Error Codes, faults, and attributes Why does my axis reverse direction when I stop and start it? While an axis is jogging at its target speed, you stop the axis. Before the axis stops completely, you restart the jog. The axis continues to slow down and then reverse direction.
  • Page 621 Motion Error Codes, faults, and attributes Chapter 9 Cause When you use an S-curve profile, jerk determines how fast an axis can change its acceleration and deceleration. • When the Motion Axis Jog (MAJ) instruction starts again, the controller recalculates jerk and builds a new S-curve profile. •...
  • Page 622 Chapter 9 Motion Error Codes, faults, and attributes Corrective Action Revision 15 or earlier Revision 16 or later Revision 16 improved how the controller handles changes to an S-curve profile. If you’re still seeing an axis reversal, make sure bit 1 of the DynamicsConfigurationBits for the axis is on.
  • Page 623 Motion Error Codes, faults, and attributes Chapter 9 1. Use a Get System Value (GSV) instruction to see if the algorithm is on. 2. If bit 1 is off, turn it on. For more information, use the following path: Help > Index > GSV/SSV Objects >...
  • Page 624 Chapter 9 Motion Error Codes, faults, and attributes Look For Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018...
  • Page 625 Motion Error Codes, faults, and attributes Chapter 9 Cause The axis does not have enough time at the new lower deceleration to stop at the target position. It stops past the target position. Then it corrects to get back to the target position.
  • Page 627: Overview Of Motion-Related Data Types

    Chapter 10 Overview of motion-related data types Follow this chapter to gain information about motion-related data types. CAM Structure The CAM data type consists of slave and master point pairs, as well as an interpolation type. Since there is no association with a specific axis position or time, the point values are unitless.
  • Page 628: Motion_Group Structure

    Chapter 10 Overview of motion-related data types MOTION_GROUP There is one MOTION_GROUP structure per controller. This structure contains status information about the group. Every motion instruction Structure references the same MOTION_GROUP structure. Mnemonic Data Type Description .GroupStatus DINT The status bits for the group. Number Data Type Description .InhibStatus...
  • Page 629 Overview of motion-related data types Chapter 10 .GroupFault DINT The fault bits for the group. Number Data Type Description .GroupOverlapFault DINT group overlap fault .CSTLossFault DINT the controller has lost synchronization with the CST master .GroupTaskLoadingFault DINT the group coarse update period is too low;...
  • Page 630: Motion_Instruction Data Type

    Chapter 10 Overview of motion-related data types MOTION_INSTRUCTI You must define a motion control tag for each motion instruction that you use. The tag uses the MOTION_INSTRUCTION data type and stores status ON Data Type information about the instruction. Mnemonic Data Type Description FLAGS...
  • Page 631 Overview of motion-related data types Chapter 10 STATUS SINT The status of any message associated with the motion function. Message Status Description The message was successful. The module is processing another message. The module is waiting for a response to a previous message.
  • Page 632: Output_Cam Structure

    Chapter 10 Overview of motion-related data types OUTPUT_CAM Structure The OUTPUT_CAM data type is an array that defines the specifics for each Output Cam element. The OUTPUT_CAM contains the following members: Mnemonic Data Type Description OutputBit DINT You must select an output bit within the range of 0 to 31. A selection of less than 0 or greater than 31 results in an Illegal Output Cam error and the cam element is not considered.
  • Page 633: Output_Compensation Structure

    Overview of motion-related data types Chapter 10 OUTPUT_COMPENSATION The OUTPUT_COMPENSATION data type defines the details for each output bit by setting the characteristics of each actuator. Structure OUTPUT_COMPENSATION contains the following members. Mnemonic Data Type Description Offset REAL Offset provides position compensation for both the latch and unlatch operations. LatchDelay REAL Latch delay, programmed in seconds, provides time compensation for the latch operation.
  • Page 635: Overview Of Structured Text Programming

    Chapter 11 Overview of Structured Text Programming This chapter describes issues that are unique with structured text programming. Review the information in this chapter to gain a better understanding about how your structure text programming will execute. Structured Text Syntax Structured text is a textual programming language that uses statements to define what to execute.
  • Page 636: Structured Text Components: Assignments

    Chapter 11 Overview of Structured Text Programming Comment Text that explains or clarifies what a section of structured text does. //comment Use comments to make it easier to interpret the structured text. Comments do not affect the execution of the structured text. (*start of comment .
  • Page 637 Overview of Structured Text Programming Chapter 11 The expression can be simple, such as an immediate value or another tag name, or the expression can be complex and include several operators and functions, or both. Refer to Expressions for more information. Tip: I/O module data updates asynchronously to the execution of logic.
  • Page 638: Structured Text Components: Expressions

    Chapter 11 Overview of Structured Text Programming Assign an ASCII character to a string data member Use the assignment operator to assign an ASCII character to an element of the DATA member of a string tag. To assign a character, specify the value of the character or specify the tag name, DATA member, and element of the character.
  • Page 639 Overview of Structured Text Programming Chapter 11 ensures that the expression executes in the desired sequence. Refer to Order of Execution for more information. In structured text, you use these types of expressions: BOOL expression: An expression that produces either the BOOL value of 1 (true) or 0 (false).
  • Page 640: Use Arithmetic Operators And Functions

    Chapter 11 Overview of Structured Text Programming Use arithmetic operators You can combine multiple operators and functions in arithmetic expressions. and functions Operators calculate new values. Use this operator Optimal data type DINT, REAL Subtract/negate DINT, REAL Multiply DINT, REAL Exponent (x to the power of y) DINT, REAL Divide...
  • Page 641: Use Relational Operators

    Overview of Structured Text Programming Chapter 11 See also Structured Text Components: Expressions page 638 Use relational operators Relational operators compare two values or strings to provide a true or false result. The result of a relational operation is a BOOL value. If the comparison is The result is True...
  • Page 642: Use Logical Operators

    Chapter 11 Overview of Structured Text Programming • When the two strings are sorted as in a telephone directory, the order of the strings determines which one is greater. • Strings are equal if their characters match. • Characters are case sensitive. Upper case "A" ($41) is not equal to lower case "a"...
  • Page 643: Use Bitwise Operators

    Overview of Structured Text Programming Chapter 11 The table shows some examples. Use this format Example For this situation BOOLtag If photoeye is a BOOL tag and your specification says: "If photoeye_1 is on IF photoeye THEN... then..." NOT BOOLtag If photoeye is a BOOL tag and your specification says: "If photoeye is off IF NOT photoeye THEN...
  • Page 644: Determine The Order Of Execution

    Chapter 11 Overview of Structured Text Programming Determine the order of The operations you write into an expression are performed in a prescribed order, not necessarily from left to right. execution • Operations of equal order are performed from left to right. •...
  • Page 645: Structured Text Components: Constructs

    Overview of Structured Text Programming Chapter 11 from cleared to set. The ABL instruction does not execute when tag_xic stays set or when tag_xic is cleared. In structured text, if you write this example as: IF tag_xic THEN ABL(0,serial_control); END_IF; The ABL instruction will execute every scan that tag_xic is set, not just when tag_xic transitions from cleared to set.
  • Page 646: Character String Literals

    Chapter 11 Overview of Structured Text Programming Some Key Words are Reserved These constructs are not available: • GOTO • REPEAT Logix Designer application will not let you use them as tag names or constructs. See also IF_THEN page 648 CASE_OF page 651 FOR_DO...
  • Page 647 Overview of Structured Text Programming Chapter 11 Two-character combinations in character strings Description Example Dollar sign Single quote Line feed $L or $I Newline $N or $n Form feed (page) $P or $p Carriage return $R or $r Tabulator $T or $t •...
  • Page 648: If_Then

    Chapter 11 Overview of Structured Text Programming IF_THEN Use IF_THEN to do something if or when specific conditions occur. Operands IF bool_expression THEN <statement>; Operand Type Format Enter Bool_ BOOL Tag expression BOOL tag or expression that evaluates to a BOOL value expression (BOOL expression) Description...
  • Page 649 Overview of Structured Text Programming Chapter 11 To do something when all of the IF or ELSIF conditions are false, add an ELSE statement. The table summarizes different combinations of IF, THEN, ELSIF, and ELSE. If you want to Use this construct Do something if or when conditions are true Do nothing if conditions are false IF_THEN...
  • Page 650 Chapter 11 Overview of Structured Text Programming Enters the RUN mode. Leaves the step of an SFC if you configure the SFC for Automatic reset. (This applies only if you embed the assignment in the action of the step or use the action to call a structured text routine via a JSR instruction.) Example 3 IF…THEN…ELSIF...
  • Page 651: Case_Of

    Overview of Structured Text Programming Chapter 11 CASE_OF Use CASE_OF to select what to do based on a numerical value. Operands CASE numeric_expression OF selector1: statement; selectorN: statement; ELSE Structured Text Operand Type Format Enter Numeric_ SINT INT DINT REAL Tag expression Tag or expression that evaluates to a number...
  • Page 652 Chapter 11 Overview of Structured Text Programming When selector is Enter One value value: statement Multiple, distinct values value1, value2, valueN : <statement> Use a comma (,) to separate each value. A range of values value1..valueN : <statement> Use two periods (..) to identify the range. Distinct values plus a range of values valuea, valueb, value1..valueN : <statement>...
  • Page 653: For_Do

    Overview of Structured Text Programming Chapter 11 Leaves the step of an SFC if you configure the SFC for Automatic reset. (This applies only if you embed the assignment in the action of the step or use the action to call a structured text routine via a JSR instruction.) FOR_DO Use the FOR_DO loop to do something a specific number of times before doing anything else.
  • Page 654 Chapter 11 Overview of Structured Text Programming Description The syntax is described in the table. The following diagrams show how a FOR_DO loop executes and how an EXIT statement leaves the loop early. The FOR_DO loop executes a specific number of times. To stop the loop before the count reaches the last value, use an EXIT statement.
  • Page 655: While_Do

    Overview of Structured Text Programming Chapter 11 Example 1 If you want this Enter this structured text Clear bits 0…31 in an array of BOOLs: For subscript:=0 to 31 by 1 do Initialize the subscript tag to 0. array[subscript] := 0; Clear i .
  • Page 656 Chapter 11 Overview of Structured Text Programming Structured Text Operand Type Format Description bool_expression BOOL BOOL tag or expression that evaluates to a BOOL value expression Important: Make sure that you do not iterate within the loop too many times in a single scan. The controller does not execute any other statements in the routine until it completes the loop.
  • Page 657 Overview of Structured Text Programming Chapter 11 Fault Conditions A major fault will occur if Fault type Fault code the construct loops too long Example 1 If you want this Enter this structured text The WHILE_DO loop evaluates its conditions first. If the conditions are true, the pos := 0;...
  • Page 658: Repeat_Until

    Chapter 11 Overview of Structured Text Programming REPEAT_UNTIL Use the REPEAT_UNTIL loop to keep doing something until conditions are true. Operands REPEAT <statement>; Structured Text Operand Type Format Enter bool_ BOOL Tag expression BOOL tag or expression that evaluates to a BOOL value expression (BOOL expression) Important:...
  • Page 659 Overview of Structured Text Programming Chapter 11 While the bool_expression is false, the controller executes only the statements within the REPEAT_UNTIL loop. To stop the loop before the conditions are false, use an EXIT statement. Affects Math Status Flags Fault Conditions A major fault will occur if Fault type Fault code...
  • Page 660: Structured Text Components: Comments

    Chapter 11 Overview of Structured Text Programming Example 1 If you want this Enter this structured text The REPEAT_UNTIL loop executes the statements in the construct and then pos := -1; determines if the conditions are true before executing the statements again. This REPEAT differs from the WHILE_DO loop because the WHILE_DO The WHILE_DO loop pos := pos + 2;...
  • Page 661: Rockwell Automation Publication Motion-Rm002H-En-P-February

    Overview of Structured Text Programming Chapter 11 For example: Format Example //comment At the beginning of a line //Check conveyor belt direction IF conveyor_direction THEN... At the end of a line ELSE //If conveyor isn’t moving, set alarm light light := 1; END_IF;...
  • Page 663: Common Attributes For Motion Instructions

    Chapter 12 Common attributes for Motion instructions Follow the guidelines in this chapter for the common attributes for the Motion instructions. Common Attributes This topic applies to the CompactLogix 5370, ControlLogix 5570, and ControlLogix 5580 controllers. For more information on attributes that are common to the Logix instructions, click any of the topics below.
  • Page 664: Immediate Values

    Chapter 12 Common attributes for Motion instructions For example: Definitions Example Description my_list defined as DINT[10] my_list[5] This example references element 5 in the array. The reference is static because the subscript value remains constant. my_list defined as DINT[10] MOV the value 5 into position This example references element 5 in the array.
  • Page 665 Common attributes for Motion instructions Chapter 12 Not all decimal values can be exactly represented in this standard format, which results in a loss of precision. For example, if you subtract 10 from 10.1, you expect the result to be 0.1. In a Logix controller, the result could very well be 0.10000038. In this example, the difference between 0.1 and 0.10000038 is .000038%, or practically zero.
  • Page 666: Lint Data Types

    Chapter 12 Common attributes for Motion instructions • x = 0; • • z = y + x; Or another example: • x = x + some_tiny_number; • if (x >= 100) • • z = z + 100; • x = x - 100;...
  • Page 667: Data Types

    Common attributes for Motion instructions Chapter 12 Data Types The controller supports the elementary data types defined in IEC 1131-3 defined data types. The predefined, atomic data types are: Data type Description Range BOOL 1-bit boolean 0 = cleared 1 = set SINT 1-byte integer -128 to 127...
  • Page 668 Chapter 12 Common attributes for Motion instructions Conversion Result larger integer to smaller integer The controller truncates the upper portion of the larger integer and generates an overflow. For example: Decimal Binary DINT 65,665 0000_0000_0000_0001_0000_0000_1000_0001 0000_0000_1000_0001 SINT -127 1000_0001 SINT or INT to REAL No data precision is lost DINT to REAL Data precision could be lost.
  • Page 669: Data Conversions

    Common attributes for Motion instructions Chapter 12 • REAL - Only invalid on GuardLogix(L6S) and Compact GuardLogix(L4S) controllers • LINT • ALARM-ANALOG • ALARM DIGITAL See also Math Status Flags page 673 Data Conversions Data conversions occur when you mix data types in your programming. When programming: Conversions can occur when you: Ladder Diagram...
  • Page 670 Chapter 12 Common attributes for Motion instructions Convert SINT or INT to DINT A SINT or INT input source tag gets promoted to a DINT value by a sign-extension for Source Tag. Instructions that convert SINT or INT values to DINT values use one of the following conversion methods.
  • Page 671 Common attributes for Motion instructions Chapter 12 Important: Mixing an INT tag with an immediate value Since remote_rack_1:I.Data[0] is an INT tag, the value to check it against is also entered as an INT tag. Important: Mixing an INT tag with an immediate value Since remote_rack_1:I.Data[0] is an INT tag, the value to check it against first moves into int_0, also an INT tag.
  • Page 672 Chapter 12 Common attributes for Motion instructions Convert DINT to SINT or INT To convert a DINT value to a SINT or INT value, the controller truncates the upper portion of the DINT and stores the lower bits that fit in the data type. If the value is too large the conversion generates an overflow.
  • Page 673: Math Status Flags

    Common attributes for Motion instructions Chapter 12 Math Status Flags Follow the guidelines in this topic for Math Status Flags. Description Controllers Description CompactLogix 5380, A set of Math Status Flags for accessing directly with instructions. These flags are only updated in ladder diagram CompactLogix 5480, routines, and are not tags, and flag aliases are not applicable.
  • Page 674 Chapter 12 Common attributes for Motion instructions The controller sets the overflow flag when: The controller sets the overflow flag when: Overflow flag • The result of a math operation results in an overflow. • The result of a math operation results in an overflow. For example, adding 1 to a SINT generates an overflow when the For example, adding 1 to a SINT generates an overflow when the value value goes from 127 through -128.
  • Page 675 Index motion direct drive on MDO 56 motion disarm output cam MDOC 298 motion disarm registration MDR 258 MAAT 306 motion disarm watch MDW 243 MAFR 35 motion drive start MDS 63 MAHD 324 motion group shutdown MGSD 220 MAOC 262 motion group shutdown reset MGSR 226 MAR 249 motion group stop MGS 212...
  • Page 676 Rockwell Automation support Rockwell Automation provides technical information on the web to assist you in using its products. At http://www.rockwellautomation.com/support you can find technical and application notes, sample code, and links to software service packs. You can also visit our Support Center at https://rockwellautomation.custhelp.com for software updates, support chats and forums, technical information, FAQs, and to sign up for product notification updates.

Table of Contents