Omron NY532-1500 Reference Manual

Omron NY532-1500 Reference Manual

Ny-series industrial pc platform
Hide thumbs Also See for NY532-1500:
Table of Contents

Advertisement

Industrial PC Platform
NY-series
Motion Control Instructions
Reference Manual
NY532-1500
NY532-1400
NY532-1300
NY512-1500
NY512-1400
NY512-1300
W561-E1-01

Advertisement

Table of Contents
loading

Summary of Contents for Omron NY532-1500

  • Page 1 Industrial PC Platform NY-series Motion Control Instructions Reference Manual NY532-1500 NY532-1400 NY532-1300 NY512-1500 NY512-1400 NY512-1300 W561-E1-01...
  • Page 2 No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe- less, OMRON assumes no responsibility for errors or omissions.
  • Page 3: Introduction

    Introduction Introduction Thank you for purchasing an NY-series IPC Machine Controller Industrial Panel PC / Industrial Box PC. This manual provides a collective term of Industrial Panel PC and Industrial Box PC which are applica- ble products as the NY-series Industrial PC. This manual also provides the range of devices that are directly controlled by the Controller functions embedded the Real-Time OS in the NY-series Industrial PC as the Controller.
  • Page 4: Relevant Manuals

    Relevant Manuals Relevant Manuals The following table provides the relevant manuals for NY-series Controller. Read all of the manuals that are relevant to your system configuration and application before you use NY-series Controller. Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac Stu- dio Version 1 Operation Manual (Cat.
  • Page 5: Manual Structure

    Manual Structure Manual Structure Some of the instructions described in this manual are common to NJ/NX-series as well. Therefore, note the following conditions. • With the NY-series Controller, use the primary periodic task and priority-16 periodic task. You cannot use the priority-5 periodic task. •...
  • Page 6 Manual Structure Page Structure The following page structure is used in this manual. Level-1 section heading 3 Axis Command Instructions Level-2 section heading MC_Power The MC_Power instruction makes a Servo Drive ready to operate. Instruction Name FB/FUN Graphic expression ST expression MC_Power Power Servo MC_Power_instance (...
  • Page 7 Manual Structure Special Information Special information in this manual is classified as follows: Precautions for Safe Use Precautions on what to do and what not to do to ensure safe usage of the product. Precautions for Correct Use Precautions on what to do and what not to do to ensure proper operation and performance. Additional Information Additional information to read as required.
  • Page 8 Manual Structure NY-series Motion Control Instructions Reference Manual (W561)
  • Page 9: Sections In This Manual

    Sections in this Manual Sections in this Manual Introduction to Motion Control Instructions Variables and Instructions Axis Command Instructions Axes Group Instructions Common Command Instructions Appendices Index NY-series Motion Control Instructions Reference Manual (W561)
  • Page 10 Sections in this Manual NY-series Motion Control Instructions Reference Manual (W561)
  • Page 11: Table Of Contents

    CONTENTS CONTENTS Introduction....................... 1 Relevant Manuals...................... 2 Manual Structure ...................... 3 Sections in this Manual.................... 7 Terms and Conditions Agreement ................ 15 Safety Precautions ....................17 Precautions for Safe Use ..................18 Precautions for Correct Use .................. 19 Regulations and Standards ................... 20 Versions........................
  • Page 12 CONTENTS Section 3 Axis Command Instructions MC_Power ..............3-3 Variables .
  • Page 13 CONTENTS MC_GearInPos ............. . 3-243 Variables .
  • Page 14 CONTENTS Section 4 Axes Group Instructions MC_GroupEnable ............. . . 4-2 Variables .
  • Page 15 CONTENTS MC_ReadAxisParameter ............5-62 Variables .
  • Page 16 CONTENTS NY-series Motion Control Instructions Reference Manual (W561)
  • Page 17: Terms And Conditions Agreement

    Omron’s exclusive warranty is that the Products will be free from defects in materials and workman- ship for a period of twelve months from the date of sale by Omron (or such other period expressed in writing by Omron). Omron disclaims all other warranties, express or implied.
  • Page 18 Disclaimers Performance Data Data presented in Omron Company websites, catalogs and other materials is provided as a guide for the user in determining suitability and does not constitute a warranty. It may represent the result of Omron’s test conditions, and the user must correlate it to actual application requirements. Actual perfor- mance is subject to the Omron’s Warranty and Limitations of Liability.
  • Page 19: Safety Precautions

    Safety Precautions Safety Precautions Refer to the following manuals for safety precautions. • NY-series Industrial Box PC Hardware User’s Manual (Cat. No. W556) • NY-series Industrial Panel PC Hardware User’s Manual (Cat. No. W557) • NY-series Industrial Panel PC / Industrial Box PC Software User’s Manual (Cat. No. W558) NY-series Motion Control Instructions Reference Manual (W561)
  • Page 20: Precautions For Safe Use

    Precautions for Safe Use Precautions for Safe Use Refer to the following manuals for precautions for safe use. • NY-series Industrial Box PC Hardware User’s Manual (Cat. No. W556) • NY-series Industrial Panel PC Hardware User’s Manual (Cat. No. W557) •...
  • Page 21: Precautions For Correct Use

    Precautions for Correct Use Precautions for Correct Use Refer to the following manuals for precautions for correct use. • NY-series Industrial Box PC Hardware User’s Manual (Cat. No. W556) • NY-series Industrial Panel PC Hardware User’s Manual (Cat. No. W557) •...
  • Page 22: Regulations And Standards

    Concepts EMC Directive OMRON devices that comply with EU Directives also conform to the related EMC standards so that they can be more easily built into other devices or the overall machine. The actual products have been checked for conformity to EMC standards.
  • Page 23: Versions

    Versions Versions Hardware revisions and unit versions are used to manage the hardware and software in NY-series Con- trollers and EtherCAT slaves. The hardware revision or unit version is updated each time there is a change in hardware or software specifications. Even when two Units or EtherCAT slaves have the same model number, they will have functional or performance differences if they have different hardware revi- sions or unit versions.
  • Page 24 Versions Outline View Detail View The information that is displayed is different for the Outline View and Detail View. The Detail View displays the unit version, hardware revision, and other versions. The Outline View displays only the unit version. Checking the Unit Version of an EtherCAT Slave You can use the Production Information while the Sysmac Studio is online to check the unit version of an EtherCAT slave.
  • Page 25: Related Manuals

    Related Manuals Related Manuals The followings are the manuals related to this manual. Use these manuals for reference. Manual name Cat. No. Model numbers Application Description NY-series W557 NY532-1 Learning the basic An introduction to the entire NY-series system IPC Machine Controller specifications of the is provided along with the following informa- Industrial Panel PC...
  • Page 26 Related Manuals Manual name Cat. No. Model numbers Application Description NY-series W562 NY532-1 Using the built-in Eth- Information on the built-in EtherCAT port is IPC Machine Controller erCAT port in an NY- provided. NY512-1 Industrial Panel PC / Indus- series Industrial PC. This manual provides an introduction and trial Box PC provides information on the configuration,...
  • Page 27 Related Manuals Manual name Cat. No. Model numbers Application Description AC Servomotors/Servo I586 R88M-1 Learning how to use Describes the hardware, setup methods and Drives 1S-series with Built-in the Servomo- functions of the Servomotors/Servo Drives R88D-1SN -ECT EtherCAT® Communications tors/Servo Drives with built-in EtherCAT Communications.
  • Page 28: Revision History

    Revision History Revision History A manual revision code appears as a suffix to the catalog number on the front and back covers of the manual. W561-E1-01 Cat. No. Revision code Revision code Date Revised content September 2016 Original production NY-series Motion Control Instructions Reference Manual (W561)
  • Page 29: Introduction To Motion Control Instructions

    Introduction to Motion Control Instructions This section gives an introduction to motion control instructions supported by NY-series Controllers. 1-1 Motion Control Instructions ........1-2 1-2 Basic Information on Motion Control Instructions .
  • Page 30: Motion Control Instructions

    1 Introduction to Motion Control Instructions Motion Control Instructions Motion control instructions are used in the user program to execute motion controls for an NY-series Controller. These instructions are defined as function blocks. The motion control instructions of the MC Function Module are based on the technical specifications of ®...
  • Page 31: Overview Of Motion Control Instructions

    1 Introduction to Motion Control Instructions Overview of Motion Control Instructions ® This section describes items defined in the technical specifications of function blocks for PLCopen motion control and provides an overview of their application in the MC Function Module. Types of Motion Control Instructions The following table list the different types of motion control instructions.
  • Page 32 1 Introduction to Motion Control Instructions Error Processing You execute motion control instructions to implement motion control with the MC Function Module. When motion control instructions are executed, input parameters and instruction processing are checked for errors. If an error occurs in an instruction, the Error output variable from the instruction changes to TRUE and an error code is output to ErrorID output variable.
  • Page 33 1 Introduction to Motion Control Instructions Changing Input Variables during Execution of Motion Control Instructions (Restarting Instructions) If the values of the input variables to an instruction instance are changed while the motion control instruction is under execution and then Execute is changed to TRUE again, operation will follow the new values.
  • Page 34: Precautions For Master And Auxiliary Axes In Synchronized Control

    1 Introduction to Motion Control Instructions ® The main data types defined in PLCopen and the data types used in the MC Function Module are shown in the following table. Data type Definition PLCopen ® MC Function Module AXIS_REF _sAXIS_REF This is a structure that contains information on the correspond- ing axis.
  • Page 35 1 Introduction to Motion Control Instructions Conditions That Lead to Errors When any of the following four conditions occurs for the master or auxiliary axis when synchronized motion is started or during synchronized motion, a Master Axis Position Read Error or Auxiliary Axis Position Read Error occurs for the slave axis.
  • Page 36: Basic Information On Motion Control Instructions

    1 Introduction to Motion Control Instructions Basic Information on Motion Control Instructions This section describes basic specifications and restrictions for programming with motion control instruc- tions for the MC Function Module built into the NY-series Controller. For details on motion control instructions, refer to Section 3 Axis Command Instructions, Section 4 Axes Group Instructions, and Section 5 Common Command Instructions.
  • Page 37: Motion Control Instruction Locations

    1 Introduction to Motion Control Instructions Structured Text (ST) The instruction instance name is specified. Instruction variables are written from upper left to lower left, then upper right to lower right. The following example shows MC_MoveAbsolute (Absolute Positioning). MC_ABS_instance( Axis := MC_Axis001 , Execute := PTP_Absolute , Position := PTP_Position , Velocity := PTP_Velocity ,...
  • Page 38 1 Introduction to Motion Control Instructions Function Block Definitions You can also use motion control instructions in user-defined function block definitions. Additional Information Design efficiency is improved through program structuring, and program visibility is improved if a process with multiple operations is treated as a single function block. Master Control Regions The area in a ladder diagram between the Master Control Start instruction (MC) and the Master Control End instruction (MCR) is the master control region.
  • Page 39 1 Introduction to Motion Control Instructions PW1.Busy_PW PW1.Status_PW Servo ON/OFF Enable of the motion control instruction changes to FALSE and the Servo turns OFF. Execute-type Motion Control Instructions • Instructions located in master control regions are equivalent to the programming shown on the right in the following figure.
  • Page 40 1 Introduction to Motion Control Instructions Additional Information • The function of the MC (Master Control Start) instruction is disabled in ST. All instructions in ST are executed normally. For details on the MC and MCR instructions, refer to the NY-series Instructions Reference Man- ual (Cat.
  • Page 41 1 Introduction to Motion Control Instructions The floating-point data format conforms to the IEEE754 standards. The following formats are used. Sign Exponent Mantissa REAL data (32 bits) 31 30 23 22 Sign Exponent Mantissa LREAL data (64 bits) 63 62 52 51 Example: Expressing −86.625 as REAL Data Setting the Sign...
  • Page 42 1 Introduction to Motion Control Instructions REAL −3.402823e+38 REAL +3.402823e+38 LREAL −1.79769313486231e+308 LREAL +1.79769313486231e+308 −∞ +∞ REAL −1.175495e−38 REAL +1.175495e−38 LREAL −2.22507385850721e−308 LREAL +2.22507385850721e−308 Special Numbers Positive infinity, negative infinity, +0, −0, and nonnumeric data are called special numbers. Nonnu- meric data is data that cannot be expressed in floating-point decimal format.
  • Page 43 1 Introduction to Motion Control Instructions Subnormal Numbers Numbers that are very close to 0 (with very small absolute values) cannot be expressed using the floating-point decimal format. Subnormal numbers were introduced to expand the validity of num- bers near 0. Subnormal numbers can be used to express numbers whose absolute values are smaller than numbers expressed in the normal data format.
  • Page 44 1 Introduction to Motion Control Instructions Data Processing The floating-point decimal format is an approximate expression of a value, with a slight error from the actual value. There is a limit to the valid range of the value. For these reasons, the following pro- cess should be used for calculation.
  • Page 45: Multi-Execution Of Motion Control Instructions

    1 Introduction to Motion Control Instructions Multi-execution of Motion Control Instructions This section describes executing multiple motion control instructions for the same axis within the same task period. • In the following programming, instruction instances Move1 and Move2 start in the same task period when bit a turns ON.
  • Page 46: Online Editing Of Motion Control Instructions

    1 Introduction to Motion Control Instructions Online Editing of Motion Control Instructions You can perform the following online editing operations for motion control instructions from the Sysmac Studio. Online editing operations Deleting motion control instructions Adding motion control instructions Adding input variables, output variables, and in-out variables to motion control instructions Changing input variables, output variables, and in-out variables in motion control instructions Deleting input variables, output variables, and in-out variables in motion control instructions.
  • Page 47: Variables And Instructions

    Variables and Instructions This section describes the variables and instructions for the Motion Control Function Module. 2-1 Variables ........... . . 2-2 2-2 Instructions .
  • Page 48: Variables

    2 Variables and Instructions Variables There are two types of variables for the MC Function Module. The first type is system-defined variables, which you use to monitor axis status and some of the param- eter settings. System-defined variables that are used by the MC Function Module are called system- defined variables for motion control.
  • Page 49: Mc Common Variables

    2 Variables and Instructions Variables for Motion Control Instructions Type Outline Input variables Instruction arguments Output variables Instruction execution status monitor- ing information In-out variables Specify data to process with the instruction Additional Information • Data types that start with “_e” are enumerations. •...
  • Page 50: Axis Variables

    2 Variables and Instructions Axis Variables The variable names of the system-defined Axis Variables are _MC_AX[0..63]. The data type is _sAX- IS_REF, which is a structure. Name Data type Meaning Function _MC_AX[0..63] _sAXIS_REF Axis Variable Status _sAXIS_REF_STA Axis Status Ready BOOL Axis Ready-to-execute TRUE when preparations for axis execution are...
  • Page 51 2 Variables and Instructions Name Data type Meaning Function Details _sAXIS_REF_DET Axis Control Status Idle BOOL Idle TRUE when processing is not currently per- formed for the command value, except when waiting for in-position state. Idle and InPosWaiting are mutually exclusive. They cannot both be TRUE at the same time.
  • Page 52 2 Variables and Instructions Name Data type Meaning Function _sAXIS_REF_CMD_ Axis Command Value DATA LREAL Command Current Position Contains the current value of the command posi- tion. (Unit: command units) When the Servo is OFF and the mode is not position control mode, this variable contains the actual current position.
  • Page 53 2 Variables and Instructions Name Data type Meaning Function Obsr _sMC_REF_EVENT Axis Observation Active BOOL Axis Observation Occur- TRUE while there is an axis observation. rence Code WORD Axis Observation Code Contains the code for an axis observation. The upper four digits of the event code have the same value.
  • Page 54 TRUE depends on the specifications of the Servo Drive. Refer to the manual for the servo driver. This corresponds to one of the following limits in the OMRON 1S-series Servo Drive and G5-series Servo Drive.
  • Page 55: Axes Group Variables

    2 Variables and Instructions Axes Group Variables The variable names of the system-defined Axes Group Variables are _MC_GRP[0..31]. The data type is _sGROUP_REF, which is a structure. In the descriptions of functions, _MC_AX[*] is used as an example. Name Data type Meaning Function _MC_GRP[0..31]...
  • Page 56 2 Variables and Instructions Name Data type Meaning Function Axes Group Command Values _sGROUP_REF_CMD_- DATA LREAL Command Interpolation Contains the current value of the command Velocity interpolation velocity. The interpolation velocity is calculated from the difference with the inter- polation command current position. A plus sign is added when traveling in the positive direc- tion, and a minus sign is added when traveling in the negative direction.
  • Page 57 2 Variables and Instructions Name Data type Meaning Function Kinematics _sGROUP_REF_KIM Kinematics Transformation Settings GrpType _eMC_GROUP_TYPE Composition Gives the axis composition for multi-axes coor- dinated control. 0: _mcXY (two axes) 1: _mcXYZ (three axes) 2: _mcXYZU (four axes) Axis[0] UINT Composition Axis for Axis Gives the axis number that is assigned to axis Axis[1]...
  • Page 58: Input Variables For Motion Control Instructions

    2 Variables and Instructions Input Variables for Motion Control Instructions The following tables list the input variables and the valid ranges for motion control instructions, and the valid ranges of enumerations. Input Variables Name Meaning Data type Valid range Default Description Execute Execute...
  • Page 59 2 Variables and Instructions Name Meaning Data type Valid range Default Description NegativeEnable Negative BOOL TRUE or FALSE FALSE • MC_MoveJog Instruction Direction When this variable Enable changes to TRUE, the axis starts moving in the negative direction. When it changes to FALSE, the axis stops moving.
  • Page 60 2 Variables and Instructions Name Meaning Data type Valid range Default Description AccFactor Acceleration/ LREAL 0 to 500 (Reserved) (Reserved) Deceleration Override Factor JerkFactor Jerk LREAL 0 to 500 (Reserved) (Reserved) Override Factor Position Type _eMC_REFERENCE_- 0: _mcCommand Specifies the master axis ReferenceType Selection TYPE...
  • Page 61 2 Variables and Instructions Name Meaning Data type Valid range Default Description SlaveScaling Slave Axis LREAL Positive value (>0.0) The slave axis displace- Coefficient ment is extended or con- tracted using the specified scale. MasterOffset Master LREAL Negative number, positive number, The phase of the master Offset or 0...
  • Page 62 2 Variables and Instructions Name Meaning Data type Valid range Default Description CombineMode Combine _eMC_COMBINE_- 0: _mcAddAxes Specifies the combining Mode MODE 1: _mcSubAxes method. 0: Addition 1: Subtraction Ratio Master Axis 10000 Specifies the electronic DINT Positive or negative number Numerator Gear Ratio gear ratio numerator...
  • Page 63 2 Variables and Instructions Name Meaning Data type Valid range Default Description NegativeValue Negative LREAL 0.1 to 1000.0 or 0.0 300.0 Specifies the torque limit in Torque Limit the negative direction in increments of 0.1%. If a value that exceeds the Maximum Negative Torque Limit axis parameter, the negative torque will be the...
  • Page 64 2 Variables and Instructions Name Meaning Data type Valid range Default Description CircMode Circular _eMC_CIRC_MODE 0: _mcBorder Specifies the method for cir- Interpolation 1: _mcCenter cular interpolation. Mode 2: _mcRadius 0: Border point 1: Center 2: Radius AuxPoint Auxiliary ARRAY [0,1] OF LREAL Negative number, positive number, Specifies the border point, Point...
  • Page 65 2 Variables and Instructions Name Meaning Data type Valid range Default Description Axis Use _eMC_AXIS_USE 1: _mcUnusedAxis Specifies a used axis or an AxisUse unused axis. 2: _mcUsedAxis 1: Unused axis 2: Used axis Enable WORD 16#0000 to FFFF Specifies whether to enable EnableMask Tracks or disable each track.
  • Page 66 2 Variables and Instructions Valid Range of Input Variables This section gives the valid ranges of input variables to motion control instructions. Refer to individual instruction descriptions for the valid ranges for each instruction. BOOL Input Variables Any value other than FALSE is treated as TRUE. For this reason, out-of-range errors do not occur. Enumerated (ENUM) Input Variables Values that are outside of the valid range will result in an error.
  • Page 67 2 Variables and Instructions Outside the maximum Outside the minimum Name Meaning Valid range value range value range (excluding 0) 0.000 000 000 000 01 ≤ and ≤ Velocity Interpolation Velocity Set to the maximum inter- Set to 0.000 000 000 1 Maximum interpolation veloc- polation velocity.
  • Page 68 2 Variables and Instructions Enumerations This ENUM data is used by input variables to motion control instructions. An enumeration input variable is not actually set to the number, but to the enumerator. Corresponding instruction Data type Valid range Description variable _eMC_BUFFER_ 0: _mcAborting Specifies the operation for multi-execution...
  • Page 69 2 Variables and Instructions Corresponding instruction Data type Valid range Description variable _eMC_ 0: _mcChkVel Specifies the parameter to write. ParameterNumber PARAMETER_ 1: _mcChkAcc 0: Velocity Warning Value/Interpolation NUMBER 2: _mcChkDec Velocity Warning Value 3: _mcPosiChkTrq 1: Acceleration Warning Value/Interpola- 4: _mcNegaChkTrq tion Acceleration Warning Value 5: _mcFELmt...
  • Page 70 2 Variables and Instructions Corresponding instruction Data type Valid range Description variable _eMC_TRIGGER_ 0: _mcEncoderMark Specifies the trigger signal in Drive Mode. InputDrive (Trigger Input Sig- INPUT_DRIVE nal) 1: _mcEXT 0: Z-phase signal 1: External input 0: _mcHomeSwTurnHomeSw Specify the new setting of the Homing _eMC_HOMING_MODE Method.
  • Page 71: Output Variables For Motion Control Instructions

    2 Variables and Instructions Corresponding instruction Data type Valid range Description variable _eMC_ 0: _mcAccDecOverBuffer Sets the operation for when the maximum acceleration/deceleration rate would be ACCDECOVER 1: _mcAccDecOverRapid exceeded after excessive accelera- 2: _mcAccDecOverError tion/deceleration during accelera- Stop tion/deceleration control of the axis because stopping at the target position is given priority.
  • Page 72 2 Variables and Instructions Name Meaning Data type Valid range Description CommandAborted Instruction Aborted BOOL TRUE or FALSE TRUE when an instruction could not be executed or when it was aborted during execution. The instruction is not executed if there is an error with the target axis or axes group, or while the axis or axes group is decelerating to a stop.
  • Page 73 2 Variables and Instructions Name Meaning Data type Valid range Description InFeed Feeding BOOL TRUE or FALSE TRUE while feeding after receiving a latch input. InZone In Zone BOOL TRUE or FALSE TRUE when the axes position is within the zone range. Enabled BOOL TRUE or FALSE...
  • Page 74: In-Out Variables For Motion Control Instructions

    2 Variables and Instructions In-Out Variables for Motion Control Instructions The following table lists the in-out variables for motion control instructions. Name Meaning Data type Valid range Description Axis Axis _sAXIS_REF Specifies the axis. AxesGroup Axes Group _sGROUP_REF Specifies the axes group. Auxiliary Auxiliary Axis _sAXIS_REF...
  • Page 75 2 Variables and Instructions Name Meaning Data type Valid range Description Cam Properties _sMC_- Specifies a variable of _sMC_- CamProperty CAM_PROP- CAM_PROPERTY cam property struc- ERTY tures. A user-defined variable with a data type of _sMC_CAM_PROPERTY or a cam property variable created on the Cam Editor of the Sysmac Studio is specified.
  • Page 76: Instructions

    2 Variables and Instructions Instructions There are three types of motion control instructions. They are given in the following table. Type Outline Common commands Common instructions for the MC Function Module Axis commands Instructions for MC Function Module to perform single-axis control Axes group commands Instructions for MC Function Module to perform multi-axes...
  • Page 77: Axis Commands

    2 Variables and Instructions Axis Commands This section describes the instructions that are used to perform single-axis control for the MC Function Module. The Classification Column gives "Administration" for non-motion instructions and "Motion" for motion instructions. ® P: Instructions defined in PLCopen technical specifications.
  • Page 78: Axes Group Commands

    2 Variables and Instructions Instruction Instruction name Outline Classification MC_TorqueControl Torque Control Uses the Torque Control Mode of the Servo Drive to Motion control the torque. MC_SetTorqueLimit Set Torque Limit Limits the torque output from the Servo Drive Administration through the torque limit function of the Servo Drive. MC_ZoneSwitch Zone Monitor Determines if the command position or actual cur-...
  • Page 79 2 Variables and Instructions Instruction Instruction name Outline Classification MC_GroupImmediateStop Axes Group Immedi- Immediately stops all axes that are currently in Group motion ate Stop interpolated motion with the method that is speci- fied in the axis parameters. MC_GroupSetOverride Set Group Overrides Changes the blended target velocity during an inter- Group polated motion.
  • Page 80: Pdo Mapping

    Value (60BC hex), and Digital Inputs (60FD hex) Additional Information To perform fully-closed control with an OMRON G5-series R88D-KN -ECT Servo Drive, set 1701 hex as an RxPDO or select a total object size of 12 bytes or less for 1600 hex (for version 2.1 or later).
  • Page 81 2 Variables and Instructions Additional Information • Operation is as described in the following table depending on whether Modes of Operation (6060 hex) and Modes of Operation Display (6061 hex) are mapped. Modes of Operation Display (6061 Modes of Operation Display (6061 hex) mapped hex) not mapped Modes of Operation...
  • Page 82: Objects Required For Specific Instructions

    *4 Setting is required when LinkOption (Synchronization Start Condition) is set to_mcTriggerDetection and Mode is set to Drive Mode. *5 This setting is checked only when an OMRON 1S-series Servo Drive with built-in EtherCAT communications or G5-series Servo Drive with built-in EtherCAT communications is used.
  • Page 83 2 Variables and Instructions Input Settings Function Modes of opera- Touch probe pos1 Touch probe pos2 Instruction Torque actual Touch probe sta- tion display pos value (60BA pos value (60BC value (6077 hex) tus (60B9 hex) hex) hex) (6061 hex) MC_Home or MC_Home- Conditionally Conditionally...
  • Page 84 Conditionally required*1 Conditionally required*2 *1 Setting is required when Mode is set to Drive Mode. *2 Setting is required when an OMRON GX-series encoder slave is used and Mode is set to Drive Mode. Input Settings Function Touch probe pos1 Touch probe pos2 Status of Encoder’s...
  • Page 85 Axis Command Instructions This section describes the instructions that are used to perform single-axis control for the MC Function Module. MC_Power ........... . 3-3 MC_MoveJog .
  • Page 86 3 Axis Command Instructions MC_AbortTrigger ..........3-358 MC_AxesObserve .
  • Page 87: Axis Command Instructions

    3 Axis Command Instructions MC_Power The MC_Power instruction makes a Servo Drive ready to operate. Instruction Name FB/FUN Graphic expression ST expression MC_Power Power Servo MC_Power_instance ( MC_Power_instance Axis :=parameter, MC_Power Enable :=parameter, Axis Axis Status =>parameter, Enable Status Busy =>parameter, Busy Error =>parameter, Error...
  • Page 88: Function

    3 Axis Command Instructions In-Out Variables Name Meaning Data type Valid range Description Axis Axis _sAXIS_REF Specify the axis. * Specify a user-defined Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio (default: MC_Axis***) or a system-defined axis variable name (_MC_AX[*], _MC1_AX[*], or _MC2_AX[*]). Function •...
  • Page 89 3 Axis Command Instructions Additional Information Execution of an execute-type motion control instruction is started when the power flow that is connected to the Execute input changes to TRUE and continues until the control operation for the instruction is completed. Even if master control is reset after execution of the instruction is started, execution of the instruction is continued until the control operation for the instruction is completed.
  • Page 90 3 Axis Command Instructions Enable Status Busy The specified axis becomes Ready status is cleared for the ready for operation. specified axis. Precautions for Correct Use Precautions for Correct Use • Status (Servo ON) will not change to TRUE until Enable changes to TRUE and the processing is finished at the axis.
  • Page 91 3 Axis Command Instructions Power A Enable Status Busy Power B Enable Status Busy Error ErrorID Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561)
  • Page 92: Mc_Movejog

    3 Axis Command Instructions MC_MoveJog The MC_MoveJog instruction jogs an axis according to the specified target velocity. Instruction Name FB/FUN Graphic expression ST expression MC_MoveJog MC_MoveJog_instance ( MC_MoveJog_instance Axis :=parameter, MC_MoveJog PositiveEnable :=parameter, Axis Axis NegativeEnable PositiveEnable Busy :=parameter, NegativeEnable CommandAborted Velocity :=parameter, Velocity...
  • Page 93: Function

    3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. CommandAborted Command BOOL TRUE or FALSE TRUE when the instruction is aborted. Aborted Error Error BOOL TRUE or FALSE TRUE while there is an error.
  • Page 94 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • When creating a ladder diagram program, you must connect the PositiveEnable (Positive Direction Enable) input variable to the left bus bar and specify a variable for the NegativeEn- able (Negative Direction Enable) input variable as shown below.
  • Page 95 3 Axis Command Instructions Master control started. MC_On MCNo Servo turned ON. PWR1 MC_Power MC_Axis000 Axis Axis Pwr1_Status Pwr1_En Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID Master control ended. MCNo MC_MoveJog Instruction MC_MoveJog_instance MC_MoveJog MC_Axis000 Axis Axis J_DONE POS_EN PositiveEnable Busy NEGA_EN...
  • Page 96 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE as soon as PositiveEnable (Positive Direction Enable) or Nega- tiveEnable (Negative Direction Enable) changes to TRUE. • The axis starts deceleration as soon as PositiveEnable (Positive Direction Enable) or NegativeEnable (Negative Direction Enable) changes to FALSE.
  • Page 97 3 Axis Command Instructions Timing Chart When Target Velocity Is 0 When the Velocity (Target Velocity) is 0 and you start jogging the axis, the axis will enter continuous operation without motion. The following timing chart shows an example when the Velocity (Target Velocity) is 0 and you start jogging the axis.
  • Page 98 3 Axis Command Instructions Re-execution of Motion Control Instructions Restarting with Enable in the Same Direction If you change PositiveEnable (Positive Direction Enable) or NegativeEnable (Negative Direction Enable) to TRUE when it is FALSE and the axis is decelerating, the axis will begin to accelerate towards the target velocity.
  • Page 99 3 Axis Command Instructions PositiveEnable NegativeEnable Busy CommandAborted Error ErrorID 16#0000 Velocity Time Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 100: Mc_Home

    3 Axis Command Instructions MC_Home The MC_Home instruction operates the motor to determine home. It uses the limit signals, home prox- imity signal, and home signal. Instruction Name FB/FUN Graphic expression ST expression MC_Home Home MC_Home_instance ( MC_Home_instance Axis :=parameter, MC_Home Execute :=parameter, Axis...
  • Page 101: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 102 Refer to I/O Entry Mappings in the NX-series Position Interface Units User’s Manual (Cat. No. W524) for information on using the NX-series Position Interface Units. Settings for OMRON 1S-series Servo Drives Set the input signals, such as the home proximity signal, that are used by the home instruction in the OMRON 1S-series Servo Drive.
  • Page 103 3 Axis Command Instructions Homing Operation Modes You can select any of the ten operations to define home. For details on the operations, refer to Function on page 3-17. • Proximity reverse turn/home proximity input OFF • Proximity reverse turn/home proximity input ON •...
  • Page 104 3 Axis Command Instructions Additional Information If you use NX-series Position Interface Units, do not select holding for the Homing Operation Mode. Refer to the NX-series Position Interface Units User’s Manual (Cat. No. W524) for details. Operation Selection at Positive Limit Input and Operation Selection at Negative Limit Input •...
  • Page 105 3 Axis Command Instructions Homing Start Direction Select the direction in which the axis starts moving when homing is started. If homing starts while the home proximity signal is ON in a Homing Operation Mode that includes reversal operation, the axis starts motion in the direction opposite to the home input detection direction (regardless of the setting of the homing start direction).
  • Page 106 3 Axis Command Instructions Home Input Detection Direction Select the direction when home input is detected. The following timing chart shows the operation when the home input detection direction is FALSE (pos- itive direction). Operation Example: Proximity Reverse Turn/Home Proximity Input OFF Home proximity input signal Home input signal Homing velocity...
  • Page 107 3 Axis Command Instructions Homing Velocity This is the high velocity during homing. Homing Approach Velocity This is the proximity velocity during homing. Homing Compensation Velocity This is the velocity when you set a homing compensation value. For details on the operation, refer to Homing Compensation on page 3-32.
  • Page 108 3 Axis Command Instructions Home input detection direction Home proximity input signal Home input signal Homing velocity Homing approach velocity Stops. Negative direction Positive direction Start Command output Homing velocity • If you start homing while the home proximity input signal is ON, the operation will start at the hom- ing velocity in the direction opposite to the home input detection direction.
  • Page 109 3 Axis Command Instructions Homing Start Direction Different from Home Input Detection Direction Operation starts in the homing start direction at the homing velocity, regardless of the status of the home proximity input signal. If you set the operation at the limit input in the homing start direction to reverse direction, the axis reverses direction when limit input is detected and performs a homing operation in the home input detection direction.
  • Page 110 3 Axis Command Instructions 8: Operation for Limit input OFF The axis starts at the homing velocity. When the limit signal in the direction opposite to the home input detection direction turns ON, the axis starts decelerating to the homing approach velocity. After the axis reaches the homing approach velocity, the axis stops at the first home input signal after the limit signal turns OFF.
  • Page 111 3 Axis Command Instructions • Homing is started and home is defined when the home input signal turns ON after the axis travels the home input mask distance after the home proximity input signal turns ON while the velocity is below the homing approach velocity.
  • Page 112 3 Axis Command Instructions • The MC Function Module detects the limit input without an external latch function, such as one provided by a Servo Drive. MC Function Module processing is the processing performed at the primary period interval for the primary periodic task and at the task period of the priority-5 periodic task for the priority-5 periodic task.
  • Page 113 Decelerating the axis and monitoring time are started at the same time. The torque limit at the start of holding differs between OMRON 1S-series as well as G5-series Servo Drives and other Servo Drives as shown below.
  • Page 114 13: No Home Proximity Input/Holding Home Input Operation The axis starts at the homing approach velocity. The torque limit at the start of holding differs between OMRON 1S-series as well as G5-series Servo Drives and other Servo Drives as shown below.
  • Page 115 3 Axis Command Instructions 14: Zero Position Preset Operation The command current position is set to the home position offset to define home. Also, the following error between the command current position and the actual position is retained. Execute Busy Done CommandAborted Error...
  • Page 116 Overrides are disabled for this instruction. Automatic Control of Torque Limit If you are using an OMRON 1S-series Servo Drive or G5-series Servo Drive, and you select either Proximity Reverse Turn/Holding Time Operation (12) or No Home Proximity Input/Holding Home Input Operation (13) for the homing operation, the torque limit will be automatically started in the holding direction.
  • Page 117 Also, for details on the settings of 1S-series Servo Drives, refer to the AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communications User’s Manual (Cat. No. I586). Holding Operation for OMRON G5-series Servo Drives Torque limits that are set in the Servo Drive in advance are used for the Proximity Reverse Turn/Holding Time (12) or No Home Proximity Input/Holding Home Input (13) Homing Operation Modes to automatically start torque control in the home input detection direction.
  • Page 118 • The torque limits are automatically released when an instruction that moves the axis in the opposite direction is executed. Settings for OMRON G5-series Servo Drives To use the holding operation, you must use the support software of the Servo Drive to set the Torque Limit Selection (3521 hex) in the G5-series Servo Drive.
  • Page 119 3 Axis Command Instructions Timing Charts The following charts show the timing of homing. No Homing Compensation Execute Busy Done CommandAborted Error ErrorID 16#0000 Homing Homed (Home Defined) Velocity Time With Homing Compensation Execute Busy Done CommandAborted Error ErrorID 16#0000 Homing Homed (Home Defined) Velocity...
  • Page 120 3 Axis Command Instructions Execution When Home Is Defined Execute Busy Done CommandAborted Error ErrorID 16#0000 Homing Homed (Home Defined) Velocity Time Execution with Incorrect Parameters or When Motion Control Instructions Are Disabled Execute Done Busy CommandAborted Error ErrorID Error code 16#0000 Homing Homed (Home Defined)
  • Page 121 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 122: Mc_Homewithparameter

    3 Axis Command Instructions MC_HomeWithParameter The MC_HomeWithParameter instruction sets the homing parameter and operates the motor to determine home. It uses the limit signals, home proximity signal, and home signal. Instruction Name Graphic expression ST expression MC_HomeWith Home with MC_HomeWithParameter MC_HomeWithParameter_instance Parameter Parameters...
  • Page 123 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 124 3 Axis Command Instructions Name Meaning Data type Valid range Function StartDir Homing Start _eMC_ 0:_mcPositiveDirection Set the start direction for when homing is Direction DIRECTION started. 2:_mcNegativeDirection 0: Positive direction 2: Negative direction HomeDir Home Input _eMC_ 0:_mcPositiveDirection Set the home input detection direction for Detection DIRECTION homing.
  • Page 125: Function

    The unit is command units/s. *1 This setting can be used for an OMRON 1S-series Servo Drive and G5-series Servo Drive. The input allocated to latch 1 for the Servo Drive is used as the external home input. In the default setting of the OMRON 1S-series Servo Drives and G5-series Servo Drives, the external latch input 1 is allocated to latch 1.
  • Page 126 3 Axis Command Instructions Relationship between the Homing Method and Homing Parameters Some of the homing parameters are not used depending on the setting of the homing method. Range and consistency checks are not performed for the parameters that are not used. Range and consis- tency checks are performed when the instruction is executed.
  • Page 127 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 128: Mc_Move

    3 Axis Command Instructions MC_Move The MC_Move instruction performs absolute positioning or relative positioning. Instruction Name FB/FUN Graphic expression ST expression MC_Move Positioning MC_Move_instance ( MC_Move_instance Axis :=parameter, MC_Move Execute :=parameter, Axis Axis Position :=parameter, Execute Done Velocity :=parameter, Position Busy Acceleration :=parameter, Velocity...
  • Page 129 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Direction Direction _eMC_DIRECTION 0: _mcPositiveDirection Specify the direction of rota- 1: _mcShortestWay tion when MoveMode is set 2: _mcNegativeDirection to absolute positioning* 3: _mcCurrentDirection when the Count Mode is 4: _mcNoDirection Rotary Mode.
  • Page 130: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the axis decelerates to a stop and the • When Execute is TRUE and changes to velocity reaches 0. FALSE.
  • Page 131 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use When you perform absolute positioning, set the target position so that the settings of the Modulo Maximum Position Setting Value and Modulo Minimum Position Setting Value axis parameters are not exceeded.
  • Page 132 3 Axis Command Instructions Execution of Other Instructions during Instruction Execution If you execute another instruction during execution of this instruction, you can specify aborting, buff- ering, or blending. Errors Timing Chart When Error Occurs If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code).
  • Page 133: Mc_Moveabsolute

    3 Axis Command Instructions MC_MoveAbsolute The MC_MoveAbsolute instruction moves the axis to a specified absolute target position. Instruction Name Graphic expression ST expression MC_MoveAbsolute Absolute MC_MoveAbsolute_instance ( MC_MoveAbsolute_instance Positioning Axis :=parameter, MC_MoveAbsolute Execute :=parameter, Axis Axis Position :=parameter, Execute Done Velocity :=parameter, Position Busy...
  • Page 134 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Direction Direction _eMC_ 0: _mcPositiveDirection Specify the direction of rotation DIRECTION 1: _mcShortestWay when the Count Mode is Rotary 2: _mcNegativeDirection Mode. 3: _mcCurrentDirection 0: Positive direction 4: _mcNoDirection 1: Shortest way 2: Negative direction 3: Current direction...
  • Page 135: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE CommandAborted • When this instruction is aborted because • When Execute is TRUE and changes to another motion control instruction was FALSE. executed with the Buffer Mode set to •...
  • Page 136 3 Axis Command Instructions Specify Jerk when you want to accelerate or decelerate smoothly. The following chart shows an opera- tion example when Jerk is specified. Velocity Target velocity Time Command current Target position position For details on Jerk, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 137 3 Axis Command Instructions Positioning starts in the negative direction towards the target position when the negative direction is specified for Direction. The following chart shows an operation example when positioning starts with a command position of 50 and moves toward −20. Modulo maximum position setting Command current...
  • Page 138 3 Axis Command Instructions When No direction is specified for Direction, you can specify a Position (Target Position) outside the range specified by the modulo maximum position and modulo minimum position setting values. When Position (Target Position) is outside the range specified by the modulo maximum position and modulo minimum position setting values, positioning is performed using the travel distance exceed- ing the modulo maximum position setting value as a relative distance.
  • Page 139 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • When you perform absolute positioning, set the target position so that it is less than the Mod- ulo Maximum Position Setting Value axis parameter and greater than or equal to the Modulo Minimum Position Setting Value axis parameter.
  • Page 140 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • Done changes to TRUE when Position (Target Position) is reached and positioning is completed. •...
  • Page 141 3 Axis Command Instructions Execution during Execution of Other Instructions You can switch to this instruction or buffer this instruction if you execute it during execution of another instruction. You can buffer one instruction per axis. Specify the operation of this instruction using BufferMode (Buffer Mode Selection) for multi-execution of instructions.
  • Page 142 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Execute Done...
  • Page 143: Sample Programming 1

    3 Axis Command Instructions Sample Programming 1 This section shows sample programming for positioning by periodic multi-execution of instructions. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Type Axis Axis Type Axis 1 Servo axis Count Mode...
  • Page 144 3 Axis Command Instructions Turning ON the Operation Start Switch When you turn ON the operation start switch at home, axis 1 is positioned to 50.00 mm in the positive direction. Turning ON the Operation Start Switch Again Thereafter, axis 1 is positioned to 100.00 mm and 200.00 mm, and then returns to home and stops.
  • Page 145 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON. MC_Power Pwr_Status MC_Axis000 Axis Axis Lock1...
  • Page 146 3 Axis Command Instructions After absolute positioning 2 is started, absolute positioning 3 is started with multi-execution of instructions. MV_ABS3 MC_MoveAbsolute Mv_Abs3_D MC_Axis000 Axis Axis Mv_Abs2_Act Execute Done LREAL#200.0 Position Busy Mv_Abs3_Bsy LREAL#30.0 Velocity Active Mv_Abs3_Act LREAL#1000.0 Acceleration CommandAborted Mv_Abs3_Ca LREAL#1000.0 Deceleration Error...
  • Page 147 3 Axis Command Instructions Timing Chart Pwr_Status Hm_Ex Hm_D Hm_Bsy Mv_Abs1_Ex Mv_Abs1_D Mv_Abs1_Bsy Mv_Abs1_Act Mv_Abs2_Ex Mv_Abs2_D Mv_Abs2_Bsy Mv_Abs2_Act Mv_Abs3_Ex Mv_Abs3_D Mv_Abs3_Bsy Mv_Abs3_Act Mv_Zero_Ex Mv_Zero_D Mv_Zero_Bsy Mv_Zero_Act Sample Programming // Processing when input parameters are not set IF InitFlag = FALSE THEN // MV_ABS1 parameters Mv_Abs1_Pos := LREAL#50.0;...
  • Page 148 3 Axis Command Instructions Mv_Zero_Dec := LREAL#1000.0; Mv_Zero_Bm := _eMC_BUFFER_MODE#_mcBuffered; // Change InitFlag to TRUE after setting the input parameters. InitFlag:=TRUE; END_IF; // If StartPg is TRUE and EtherCAT communications are normal, the Servo is turned ON. // If EtherCAT communications are not normal, the Servo is turned OFF. IF (StartPg=TRUE) AND (_EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress]=TRUE) AND (_EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]=FALSE) THEN...
  • Page 149 3 Axis Command Instructions //MC_Power PWR( Axis := MC_Axis000, Enable := Pwr_En, Status => Pwr_Status, Busy => Pwr_Bsy, Error => Pwr_Err, ErrorID => Pwr_ErrID //MC_Home Axis := MC_Axis000, Execute := Hm_Ex, Done => Hm_D, Busy => Hm_Bsy, CommandAborted => Hm_Ca, Error =>...
  • Page 150 3 Axis Command Instructions Deceleration := Mv_Abs3_Dec, Direction := Mv_Abs3_Dir, BufferMode := Mv_Abs3_Bm, Done => Mv_Abs3_D, Busy => Mv_Abs3_Bsy, Active => Mv_Abs3_Act, CommandAborted => Mv_Abs3_Ca, Error => Mv_Abs3_Err, ErrorID => Mv_Abs3_ErrID //MC_MoveZeroPosition MV_ZERO( Axis := MC_Axis000, Execute := Mv_Zero_Ex, Velocity := Mv_Zero_Vel, Acceleration := Mv_Zero_Acc,...
  • Page 151: Sample Programming 2

    3 Axis Command Instructions Sample Programming 2 In this sample, when the Count Mode is set to Rotary Mode and positioning is performed toward the tar- get position, the shortest direction, clockwise or counterclockwise, is automatically determined and positioning is performed. This section shows sample programming for shortest-way control of the rotation direction of a tool changer.
  • Page 152 3 Axis Command Instructions If you specify 0° (home), 90°, 120°, or 290°, the axis will move to that position. The rotation direction in this instance is in the shorter rotation direction. The travel velocity is 250°/s. The sample programming performs positioning with a shortest way specification from 290° to 90° to 120°...
  • Page 153 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON. MC_Power Pwr_Status MC_Axis000 Axis Axis Lock1...
  • Page 154 3 Axis Command Instructions If the Servo is ON and home is not defined, the Home instruction is executed. MC_Home Hm_D MC_Axis000 Axis Axis Pwr_Status MC_Axis000.Details.Homed Execute Done Busy Hm_Bsy CommandAborted Hm_Ca Error Hm_Err ErrorID Hm_ErrID After home is defined, absolute positioning 1 is executed to move to 290.0°. The shortest way is specified for the motion direction.
  • Page 155 3 Axis Command Instructions Absolute positioning 4 is executed with multi-execution of instructions to move from 120.0° to 0.0°. The shortest way is used for the motion direction. MV_ABS4 MC_MoveAbsolute Mv_Abs4_D MC_Axis000 Axis Axis Mv_Abs3_Act Execute Done LREAL#0.0 Position Busy Mv_Abs4_Bsy LREAL#250.0 Velocity...
  • Page 156 3 Axis Command Instructions Timing Chart Pwr_Status Hm_Ex Hm_D Hm_Bsy Mv_Abs1_Ex Mv_Abs1_D Mv_Abs1_Bsy Mv_Abs1_Act Mv_Abs2_Ex Mv_Abs2_D Mv_Abs2_Bsy Mv_Abs2_Act Mv_Abs3_Ex Mv_Abs3_D Mv_Abs3_Bsy Mv_Abs3_Act Mv_Abs4_Ex Mv_Abs4_D Mv_Abs4_Bsy Mv_Abs4_Act Command velocity MC_Axis000 Time Sample Programming // Processing when input parameters are not set IF InitFlag = FALSE THEN // MV_ABS1 parameters Mv_Abs1_Pos...
  • Page 157 3 Axis Command Instructions Mv_Abs3_Pos := LREAL#120.0; Mv_Abs3_Vel := LREAL#250.0; Mv_Abs3_Acc := LREAL#1000.0; Mv_Abs3_Dec := LREAL#1000.0; Mv_Abs3_Dir := _eMC_DIRECTION#_mcShortestWay; Mv_Abs3_Bm := _eMC_BUFFER_MODE#_mcBuffered; // MV_ABS4 parameters Mv_Abs4_Pos := LREAL#0.0; Mv_Abs4_Vel := LREAL#250.0; Mv_Abs4_Acc := LREAL#1000.0; Mv_Abs4_Dec := LREAL#1000.0; Mv_Abs4_Dir := _eMC_DIRECTION#_mcShortestWay; Mv_Abs4_Bm := _eMC_BUFFER_MODE#_mcBuffered;...
  • Page 158 3 Axis Command Instructions Enable := Pwr_En, Status => Pwr_Status, Busy => Pwr_Bsy, Error => Pwr_Err, ErrorID => Pwr_ErrID // MC_Home Axis := MC_Axis000, Execute := Hm_Ex, Done => Hm_D, Busy => Hm_Bsy, CommandAborted => Hm_Ca, Error => Hm_Err, ErrorID =>...
  • Page 159 3 Axis Command Instructions Done => Mv_Abs3_D, Busy => Mv_Abs3_Bsy, Active => Mv_Abs3_Act, CommandAborted => Mv_Abs3_Ca, Error => Mv_Abs3_Err, ErrorID => Mv_Abs3_ErrID // Absolute positioning (4) MV_ABS4( Axis := MC_Axis000, Execute := Mv_Abs4_Ex, Position := Mv_Abs4_Pos, Velocity := Mv_Abs4_Vel, Acceleration := Mv_Abs4_Acc, Deceleration := Mv_Abs4_Dec,...
  • Page 160: Mc_Moverelative

    3 Axis Command Instructions MC_MoveRelative The MC_MoveRelative instruction moves the axis the specified travel distance from the command cur- rent position. Instruction Name Graphic expression ST expression MC_MoveRelative Relative MC_MoveRelative_instance ( MC_MoveRelative_instance Positioning Axis :=parameter, MC_MoveRelative Execute :=parameter, Axis Axis Distance :=parameter, Execute Done...
  • Page 161 3 Axis Command Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer Mode _eMC_BUFFER_ 0: _mcAborting Specify the behavior when Selection MODE 1: _mcBuffered executing more than one 2: _mcBlendingLow motion instruction. 3: _mcBlendingPrevious 0: Aborting 4: _mcBlendingNext 1: Buffered 5: _mcBlendingHigh 2: Blending low...
  • Page 162: Function

    3 Axis Command Instructions In-Out Variables Name Meaning Data type Valid Ranges Description Axis Axis _sAXIS_REF Specify the axis. * Specify a user-defined Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio (default: MC_Axis***) or a system-defined axis variable name (_MC_AX[*], _MC1_AX[*], or _MC2_AX[*]). Function •...
  • Page 163 3 Axis Command Instructions For details on Jerk, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Instruction Details When the Count Mode is Rotary Mode, you can specify a Distance (Travel Distance) that exceeds the relative distance range from the Modulo Minimum Position Setting Value axis parameter to the Modulo Maximum Position Setting Value axis parameter so that you can perform multiple ring rotation position- ing.
  • Page 164 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • Done changes to TRUE when Distance (Target Distance) is reached and positioning is completed. •...
  • Page 165 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use To change any input parameter other than Distance (Travel Distance), re-execute the instruction with Distance (Travel Distance) assigned to the same value as the original instruction. For example, if Distance (Travel Distance) is changed to 0 when the instruction is re-executed, the re-executed instruction will use a Distance (Travel Distance) of 0 from the first time it is exe- cuted.
  • Page 166 3 Axis Command Instructions For details on BufferMode (Buffer Mode Selection), refer to the NJ/NX-series CPU Unit Motion Con- trol User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Con- trol User’s Manual (Cat. No. W559). Execution of Other Instructions during Instruction Execution If you execute another instruction during execution of this instruction, you can specify aborting, buff- ering, or blending.
  • Page 167: Mc_Movevelocity

    3 Axis Command Instructions MC_MoveVelocity The MC_MoveVelocity instruction performs velocity control with the Position Control Mode of the Servo Drive. Instruction Name FB/FUN Graphic expression ST expression MC_MoveVelocity Velocity MC_MoveVelocity_instance ( MC_MoveVelocity_instance Control Axis :=parameter, MC_MoveVelocity Execute :=parameter, Axis Axis Velocity :=parameter, Execute InVelocity...
  • Page 168 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Continuous Continuation BOOL TRUE or FALSE FALSE Reserved (Reserved) Mode Selec- tion *1 Refer to Unit Conversion Settings in the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY- series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 169: Function

    3 Axis Command Instructions In-Out Variables Name Meaning Data type Valid range Description Axis Axis _sAXIS_REF Specify the axis. * Specify a user-defined Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio (default: MC_Axis***) or a system-defined axis variable name (_MC_AX[*], _MC1_AX[*], or _MC2_AX[*]). Function •...
  • Page 170 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • InVelocity (Target Velocity Reached) changes to TRUE when Velocity (Target Velocity) is reached. •...
  • Page 171 3 Axis Command Instructions You can specify Acceleration (Acceleration Rate), Deceleration (Deceleration Rate) and Jerk as input variables. When the Velocity (Target Velocity) is 0 and the instruction is executed, the axis will enter continuous operation without motion. The following chart shows an operation example of when Velocity (Target Velocity) is 0. Execute Busy Active...
  • Page 172 3 Axis Command Instructions Re-execution of Motion Control Instructions You can change the operation of the instruction if you change an input parameter during continuous operation and then change Execute to TRUE again. Input variables Velocity (Target Velocity), Accelera- tion (Acceleration Rate), and Deceleration (Deceleration Rate) can be changed by re-executing the motion control instruction.
  • Page 173 3 Axis Command Instructions Error If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Execute InVelocity...
  • Page 174: Sample Programming

    3 Axis Command Instructions Sample Programming This section shows sample programming for velocity control, such as for a spinner or centrifuge. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Type Axis Axis Type Axis 1 Servo axis...
  • Page 175 3 Axis Command Instructions When the Sensor2 bit changes to TRUE, the override factor is set to 500% and the velocity is changed. Changing to the Third Velocity When the Sensor3 bit changes to TRUE, the override factor is set to 200% and the velocity is changed.
  • Page 176 3 Axis Command Instructions Timing Chart Pwr_Status Sensor1 Vel_Bsy Vel_Act Set_Ov_Bsy Set_Ov_End Sensor2 Sensor3 StopTrig Stp_D Stp_Act Command velocity MC_Axis000 Time Sample Programming If StartPg is TRUE, EtherCAT communications are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]...
  • Page 177 3 Axis Command Instructions During execution of the MC_MoveVelocity (Velocity Control) instruction, the override factor is changed according to the status of the Sensor2 and Sensor3 bits. Vel_Act Note: The contents of the inline ST are given below. The MC_SetOverride (Set Override Factors) instruction is executed during execution of the MC_MoveVelocity (Velocity Control) instruction.
  • Page 178 3 Axis Command Instructions Name Data type Default Comment StartPg BOOL FALSE The Servo is turned ON if this variable is TRUE and EtherCAT process data communications are established. Vel_Act BOOL FALSE This variable is assigned to the Active output vari- able from the VEL instance of the MC_MoveVe- locity instruction.
  • Page 179 3 Axis Command Instructions Timing Chart Pwr_Status Sensor1 Vel_Ex Vel_Act Set_Ov_En Set_Ov_End Sensor2 Sensor3 StopTrig Stp_Ex Stp_D Stp_Act Command velocity MC_Axis000 Time Sample Programming // Processing when input parameters are not set IF InitFlag = FALSE THEN // MC_MoveVelocity parameters Vel_Vel := LREAL#1048576.0;...
  • Page 180 3 Axis Command Instructions END_IF; // If the Servo is ON for axis 1 and the Sensor1 bit is TRUE, the MC_MoveVelocity instruction is executed. IF (Pwr_Status=TRUE) AND (Sensor1=TRUE) THEN Vel_Ex := TRUE; END_IF; // During execution of the MC_MoveVelocity instruction, the override factor is changed according to the status of the Sensor2 and Sensor3 bits.
  • Page 181 3 Axis Command Instructions //MC_SetOverride SET_OV( Axis := MC_Axis000, Enable := Set_Ov_En, VelFactor := Set_Ov_Velfct, AccFactor := Set_Ov_Accfct, JerkFactor := Set_Ov_Jfct, Busy => Set_Ov_Bsy, Enabled => Set_Ov_End, Error => Set_Ov_Err, ErrorID => Set_Ov_ErrID //MC_Stop STP( Axis := MC_Axis000, Execute := Stp_Ex, Deceleration := Stp_Dec, Done...
  • Page 182: Mc_Movezeroposition

    3 Axis Command Instructions MC_MoveZeroPosition The MC_MoveZeroPosition instruction performs positioning with an absolute position of 0 as the target position to return to home. Instruction Name Graphic expression ST expression MC_MoveZeroPosition High- MC_MoveZeroPosition_instance ( MC_MoveZeroPosition_instance speed Axis :=parameter, MC_MoveZeroPosition Home Execute :=parameter, Axis Axis...
  • Page 183 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or FALSE TRUE when the instruction is completed. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. Active Controlling BOOL TRUE or FALSE TRUE when the axis is being controlled.
  • Page 184: Function

    3 Axis Command Instructions Function • The axis moves to home. • You can specify the Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Decel- eration Rate), and Jerk as input variables. Precautions for Correct Use Precautions for Correct Use Execute the MC_MoveZeroPosition (High-speed Home) instruction only after defining home. If home is not defined, an Instruction Execution Error with Undefined Home (error code: 5466 hex) occurs.
  • Page 185 3 Axis Command Instructions Operation Example Velocity Target velocity Acceleration Deceleration Time Command current position When the acceleration rate or deceleration rate is 0 and the instruction is executed, it will reach the target velocity without accelerating or decelerating. The following chart shows an operation example of when the acceleration rate is 0. Velocity Target velocity Deceleration...
  • Page 186 3 Axis Command Instructions Timing Charts A timing chart for execution of the MC_MoveZeroPosition (High-speed Home) instruction is shown below. Execute Busy Active Done CommandAborted Error ErrorID 16#0000 Velocity Time Aborting the Instruction Home will not become undefined even if this instruction is aborted and CommandAborted changes to TRUE.
  • Page 187 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 188 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Execute Done...
  • Page 189: Mc_Movefeed

    3 Axis Command Instructions MC_MoveFeed The MC_MoveFeed instruction performs positioning for the specified travel distance from the position where an external device triggers an interrupt input. Interrupt feeding is possible for absolute position- ing, relative positioning, and velocity control. Instruction Name FB/FUN Graphic expression...
  • Page 190: Variables

    3 Axis Command Instructions Variables Input Variables Name Meaning Data type Valid range Default Description Execute Execute BOOL TRUE or FALSE FALSE The instruction is executed when Execute changes to TRUE. WindowOnly Window Only BOOL TRUE or FALSE FALSE Specify whether to enable or disable the window.
  • Page 191 3 Axis Command Instructions Name Meaning Data type Valid range Default Description MoveMode Travel Mode _eMC_MOVE_ 0: _mcAbsolute Select the travel method. MODE 1: _mcRelative 0: Absolute positioning 2: _mcVelocity 1: Relative positioning 2: Velocity control FeedDistance Feed Distance LREAL Negative number, posi- Specify the travel distance tive number, or 0...
  • Page 192 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 193: Function

    3 Axis Command Instructions _sTRIGGER_REF Name Meaning Data type Valid range Function Mode Mode _eMC_TRIG- 0: _mcDrive Specify the trigger mode. GER_ MODE 1: _mcController 0: Drive Mode 1: Controller Mode LatchID Latch ID _eMC_TRIG- 0: _mcLatch1 Specify which of the two latch functions Selection GER_ LATCHID 1: _mcLatch2...
  • Page 194 3 Axis Command Instructions Mapping Data Objects You must map the following object data when the MC_MoveFeed (Interrupt Feeding) instruction is executed with Mode set to Drive Mode. Mapping is performed in the Detailed Setting Area of the Axis Basic Settings Display of the Sysmac Studio. •...
  • Page 195 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • When using Drive Mode, make sure that you connect the latch signal to the LatchID that you are going to use. • The width of the latch signal depends on the performance of the Servo Drive or NX-series Pulse Output Unit and other factors.
  • Page 196 Select _mcEXT (external input) to use the external trigger signal of the Servo Drive or NX-series Pulse Output Unit as the trigger. • For an OMRON 1S-series Servo Drive, there are two options for _mcEXT: Ext1, and Ext2. For an OMRON G5-series Servo Drive, there are three options for _mcEXT: Ext1, Ext2, and Ext3. Use Sysmac Studio to make the setting.
  • Page 197 3 Axis Command Instructions WindowOnly Set to Enable Only trigger inputs within the window are detected to latch the axis position. Trigger enabled range TriggerInput Execute WindowOnly Done Busy RecordedPosition Position CommandAborted Error ErrorID 16#0000 Axis position LastPosition Position FirstPosition Precautions for Correct Use Precautions for Correct Use •...
  • Page 198 3 Axis Command Instructions Note The window only range can include the FirstPosition and LastPosition. Rotary Mode • The FirstPosition can be less than, equal to, or greater than the LastPosition. • If the FirstPosition is greater than the LastPosition, the setting range includes the modulo maxi- mum position and modulo minimum position setting values.
  • Page 199 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • After an interrupt input, InFeed changes to TRUE and when FeedDistance is reached and positioning is completed, Done changes to TRUE.
  • Page 200 3 Axis Command Instructions When MoveMode (Travel Mode) is _mcVelocity Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Velocity Time Operation Selection at Reversing Axis Parameter When feeding reverses its direction after the interrupt input, operation follows the Operation Selec- tion at Reversing axis parameter When Motion Variable Is 0 (Decelerate to a Stop After Reversing) Execute...
  • Page 201 3 Axis Command Instructions Additional Information The deceleration rate when the axis reverses after an interrupt input follows the Deceleration (Deceleration Rate) input variable. When Motion Variable Is 1 (Stop Immediately After Reversing) Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input...
  • Page 202 3 Axis Command Instructions When MoveMode (Travel Mode) is _mcAbsolute and an Interrupt Input Is Not Received When ErrorDetect (Error Detection Selection) Is Set to Not Detect Errors Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Velocity Time When ErrorDetect (Error Detection Selection) Is Set to Detect Errors Execute...
  • Page 203 3 Axis Command Instructions When WindowOnly Is Enabled Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Position LastPosition FirstPosition Time Velocity Time NY-series Motion Control Instructions Reference Manual (W561) 3-119...
  • Page 204 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 205 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs When there is an error, the latch used for the interrupt input for this instruction is disabled.
  • Page 206: Sample Programming

    3 Axis Command Instructions Sample Programming This section shows sample programming where control changes from velocity control to interrupt feed- ing. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Types Axis Axis Type Axis 1 Servo axis...
  • Page 207 3 Axis Command Instructions Operation Pattern Position control Velocity control Velocity Time Sensor operation Stamp Conveyor Operation Axis 1, which moves the conveyer belt, performs velocity control before interrupt feeding. Feeding Sensor 1 is connected to latch 1. When Sensor1 turns ON, operation changes to feeding and the axis stops at the specified posi- tion.
  • Page 208 3 Axis Command Instructions Name Data type Default Comment InitFlag BOOL FALSE This variable indicates if it is necessary to set the input parameters. Input parameters are set when this variable is FALSE. When setting the input parameters is completed, this variable changes to TRUE.
  • Page 209 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON. PWR1 MC_Power Pwr1_Status...
  • Page 210 3 Axis Command Instructions PWR2 MC_Power Pwr2_Status MC_Axis001 Axis Axis Lock2 Enable Status Busy Pwr2_Bsy Error Pwr2_Err ErrorID Pwr2_ErrID If a minor fault level error occurs for the axis composition, the error handler for the device (FaultHandler) is executed. Program the FaultHandler according to the device. MC_Axis000.MFaultLvl.Active FaultHandler FaultHandler...
  • Page 211 3 Axis Command Instructions If home is defined for axis 1, interrupt feeding is executed for axis 1. MV_FEED MC_MoveFeed MC_Axis000 Axis Axis Mv_Feed_TrigRef TriggerInput TriggerInput Mv_Feed_D Mv_Feed_TrigVar TriggerVariable TriggerVariable MC_Axis000.Details.Homed Execute Done WindowOnly InFeed Mv_Feed_InFeed FirstPosition Busy Mv_Feed_Bsy LastPosition Active Mv_Feed_Act ReferenceType...
  • Page 212 3 Axis Command Instructions Mv_Feed_FeedVel := LREAL#500.0; // MV_ABS parameters Mv_Abs_Pos := LREAL#1000.0; Mv_Abs_Vel := LREAL#500.0; Mv_Abs_Acc := LREAL#10000.0; Mv_Abs_Dec := LREAL#10000.0; Mv_Abs_Jrk := LREAL#10000.0; // MV_ZERO parameters Mv_Zero_Vel := LREAL#500.0; Mv_Zero_Acc := LREAL#10000.0; Mv_Zero_Dec := LREAL#10000.0; Mv_Zero_Jrk := LREAL#10000.0; Mv_Zero_Bm := _eMC_BUFFER_MODE#_mcBuffered;...
  • Page 213 3 Axis Command Instructions Timing Chart Sensor 1 Hm1_D Hm2_D Mv_Feed_Ex Mv_Feed_D Mv_Feed_InFeed Mv_Feed_Bsy Mv_Feed_Act Mv_Abs_Ex Mv_Abs_D Mv_Abs_Bsy Mv_Abs_Act Mv_Zero_Ex Mv_Zero_D Mv_Zero_Bsy Mv_Zero_Act Velocity MC_Axis000 command current velocity Time Velocity MC_Axis001 command current velocity Time Sample Programming // Processing when input parameters are not set IF InitFlag=FALSE THEN // MV_FEED parameters Mv_Feed_TrigRef.Mode...
  • Page 214 3 Axis Command Instructions // MV_ABS parameters Mv_Abs_Pos := LREAL#1000.0; Mv_Abs_Vel := LREAL#500.0; Mv_Abs_Acc := LREAL#10000.0; Mv_Abs_Dec := LREAL#10000.0; Mv_Abs_Jrk := LREAL#10000.0; // MV_ZERO parameters Mv_Zero_Vel := LREAL#500.0; Mv_Zero_Acc := LREAL#10000.0; Mv_Zero_Dec := LREAL#10000.0; Mv_Zero_Jrk := LREAL#10000.0; Mv_Zero_Bm := _eMC_BUFFER_MODE#_mcBuffered; // Change InitFlag to TRUE after setting the input parameters.
  • Page 215 3 Axis Command Instructions // If home is defined for axis 2 and interrupt feeding is completed for axis 1, absolute positioning is performed for axis 2. IF (MC_Axis001.Details.Homed=TRUE) AND (Mv_Feed_D=TRUE) THEN Mv_Abs_Ex := TRUE; END_IF; // After MC_MoveAbsolute is started, MC_MoveZeroPosition is executed with multi-execution of instructions. IF Mv_Abs_Act=TRUE THEN Mv_Zero_Ex := TRUE;...
  • Page 216 3 Axis Command Instructions Velocity := Mv_Feed_Vel, Acceleration := Mv_Feed_Acc, Deceleration := Mv_Feed_Dec, MoveMode := Mv_Feed_Mm, FeedDistance := Mv_Feed_FeedDis, FeedVelocity := Mv_Feed_FeedVel, Done => Mv_Feed_D, InFeed => Mv_Feed_InFeed, Busy => Mv_Feed_Bsy, Active => Mv_Feed_Act, CommandAborted => Mv_Feed_Ca, Error => Mv_Feed_Err, ErrorID =>...
  • Page 217: Mc_Stop

    3 Axis Command Instructions MC_Stop The MC_Stop instruction decelerates an axis to a stop. Instruction Name FB/FUN Graphic expression ST expression MC_Stop Stop MC_Stop_instance ( MC_Stop_instance Axis :=parameter, MC_Stop Execute :=parameter, Axis Axis Deceleration :=parameter, Execute Done Jerk :=parameter, Deceleration Busy BufferMode :=parameter, Jerk...
  • Page 218: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the axis decelerates to a stop and the velocity • When Execute is TRUE and changes to reaches 0. FALSE.
  • Page 219 3 Axis Command Instructions Instruction Details This section describes the instruction in detail. Specifying Deceleration and Jerk Set the input variables Deceleration and Jerk to set the deceleration rate and jerk when decelerating to a stop. The relationship between the deceleration and velocity when Jerk is set to 0 and when it is set to any other value is shown below.
  • Page 220 3 Axis Command Instructions Additional Information If you set the deceleration to 0, an Immediate Stop instruction is executed. This will stop the axis immediately without decelerating. An immediate stop occurs regardless of the setting of the Acceleration/Deceleration Over Limit Selection only when the deceleration rate is set to 0. Specifying BufferMode (Buffer Mode Selection) BufferMode specifies how to join the axis motions for this instruction and the previous instruction.
  • Page 221 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • Done changes to TRUE when a velocity of 0 is reached. •...
  • Page 222 3 Axis Command Instructions Re-execution of Motion Instructions Deceleration (Deceleration Rate) changes if Execute is changed to TRUE again while this instruction is in execution. The Jerk setting is not changed when a motion control instruction is re-executed. Jerk Set to Any Value Other Than 0 The command value for the velocity is created based on the current velocity and deceleration rate, with Dt2 as the upper limit to the deceleration rate after it is changed.
  • Page 223 Servo is turned OFF) • When _mcImmediateStop is selected for the StopMode input variable to the MC_TouchProbe (Enable External Latch) instruction, the trigger condition is met, and the OMRON 1S-series Servo Drive or G5-series Servo Drive stops immediately NY-series Motion Control Instructions Reference Manual (W561)
  • Page 224 3 Axis Command Instructions Errors Operation will stop if an error (e.g., axis error) occurs during instruction execution. Specify the stopping method in the axis parameters. The stopping method can be immediate stop, deceleration stop, or Servo OFF. If you specify a deceleration stop, the axis will continue decelerating until it stops.
  • Page 225 3 Axis Command Instructions Version Information Operation when an error is reset depends on the unit version of the CPU Unit as follows: Note that you must reset errors only after the axis has stopped. Do not reset errors during axis motion.
  • Page 226: Mc_Immediatestop

    3 Axis Command Instructions MC_ImmediateStop The MC_ImmediateStop instruction stops an axis according to the stopping mode that is set with the StopMode (Stopping Mode Selection) input variable regardless of the status of the axis. Instruction Name Graphic expression ST expression MC_ImmediateStop Immediate MC_ImmediateStop_instance ( MC_ImmediateStop_instance...
  • Page 227: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the axis has decelerated to a stop. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 228 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE when Execute changes to TRUE. • Done changes to TRUE when processing of the Immediate Stop instruction is completed. MC_Move Instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_ImmediateStop Instruction Execute...
  • Page 229 3 Axis Command Instructions Multi-execution of Motion Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Execution during Execution of Other Instructions Axes Group Moving If the instruction is executed for an axis that is in an axes group motion, an error will occur for the...
  • Page 230 3 Axis Command Instructions Error The axis will stop immediately even if an error (e.g., axis error) occurs during instruction execution. For details on setting the Stop Mode in the axis parameters, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 231: Mc_Setposition

    3 Axis Command Instructions MC_SetPosition The MC_SetPosition instruction changes the command current position or the actual current position of an axis as required. Instruction Name FB/FUN Graphic expression ST expression MC_SetPosition Set Position MC_SetPosition_instance ( MC_SetPosition_instance Axis :=parameter, MC_SetPosition Execute :=parameter, Axis Axis Position :=parameter,...
  • Page 232: Function

    3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or FALSE TRUE when the instruction is completed. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. CommandAborted Command BOOL TRUE or FALSE TRUE when the instruction is aborted.
  • Page 233 3 Axis Command Instructions • When the Count Mode is set to Rotary Mode, set the target position to a value that is equal to or greater than the modulo minimum position and less than the modulo maximum position. A ring counter error will occur if the target position is outside this range.
  • Page 234 3 Axis Command Instructions Execution While Axis Is in Motion If you execute this instruction while positioning to an absolute position, the target value will change according to the change in position. As an example, the axis operation and timing chart are shown below for a situation where the actual position is changed from 200 mm to 800 mm while the axis is moved to 400 mm for an MC_Move- Absolute (Absolute Positioning) instruction.
  • Page 235 3 Axis Command Instructions Re-execution of Motion Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 236 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Additional Information If you execute this instruction while the axis is in motion, the instruction of the axis currently in motion will be restarted and the data required for positioning will be recalculated.
  • Page 237: Mc_Setoverride

    3 Axis Command Instructions MC_SetOverride The MC_SetOverride instruction changes the target velocity for an axis. Instruction Name FB/FUN Graphic expression ST expression MC_SetOverride Set Override MC_SetOverride_instance ( MC_SetOverride_instance Factors Axis :=parameter, MC_SetOverride Enable :=parameter, Axis Axis VelFactor :=parameter, Enable Enabled AccFactor :=parameter, VelFactor Busy...
  • Page 238: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Enabled When this instruction is started. • After one period when Enable is FALSE. • When Error changes to TRUE. Busy When Enable changes to TRUE.
  • Page 239 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use When Enable to this instruction changes to FALSE, Enabled and Busy from this instruction change to FALSE. The axis will accelerate or decelerate to a velocity with a 100% override factor. Additional Information Influence on Other Instructions Use this instruction to temporarily change the target velocities of other instructions.
  • Page 240 3 Axis Command Instructions Overrides for the MC_MoveVelocity (Velocity Control) Instruction An example of a time chart for using the Set Override Factors instruction for the MC_MoveVelocity (Velocity Control) instruction is given below. After InVelocity (Target Velocity Reached) changes to TRUE, it will stay TRUE even if the velocity changes.
  • Page 241 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE. If a minor fault occurs, the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). If you remove the cause of error, Error will change to FALSE.
  • Page 242: Mc_Resetfollowingerror

    3 Axis Command Instructions MC_ResetFollowingError The MC_ResetFollowingError instruction resets the following error between the command current posi- tion and the actual current position. Instruction Name Graphic expression ST expression MC_ResetFollowingError Reset MC_ResetFollowingError_ MC_ResetFollowingError_instance Following instance ( MC_ResetFollowingError Error Counter Axis :=parameter, Axis Axis Execute :=parameter,...
  • Page 243: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When resetting the following error counter is com- • When Execute is TRUE and changes to pleted. FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 244 3 Axis Command Instructions Position Command position Target position in the holding direction (position command value) Holding stop position Actual position (actual position of motor) Time Velocity Command Target velocity in the holding direction velocity (velocity command value) Time Actual velocity Command sent to set (actual velocity Following error...
  • Page 245 3 Axis Command Instructions Axis Variable Status Status.Stopping (Deceleration Stopping) in the Axis Variable status changes to TRUE. Executing this Instruction during Control Mode Changes If you execute an instruction that changes the control mode to Position Control Mode during execu- tion of the MC_TorqueControl (Torque Control) or MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control) instruction and then execute the MC_ResetFollowingError instruction before the change to Position Control Mode is actually completed, the timing for resetting the following error to...
  • Page 246 3 Axis Command Instructions Timing Charts Timing charts for when this instruction is executed during holding status for the MC_MoveAbsolute (Absolute Positioning) instruction are given below. MC_MoveAbsolute instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_ResetFollowingError instruction Execute Done Busy Active CommandAborted...
  • Page 247 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 248 3 Axis Command Instructions Errors If an error occurs during instruction execution, an immediate stop is performed and CommandAborted changes to TRUE. Also, if an error occurs when this instruction is executed, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing charts for when the MC_MoveAbsolute (Absolute Positioning) instruction is executed and an error occurs when the MC_ResetFollowing Error is executed during holding status are given below.
  • Page 249: Mc_Camin

    3 Axis Command Instructions MC_CamIn The MC_CamIn instruction starts a cam operation by using a specified cam table. Instruction Name Graphic expression ST expression MC_CamIn Start Cam MC_CamIn_instance ( MC_CamIn_instance Operation Master :=parameter, MC_CamIn Slave :=parameter, Master Master CamTable :=parameter, Slave Slave Execute :=parameter,...
  • Page 250 3 Axis Command Instructions Name Meaning Data type Valid range Default Description StartPosition Cam Table LREAL Negative number, posi- Specify the starting point of Start Posi- tive number, or 0 the cam table (0 phase) as tion an absolute position of the master axis.
  • Page 251 3 Axis Command Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer _eMC_ 0: _mcAborting Specify the behavior when 1: _mcBuffered Mode BUFFER_MODE executing more than one Selection 2: _mcBlendingLow motion instruction. 3: _mcBlendingPrevious 0: Aborting 1: Buffered 4: _mcBlendingNext 2: Blending low 5: _mcBlendingHigh...
  • Page 252 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE InSync When the slave axis starts cam operation. • When Periodic is FALSE and EndOfProfile changes to TRUE. • When Error changes to TRUE. •...
  • Page 253: Function

    3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use If you specify the same axis for the master axis and slave axis, a Master and Slave Defined as Same Axis minor fault (error code 5436 hex) will occur. Function •...
  • Page 254 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • Do not execute the MC_SetPosition instruction for the Master (Master Axis) if you use this instruction on a CPU Unit with unit version 1.09 or earlier. If the MC_SetPosition instruction is executed for the Master (Master Axis), the Slave (Slave Axis) may follow the master axis quickly.
  • Page 255 3 Axis Command Instructions Instruction Details This section describes the instruction in detail. Instruction Execution Condition You can execute this instruction while the master axis is stopped, during position control, velocity control, or synchronized control. For details on the slave axis, refer to Re-execution of Motion Instructions on page 3-190 and Multi-execution of Motion Instructions on page 3-191.
  • Page 256 3 Axis Command Instructions Additional Information • The cam data variables are not published to the network. For example, you can monitor the values of MyCam1[10].Phase or MyCam1[10].Distance from the Sysmac Studio, but you cannot access from another Controller via EtherNet/IP. •...
  • Page 257 3 Axis Command Instructions The conditions for starting cam operation are given in the following table. Input variable Condition 1 Condition 2 Periodic (Periodic Mode) TRUE: Periodic TRUE: Periodic StartMode _mcRelativePosition (relative _mcRelativePosition (relative position) position) StartPosition (Cam Table Start Position) MasterStartDistance (Master Following Distance) For condition 1, the InCam (Cam Motion) and InSync output variables both change to TRUE and the...
  • Page 258 3 Axis Command Instructions Additional Information For condition 2, the slave axis will accelerate rapidly if SlaveOffset is set to 0. Slave axis command Operation for Condition 2 position Time InCam InSync If SlaveOffset is set to -80, the slave axis starts synchronization from a displacement of Mas- terStartDistance (Master Following Distance) and rapid acceleration is prevented.
  • Page 259 3 Axis Command Instructions Master axis command position 360° 120° 40° Time 0° Slave axis command position Operation for Condition 1 Time InCam InSync Slave axis command position Operation for Condition 2 Time InCam InSync Slave axis command position Operation for Condition 3 Time InCam InSync...
  • Page 260 3 Axis Command Instructions Example 3: Differences in Starting Cam Operation of the Slave Axis for Differences in StartMode You can use StartMode to specify whether the value that is specified for MasterStartDistance (Master Following Distance) is treated as an absolute value or a relative value. This example describes the differences in starting cam operation of the slave axis for differences in StartMode.
  • Page 261 3 Axis Command Instructions Master axis command position 360° 120° 80° 40° Time 0° Slave axis command position Operation for Condition 1 Time InCam InSync Slave axis command position Operation for Condition 2 Time InCam InSync Precautions for Correct Use Precautions for Correct Use To perform a cam motion, use the Cam Editor in the Sysmac Studio to create a cam profile and then download the cam profile to the CPU Unit.
  • Page 262 3 Axis Command Instructions Periodic (Periodic Mode) If you specify TRUE (periodic) for Periodic, the cam motion will be repeated from the start to the end point of the cam table. If you specify FALSE (non-periodic), the cam operation ends when the last point in the cam table is executed.
  • Page 263 3 Axis Command Instructions Ending Cam Operation Use the MC_CamOut (End Cam Operation) instruction or MC_Stop instruction to stop cam opera- tion before it is completed. Scaling Factor You can specify a scaling factor to scale up or scale down the master axis phase and slave axis dis- placement of a specified cam table.
  • Page 264 3 Axis Command Instructions MasterOffset < 0 Displacement MasterOffset = -100 Cam table start Phase position EndOfProfile changes EndOfProfile changes to TRUE. to TRUE. SlaveOffset > 0 Displacement SlaveOffset = 50 Cam table start position Phase SlaveOffset < 0 Displacement Phase SlaveOffset = −50 Cam table start position...
  • Page 265 3 Axis Command Instructions ReferenceType (Position Type Selection) Any of the following position types can be selected for the master axis to which the slave axis is syn- chronized. • _mcCommand: Command position (value calculated in the previous task period) The master axis command position that was calculated in the previous task period is used for the current period.
  • Page 266 3 Axis Command Instructions Direction You can start cam operation for the slave axis only if the travel direction of the master axis matches the setting in Direction. Direction is valid only while InSync is TRUE. _mcNoDirection (No Direction Specified) Cam operation starts regardless of whether the master axis is traveling in the positive or negative direction.
  • Page 267 3 Axis Command Instructions An example is given below. The cam table settings are the same as in the previous example. The conditions for starting cam operation are given in the following table. Input variable Condition StartMode (Start Mode) _mcAbsolutePosition (Absolute Position) Direction (Direction) _mcPositiveDirection (Positive Direction) StartPosition (Cam Table Start Position)
  • Page 268 3 Axis Command Instructions BufferMode (Buffer Mode Selection) BufferMode specifies how to join the axis motions for this instruction and the previous instruction. There are the following six settings. Buffer Mode Selection Description Aborting Cancels the instruction being executed and switches to this instruction. When the master axis passes StartPosition (Cam Table Start Position) and then passes MasterStartDistance (Master Following Distance), the cam oper- ation of the slave axis starts and the InSync output variable changes to TRUE.
  • Page 269 3 Axis Command Instructions Master axis position StartPosition Slave axis position MC_CamIn1 Active InCam InSync EndOfProfile MC_CamIn2 Execute Busy Active InCam InSync EndOfProfile Multi-execution of Instructions with Buffer Mode in Blending Consider the case of multi-execution of instructions where MC_CamIn2 is executed with the Buffer Mode set for blending during execution of MC_CamIn1.
  • Page 270 3 Axis Command Instructions Master axis position StartPosition Slave axis position MC_CamIn1 Active InCam InSync EndOfProfile MC_CamIn2 Execute Busy Active InCam InSync EndOfProfile For details on BufferMode (Buffer Mode Selection), refer to the NJ/NX-series CPU Unit Motion Con- trol User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Con- trol User’s Manual (Cat.
  • Page 271 3 Axis Command Instructions Timing Charts Non-periodic Operation The following timing chart shows the operation when Periodic (Periodic Mode) is FALSE (non-peri- odic) for the MC_CamIn (Start Cam Operation) instruction. Master Axis Position MasterStartDistance StartPosition Slave axis position Execute InCam InSync EndOfProfile Busy...
  • Page 272 3 Axis Command Instructions Periodic Operation The cam motion is repeatedly executed. The slave axis decelerates to 0 when the cam operation is ended with the MC_CamOut (End Cam Operation) instruction. The operation of the master axis is not affected. The following timing chart shows the operation when Periodic (Periodic Mode) is TRUE (periodic) for the MC_CamIn (Start Cam Operation) instruction and then the MC_CamOut (End Cam Operation) instruction is executed.
  • Page 273 3 Axis Command Instructions MC_Stop Instruction If the MC_Stop instruction is executed for the master axis during cam operation, the sync between the master axis and slave axis is maintained. If the MC_Stop instruction is executed for the slave axis during cam operation, the sync between the master axis and slave axis ends. The following timing chart displays the operation when Periodic (Periodic Mode) is TRUE (periodic) for the MC_CamIn (Start Cam Operation) instruction and then the MC_Stop instruction is executed for the slave axis.
  • Page 274 3 Axis Command Instructions Aborting the Instruction If an axis error occurs for the slave axis during execution of this instruction, the slave axis decelerates to a stop at the maximum deceleration rate for the axis. If the MC_Stop instruction is executed for the slave axis, CommandAborted changes to TRUE and the slave axis decelerates to a stop at the deceler- ation rate that is specified in the MC_Stop instruction.
  • Page 275 3 Axis Command Instructions Re-execution Procedure For the procedure to re-execute this instruction, refer to Sample Programming 1 on page 3-192 and Sample Programming 2 on page 3-203. Multi-execution of Motion Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 276: Sample Programming 1

    3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Master axis position Slave axis position Execute...
  • Page 277 3 Axis Command Instructions Count Modes Axis Count Mode Axis 1 Rotary Mode Axis 2 Linear Mode Ring Counter Modulo maxi- Modulo mini- Axis mum position mum position Axis 1 Units of Display Axis Unit of Display Axis 1 degree Axis 2 Operation Example Operation Pattern...
  • Page 278 3 Axis Command Instructions Ladder Diagram Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis 1. MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axis 1. MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 1.
  • Page 279 3 Axis Command Instructions Timing Chart Master axis MC_Axis000.Cmd.Pos Slave axis MC_Axis001.Cmd.Pos MC_MoveVelocity Instruction Vel_InVel MC_CamIn Instruction Camin_InCam0 Camin_InSync Camin_EOP Camin_Index Camin_Bsy Camin_Act Camin_Ca MC_CamOut Instruction Camout_Ex Camout_D Camout_Bsy Sample Programming If StartPg is TRUE, EtherCAT communications for axis 1 are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress]...
  • Page 280 3 Axis Command Instructions If process data communications are active for axis 2, the Servo is turned ON. PWR2 MC_Power Pwr2_S MC_Axis001 Axis Axis Lock2 Enable Status Busy Pwr2_Bsy Error Pwr2_Err ErrorID Pwr2_ErrID If a minor fault level error occurs for the axis composition, the error handler for the device (FaultHandler) is executed. Program the FaultHandler according to the device.
  • Page 281 3 Axis Command Instructions The MC_CamIn (Start Cam Operation) instruction is executed if Vel_InVel is TRUE for the MC_MoveVelocity (Velocity Control) instruction. CAMIN MC_CamIn MC_Axis000 Master Master MC_Axis001 Slave Slave Camin_InCam0 CamProfile0 CamTable CamTable Vel_InVel Execute InCam BOOL#TRUE Periodic InSync Camin_InSync _eMC_START_MODE#_mcRelativePosition StartMode...
  • Page 282 3 Axis Command Instructions Name Data type Default Comment MC_Axis001.Details.Homed BOOL FALSE TRUE when home is defined for axis 2. Pwr1_S BOOL FALSE This variable is assigned to the Status output variable from the PWR1 instance of the MC_Power instruction. This vari- able changes to TRUE when the Servo is turned ON.
  • Page 283 3 Axis Command Instructions Timing Chart Master axis MC_Axis000.Cmd.Pos Slave axis MC_Axis001.Cmd.Pos MC_MoveVelocity Instruction Vel_InVel MC_CamIn Instruction Camin_Ex Camin_InCam0 Camin_InSync Camin_EOP Camin_Index Camin_Bsy Camin_Act Camin_Ca MC_CamOut Instruction Camout_Ex Camout_D Camout_Bsy Sample Programming // Processing when input parameters are not set IF InitFlag=FALSE THEN // MC_CamIn parameters Camin_EM...
  • Page 284 3 Axis Command Instructions // MC_CamOut parameters Camout_Dec := DecRate2; // Change InitFlag to TRUE after setting the input parameters. InitFlag := TRUE; END_IF; // If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 1 is turned ON. // If EtherCAT communications are not normal, the Servo is turned OFF.
  • Page 285 3 Axis Command Instructions Status => Pwr1_S, Busy => Pwr1_Bsy, Error => Pwr1_Err, ErrorID => Pwr1_ErrID // MC_Power for axis 2 PWR2( Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_S, Busy => Pwr2_Bsy, Error => Pwr2_Err, ErrorID => Pwr2_ErrID // MC_Home for axis 1 HM1( Axis...
  • Page 286 3 Axis Command Instructions StartMode := Camin_StMode, StartPosition := Camin_StPos, MasterStartDistance := Camin_MStDis, MasterScaling := Camin_MSc, SlaveScaling := Camin_SSc, MasterOffset := Camin_MO, SlaveOffset := Camin_SO, ReferenceType := Camin_RT, Direction := Camin_Dir, CamTransition := Camin_CT, BufferMode := Camin_BM, InCam => Camin_InCam0, InSync =>...
  • Page 287: Sample Programming 2

    3 Axis Command Instructions Sample Programming 2 This sample programming shows cam operation for a liquid filler. Additional Information You can specify only the initial values for input variables that are reserved. Parameters are not specified in this sample. Parameter Settings The minimum settings required for this sample programming are given below.
  • Page 288 3 Axis Command Instructions Operation Example Axis 2 Axis 3 Axis 4 Axis 5 Synchronized slave axis Synchronized master axis Axis 1 Operation Pattern Axis 1 Axis 2 MasterOffset = 30 Axis 3 MasterOffset = 80 Axis 4 MasterOffset = 130 Axis 5 MasterOffset = 180 Start Cam Operation...
  • Page 289 3 Axis Command Instructions Ladder Diagram Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis 1. MC_Axis001 _sAXIS_REF Axis Variable for the slave axis, axis 2. MC_Axis002 _sAXIS_REF Axis Variable for the slave axis, axis 3. MC_Axis003 _sAXIS_REF Axis Variable for the slave axis, axis 4.
  • Page 290 3 Axis Command Instructions *2 The timing is the same for the following: Camin1_InSync, Camin2_InSync, Camin3_InSync, and Camin4_In- Sync. In this sample, MasterStartDistance is 0, so InSync changes to TRUE from when the master axis is 0°. *3 The timing is the same for the following: Camin1_Bsy, Camin2_Bsy, Camin3_Bsy, and Camin4_Bsy. *4 The timing is the same for the following: Camin1_Act, Camin2_Act, Camin3_Act, and Camin4_Act.
  • Page 291 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 StartPg _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] Lock3 StartPg _EC_PDSlavTbl[MC_Axis002.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis002.Cfg.NodeAddress] Lock4 StartPg _EC_PDSlavTbl[MC_Axis003.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis003.Cfg.NodeAddress] Lock5 StartPg...
  • Page 292 3 Axis Command Instructions PWR5 MC_Power Pwr5_Status MC_Axis004 Axis Axis Lock5 Enable Status Busy Pwr5_Bsy Error Pwr5_Err ErrorID Pwr5_ErrID If a minor fault level error occurs for the axis composition, the error handler for the device (FaultHandler) is executed. Program the FaultHandler according to the device. MC_Axis000.MFaultLvl.Active FaultHandler FaultHandler...
  • Page 293 3 Axis Command Instructions MC_Home Hm4_D MC_Axis003 Axis Axis Pwr4_Status MC_Axis003.Details.Homed Execute Done Busy Hm4_Bsy CommandAborted Hm4_Ca Error Hm4_Err ErrorID Hm4_ErrID MC_Home Hm5_D MC_Axis004 Axis Axis Pwr5_Status MC_Axis004.Details.Homed Execute Done Busy Hm5_Bsy CommandAborted Hm5_Ca Error Hm5_Err ErrorID Hm5_ErrID The MC_MoveVelocity (Velocity Control) instruction is executed after homing is completed for axis 1. MC_MoveVelocity Vel_InVel MC_Axis000...
  • Page 294 3 Axis Command Instructions The MC_CamIn (Start Cam Operation) instruction is executed for axis 3 (slave axis) if Vel_InVel is TRUE for the MC_MoveVelocity (Velocity Control) instruction and homing is completed for axis 3. CAMIN2 MC_CamIn MC_Axis000 Master Master MC_Axis002 Slave Slave Camin2_InCam...
  • Page 295 3 Axis Command Instructions The MC_CamIn (Start Cam Operation) instruction is executed for axis 5 (slave axis) if Vel_InVel is TRUE for the MC_MoveVelocity (Velocity Control) instruction and homing is completed for axis 5. CAMIN4 MC_CamIn MC_Axis000 Master Master MC_Axis004 Slave Slave Camin4_InCam...
  • Page 296 3 Axis Command Instructions Timing Chart Master axis MC_Axis000.Cmd.Pos Slave axis 1 MC_Axis001.Cmd.Pos Slave axis 2 MC_Axis002.Cmd.Pos Slave axis 3 MC_Axis003.Cmd.Pos Slave axis 4 MC_Axis004.Cmd.Pos MC_MoveVelocity Instruction Vel_InVel MC_CamIn Instruction InCam InSync Busy Active Camin1_Eop Camin2_Eop Camin3_Eop Camin4_Eop *1 The timing is the same for the following: Camin1_InCam, Camin2_InCam, Camin3_InCam, and Camin4_In- Cam.
  • Page 297 3 Axis Command Instructions Camin1_Mo := LREAL#30.0; Camin1_So := LREAL#0.0; Camin1_Rt := _eMC_REFERENCE_TYPE#_mcCommand; Camin1_Dir := _eMC_DIRECTION#_mcNoDirection; Camin2_Em := TRUE; Camin2_Sm := _eMC_START_MODE#_mcAbsolutePosition; Camin2_Sp := LREAL#0.0; Camin2_Msd := LREAL#0.0; Camin2_Ms := LREAL#1.0; Camin2_Ss := LREAL#1.0; Camin2_Mo := LREAL#80.0; Camin2_So := LREAL#0.0; Camin2_Rt := _eMC_REFERENCE_TYPE#_mcCommand;...
  • Page 298 3 Axis Command Instructions IF (StartPg=TRUE) AND (_EC_PDSlavTbl[MC_Axis002.Cfg.NodeAddress]=TRUE) AND (_EC_CommErrTbl[MC_Axis002.Cfg.NodeAddress]=FALSE) THEN Pwr3_En:=TRUE; ELSE Pwr3_En:=FALSE; END_IF; // If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 4 is turned ON. // If EtherCAT communications are not normal, the Servo is turned OFF. IF (StartPg=TRUE) AND (_EC_PDSlavTbl[MC_Axis003.Cfg.NodeAddress]=TRUE) AND (_EC_CommErrTbl[MC_Axis003.Cfg.NodeAddress]=FALSE) THEN...
  • Page 299 3 Axis Command Instructions // After homing is completed for axis 1, MC_MoveVelocity is executed. IF Hm1_D=TRUE THEN Vel_Ex:=TRUE; END_IF; // If home is defined for axis 2 and Vel_InVel of MC_MoveVelocity is TRUE, // the MC_CamIn instruction for axis 2 (slave axis) is executed. IF (Vel_InVel=TRUE) AND (MC_Axis001.Details.Homed=TRUE) THEN Camin1_Ex := TRUE;...
  • Page 300 3 Axis Command Instructions Error => Pwr4_Err, ErrorID => Pwr4_ErrID // MC_Power for axis 5 PWR5( Axis := MC_Axis004, Enable := Pwr5_En, Status => Pwr5_Status, Busy => Pwr5_Bsy, Error => Pwr5_Err, ErrorID => Pwr5_ErrID // MC_Home for axis 1 HM1( Axis := MC_Axis000, Execute...
  • Page 301 3 Axis Command Instructions Error => Hm5_Err, ErrorID => Hm5_ErrID //MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, Direction := Vel_Dir, InVelocity => Vel_InVel, Busy => Vel_Bsy, Active => Vel_Act, CommandAborted =>...
  • Page 302 3 Axis Command Instructions EndOfProfile => Camin2_Eop, Index => Camin2_Index, Busy => Camin2_Bsy, Active => Camin2_Act, CommandAborted => Camin2_Ca, Error => Camin2_Err, ErrorID => Camin2_ErrID CAMIN3( Master := MC_Axis000, Slave := MC_Axis003, CamTable := CamProfile0, Execute := Camin3_Ex, Periodic := Camin3_Em, StartMode := Camin3_Sm, StartPosition...
  • Page 303: Mc_Camout

    3 Axis Command Instructions MC_CamOut Cam operation is ended for the axis specified with the input parameter. Instruction Name FB/FUN Graphic expression ST expression MC_CamOut End Cam Operation FB MC_CamOut_instance ( MC_CamOut_instance Slave :=parameter, MC_CamOut Execute :=parameter, Slave Slave Deceleration :=parameter, Execute Done Jerk :=parameter,...
  • Page 304: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the velocity reaches 0. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 305 3 Axis Command Instructions Timing Charts Master axis position MasterStartDistance StartPosition Synchronized control Slave axis position Synchronized control Deceleration stopping Deceleration stopping MC_CamIn Execute InCam InSync EndOfProfile Busy Active MC_CamOut Execute Done Busy NY-series Motion Control Instructions Reference Manual (W561) 3-221...
  • Page 306 3 Axis Command Instructions Aborting the Instruction If an axis error occurs for the slave axis during execution of this instruction, CommandAborted changes to TRUE and Busy (Executing) changes to FALSE. The axis will decelerate at the rate specified with Deceleration (Deceleration Rate) for this instruction.
  • Page 307 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Master axis position MasterStartDistance StartPosition...
  • Page 308: Mc_Gearin

    3 Axis Command Instructions MC_GearIn Specifies the gear ratio between the master axis and the slave axis and starts gear operation. Instruction Name FB/FUN Graphic expression ST expression MC_GearIn Start Gear MC_GearIn_instance ( MC_GearIn_instance Operation Master :=parameter, MC_GearIn Slave :=parameter, Master Master Execute :=parameter,...
  • Page 309 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Deceleration Deceleration LREAL Non-negative number Specify the deceleration rate. The Rate unit is command units/s Jerk Jerk LREAL (Reserved) (Reserved) BufferMode Buffer Mode _eMC_ 0: _mcAborting Specify the behavior when execut- Selection BUFFER_ ing more than one motion instruc-...
  • Page 310: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE Active When the instruction is started. • When Error changes to TRUE. • When CommandAborted changes to TRUE. CommandAborted • When this instruction is aborted because another •...
  • Page 311 3 Axis Command Instructions • After operation starts, the slave axis uses the velocity of the master axis multiplied by the gear ratio for its target velocity, and accelerates/decelerates accordingly. • The catching phase exists until the target velocity is reached. The InGear phase exists after that. •...
  • Page 312 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use Do not execute the MC_SetPosition instruction for the Master (Master Axis) if you use this instruction on a CPU Unit with unit version 1.09 or earlier. If the MC_SetPosition instruction is executed for the Master (Master Axis), the Slave (Slave Axis) may follow the master axis quickly.
  • Page 313 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • InGear (Gear Ratio Reached) changes to TRUE when the target velocity is reached. •...
  • Page 314 3 Axis Command Instructions Re-execution of Motion Instructions You can change the operation of the instruction if you change an input variable during positioning and change Execute to TRUE again. Input variables RatioNumerator (Gear Ratio Numerator), RatioDenom- inator (Gear Ratio Denominator), Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate) can be changed by re-executing the motion control instruction.
  • Page 315 3 Axis Command Instructions The following timing chart shows when the instruction is re-executed during the InGear phase to change the RatioNumerator (Gear Ratio Numerator) and RatioDenominator (Gear Ratio Denominator). The motion is the same as when Acceleration (Acceleration Rate) and Deceleration (Deceleration Rate) are both set to 0.
  • Page 316 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Execute InGear Busy...
  • Page 317: Sample Programming

    3 Axis Command Instructions Sample Programming This section shows sample programming for operation proportional to a gear ratio. Additional Information You can specify only the initial values for input variables that are reserved. Parameters are not specified in this sample. Parameter Settings The minimum settings required for this sample programming are given below.
  • Page 318 3 Axis Command Instructions Operation Example Axis 1 1 : 2 2 : 3 Axis 2 Axis 3 Starting the Master Axis The master axis (axis 1) is an actual servo axis and it is operated with velocity control. Executing the Slave Axes When the actual velocity for the master axis reaches the target velocity, gear operation is per- formed so that the gear ratio of axis 2 (slave axis) is 1:2 and axis 3 (slave axis) is 2:3 against the actual position of the master axis.
  • Page 319 3 Axis Command Instructions Timing Chart Pwr1_Status Pwr2_Status Pwr3_Status Vel_InVel Vel_Bsy Vel_Act Gearin1_InGear Gearin1_Bsy Gearin1_Act Gearin1_Ca Gearin2_InGear Gearin2_Bsy Gearin2_Act Gearout_Bsy Gearout_D Axis 1 Command position 1000 Actual position Command velocity Axis 2 Command velocity Axis 3 Command velocity NY-series Motion Control Instructions Reference Manual (W561) 3-235...
  • Page 320 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] Lock3 _EC_PDSlavTbl[MC_Axis002.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis002.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON for the axes. PWR1 MC_Power Pwr1_Status...
  • Page 321 3 Axis Command Instructions When the actual velocity for the master axis (axis 1) reaches the target velocity, gear operation is performed so that the gear ratio of axis 2 (slave axis) is 1:2 and axis 3 (slave axis) is 2:3. GEARIN1 MC_GearIn MC_Axis000...
  • Page 322 3 Axis Command Instructions Structured Text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis 1. MC_Axis000.Act.Pos LREAL This variable gives the actual current position of axis 1. MC_Axis001 _sAXIS_REF Axis Variable for the slave axis, axis 2. MC_Axis002 _sAXIS_REF Axis Variable for the slave axis, axis 3.
  • Page 323 3 Axis Command Instructions Timing Chart Pwr1_Status Pwr2_Status Pwr3_Status Vel_Ex Vel_InVel Vel_Bsy Vel_Act Gearin1_Ex Gearin1_InGear Gearin1_Bsy Gearin1_Act Gearin1_Ca Gearin2_Ex Gearin2_InGear Gearin2_Bsy Gearin2_Act Gearout_Ex Gearout_Bsy Gearout_D Axis 1 Command position 1000 Actual position Command velocity Axis 2 Command velocity Axis 3 Command velocity NY-series Motion Control Instructions Reference Manual (W561) 3-239...
  • Page 324 3 Axis Command Instructions Sample Programming // Processing when input parameters are not set IF InitFlag = FALSE THEN // MC_MoveVelocity parameters Vel_Vel := LREAL#2000.0; Vel_Acc := LREAL#2000.0; Vel_Dec := LREAL#2000.0; Vel_Dir := _eMC_DIRECTION#_mcPositiveDirection; // MC_GearIn1 parameters Gearin1_Rn := UINT#1; Gearin1_Rd := UINT#2;...
  • Page 325 3 Axis Command Instructions // If a minor fault level error occurs for axis 1 to axis 3, the error handler for the device (FaultHandler) is executed. // Program the FaultHandler according to the device. IF (MC_Axis000.MFaultLvl.Active=TRUE) OR (MC_Axis001.MFaultLvl.Active=TRUE) OR (MC_Axis002.MFaultLvl.Active=TRUE) THEN FaultHandler();...
  • Page 326 3 Axis Command Instructions //MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, Direction := Vel_Dir, InVelocity => Vel_InVel, Busy => Vel_Bsy, Active => Vel_Act, CommandAborted => Vel_Ca, Error => Vel_Err, ErrorID =>...
  • Page 327: Mc_Gearinpos

    3 Axis Command Instructions MC_GearInPos The MC_GearInPos instruction performs electronic gear operation for the specified gear ratio between the master axis and the slave axis. The positions at which to start synchronizing the master axis and slave axis are specified. Instruction Name Graphic expression...
  • Page 328 3 Axis Command Instructions Name Meaning Data type Valid range Default Description MasterSync Master Sync LREAL Negative number, posi- Specify the absolute master sync Position Position tive number, or 0 position. The unit is command units. SlaveSync Slave Sync LREAL Negative number, posi- Specify the absolute slave sync posi- Position...
  • Page 329 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE StartSync When the axis starts moving. • When Error changes to TRUE. • When CommandAborted changes to TRUE. InSync When the slave axis reaches SlaveSyncPosition. •...
  • Page 330: Function

    3 Axis Command Instructions Function • The MC_GearInPos instruction performs gear operation for the slave axis specified with Slave. The following parameters are also specified: RatioNumerator (Gear Ratio Numerator), RatioDenominator (Gear Ratio Denominator), ReferenceType (Position Type), Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate).
  • Page 331 3 Axis Command Instructions • If the gear ratio is positive, the slave axis and master axis move in the same direction. Catching phase InGear phase MasterSyncPosition SlaveSyncPosition Time Instruction executed. StartSync InSync Busy Active • If the gear ratio is negative, the slave axis and master axis move in the opposite directions. Catching phase InGear phase MasterSyncPosition...
  • Page 332 3 Axis Command Instructions Master axis velocity Time Catching InGear phase phase Slave axis velocity Velocity ) × Gear ratio Time For the Slave (Slave Axis) to catch up with the Master (Master Axis) for the MasterSyncPosition (Master Sync Position) and SlaveSyncPosition (Slave Sync Position), the following condition must be met for the Velocity (Target Velocity) Master axis velocity when MC_GearInPos is executed ×...
  • Page 333 3 Axis Command Instructions ReferenceType (Position Type Selection) You can select one of the following position types. • _mcCommand: Command position (value calculated in the previous task period) The master axis command position that was calculated in the previous task period is used for the current period.
  • Page 334 3 Axis Command Instructions Timing Charts • Electronic gear operation starts when Execute changes to TRUE. • Busy (Executing) changes to TRUE when Execute changes to TRUE. After the operation is started, Active (Controlling) and StartSync (Following) change to TRUE and the Slave (Slave Axis) starts the gear operation.
  • Page 335 3 Axis Command Instructions Execute StartSync InSync Busy Active CommandAborted Error ErrorID 16#0000 InSyncPhase Multi-execution of Velocity another instruction CatchingPhase Time Depending on setting of the SlaveSyncPosition, the axis may not reach the target velocity. An exam- ple of this is shown below. Execute StartSync InSync...
  • Page 336 3 Axis Command Instructions The slave axis follows the master axis position before the InSync phase as well. An example of this is shown below. Execute StartSync InSync Busy Active CommandAborted Error ErrorID 16#0000 Velocity Master axis InSyncPhase Slave axis CatchingPhase Time You can specify the Acceleration (Acceleration Rate) and Deceleration (Deceleration Rate) as input...
  • Page 337 3 Axis Command Instructions Multi-execution of Motion Instructions The axis command status of the master axis, including whether it is stopped due to an error or it is decelerating to a stop, does not affect the execution of this instruction. For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 338: Sample Programming

    3 Axis Command Instructions Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. Sample Programming This section describes sample programming where the sync position for the master axis is Pos1 and the sync position for the slave axis Pos2. Parameter Settings The minimum settings required for this sample programming are given below.
  • Page 339 3 Axis Command Instructions Operation Pattern Axis 1 position Pos1 Time Vel_InVel Axis 2 position Pos2 Time Starting the Master Axis The master axis (axis 1) is an actual servo axis and it is operated with velocity control. Reaching Target Velocity for Master Axis When the command velocity of the master axis reaches the target velocity, InVelocity (Target Velocity Reached) of the master axis changes to TRUE.
  • Page 340 3 Axis Command Instructions Name Data type Default Comment Hm1_D BOOL FALSE This variable is assigned to the Done output vari- able from the HM1 instance of the MC_Home instruction. Hm2_D BOOL FALSE This variable is assigned to the Done output vari- able from the HM2 instance of the MC_Home instruction.
  • Page 341 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON for the axes. PWR1 MC_Power Pwr1_Status...
  • Page 342 3 Axis Command Instructions The MC_MoveVelocity (Velocity Control) instruction is executed after homing is completed for the master axis (axis 1). MC_MoveVelocity Vel_InVel MC_Axis000 Axis Axis Hm1_D Execute InVelocity LREAL#90.0 Velocity Busy Vel_Bsy LREAL#90.0 Acceleration Active Vel_Act LREAL#90.0 Deceleration CommandAborted Vel_Ca LREAL#0.0 Jerk...
  • Page 343 3 Axis Command Instructions Name Data type Default Comment Vel_InVel BOOL FALSE This variable is assigned to the InVelocity output variable from the VEL instance of the MC_MoveVelocity instruction. It is TRUE when the target velocity is reached. Pos1 LREAL This variable gives the master sync position.
  • Page 344 3 Axis Command Instructions Timing Chart Pwr1_Status Pwr2_Status Hm1_Ex Hm1_D Hm1_Bsy Hm2_Ex Hm2_D Hm2_Bsy Vel_Ex Vel_InVel Vel_Bsy Vel_Act Gearinpos_Ex Gearinpos_StSync Gearinpos_InSync Gearinpos_Bsy Gearinpos_Act Axis 1 Command position Actual position Command velocity Actual velocity Axis 2 Command position Command velocity Sample Programming // Processing when input parameters are not set IF InitFlag = FALSE THEN // MC_MoveVelocity parameters...
  • Page 345 3 Axis Command Instructions Gearinpos_Rd := UINT#2; Gearinpos_Rt := _eMC_REFERENCE_TYPE#_mcFeedback; Gearinpos_Mtpos := Pos1; Gearinpos_Svpos := Pos2; Gearinpos_Vel := LREAL#180.0; Gearinpos_Acc := LREAL#180.0; Gearinpos_Dec := LREAL#180.0; // Change InitFlag to TRUE after setting the input parameters. InitFlag:=TRUE; END_IF; // If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 1 is turned ON. // If EtherCAT communications are not normal, the Servo is turned OFF.
  • Page 346 3 Axis Command Instructions Axis := MC_Axis000, Enable := Pwr1_En, Status => Pwr1_Status, Busy => Pwr1_Bsy, Error => Pwr1_Err, ErrorID => Pwr1_ErrID // MC_Power for axis 2 PWR2( Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_Status, Busy => Pwr2_Bsy, Error =>...
  • Page 347 3 Axis Command Instructions Acceleration := Gearinpos_Acc, Deceleration := Gearinpos_Dec, StartSync => Gearinpos_StSync, InSync => Gearinpos_InSync, Busy => Gearinpos_Bsy, Active => Gearinpos_Act, CommandAborted => Gearinpos_Ca, Error => Gearinpos_Err, ErrorID => Gearinpos_ErrID NY-series Motion Control Instructions Reference Manual (W561) 3-263...
  • Page 348: Mc_Gearout

    3 Axis Command Instructions MC_GearOut The MC_GearOut instruction stops operation for the MC_GearIn (Start Gear Operation) instruction or MC_GearInPos (Positioning Gear Operation) instruction. Instruction Name FB/FUN Graphic expression ST expression MC_GearOut End Gear MC_GearOut_instance ( MC_GearOut_instance Operation Slave :=parameter, MC_GearOut Execute :=parameter, Slave Slave...
  • Page 349 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 350: Function

    3 Axis Command Instructions Function • The MC_GearOut instruction stops the operation of the MC_GearIn (Start Gear Operation) or MC_GearInPos (Positioning Gear Operation) instruction for the operation axis specified with Slave and at the specified Deceleration (Deceleration Rate). • This instruction does not affect the MC_GearIn (Start Gear Operation) or MC_GearInPos (Positioning Gear Operation) operation of the master axis.
  • Page 351 3 Axis Command Instructions When The Instruction Is Executed with a Deceleration Rate of 0 If deceleration rate is set to 0 and the instruction is executed, the axis will stop without decelerating. The following chart shows an operation example of when the deceleration rate is 0. Velocity MC_GearOut executed.
  • Page 352 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Execute Done Busy...
  • Page 353: Mc_Movelink

    3 Axis Command Instructions MC_MoveLink Positioning is performed in sync with the specified master axis. Instruction Name Graphic expression ST expression MC_MoveLink Synchro- MC_MoveLink_instance ( MC_MoveLink_instance nous Posi- Master :=parameter, MC_MoveLink tioning Slave :=parameter, Master Master TriggerInput :=parameter, Slave Slave TriggerVariable :=parameter, TriggerInput TriggerInput...
  • Page 354 3 Axis Command Instructions Name Meaning Data type Valid range Default Description MasterDistance Master Axis LREAL Non-negative number Specify the travel distance Travel Dis- of the master axis as an tance unsigned absolute value. The value is valid for both positive and negative travel of the master axis.
  • Page 355 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or FALSE TRUE when the instruction is completed. InSync In Sync BOOL TRUE or FALSE TRUE when synchronization is started. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged.
  • Page 356: Function

    3 Axis Command Instructions In-Out Variables Name Meaning Data type Valid range Description Master Master Axis _sAXIS_REF Specify the master axis. Slave Slave Axis _sAXIS_REF Specify the slave axis. TriggerInput Trigger Input _sTRIGGER_REF Set the trigger condition. Condition TriggerVariable Trigger Vari- BOOL TRUE or Specify the input variable to function as the trigger...
  • Page 357 3 Axis Command Instructions • Touch probe function (60B8 hex) • Touch probe status (60B9 hex) • Touch probe pos1 pos value (60BA hex) • Touch probe pos2 pos value (60BC hex) If even one of the required objects is not set, a Process Data Object Setting Missing error (error code 3461 hex) occurs.
  • Page 358 3 Axis Command Instructions Additional Information The command position that is calculated in the same task period enables greater precision in synchronization than the command position that was calculated in the previous task period. However, the axis number set for the Master (Master Axis) in the system-defined variable for motion control must be lower than the axis number set for the Slave (Slave Axis) in the system- defined variable for motion control.
  • Page 359 3 Axis Command Instructions Master Axis Travel in Negative Direction Master axis position Master MasterDistanceInACC following distance MasterDistance MasterDistanceInDEC Time Slave axis position SlaveDistance Time Slave axis velocity Time The relationship between the travel distance of the master axis and the travel distance of the slave axis is shown in the following table.
  • Page 360 3 Axis Command Instructions LinkOption (Synchronization Start Condition) Specify the condition for the slave axis to synchronize with the master axis. • Start of Instruction When this instruction is executed, the slave axis performs positioning in synchronization with the master axis from the next period. •...
  • Page 361 3 Axis Command Instructions BufferMode (Buffer Mode Selection) BufferMode specifies how to join the axis motions for this instruction and the previous instruction. There is currently only the following two settings. Buffer Mode Selection Description Aborting Aborts the instruction being executed and switches to this instruction. Buffered Automatically executes the buffered instruction after the current instruction is completed.
  • Page 362 3 Axis Command Instructions LinkOption Set to _mcTriggerDetection Execute TriggerInput Done InSync Busy Active Master/slave axis position Master axis Slave axis Time Slave axis velocity Time 3-278 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 363 3 Axis Command Instructions Sync Start Condition Setting = When the Master Axis Reaches the Master Following Distance Execute Done InSync Busy Active Master/slave axis position Master axis Master following distance Slave axis Time Slave axis velocity Time NY-series Motion Control Instructions Reference Manual (W561) 3-279...
  • Page 364 3 Axis Command Instructions When an Instruction Is Executed with BufferMode Set to Aborting during Previous Operation This section describes when this instruction is executed with LinkOption set to _mcCommandExecu- tion when the previous operation, MC_MoveAbsolute (Absolute Positioning), is in execution. Precautions for Correct Use Precautions for Correct Use As shown in the following chart, the velocity of the slave axis becomes discontinuous when this...
  • Page 365 3 Axis Command Instructions Re-execution of Motion Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted, and the axis stops. Execute Done InSync Busy Active CommandAborted Error ErrorID Error code 16#0000...
  • Page 366: Sample Programming

    3 Axis Command Instructions Sample Programming This sample programming shows the control of a cutter. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Types Axis Axis Type Axis 1 Servo axis (master axis) Axis 2 Servo axis (slave axis) Count Modes...
  • Page 367 3 Axis Command Instructions Operation Patterns Axis 1 position M_DEC M_Dist M_ACC M_StartPos Time Axis 2 position Synchronization S_Dist started. Time Starting the Master Axis Axis 1 for the belt conveyer is treated as master axis to feed back the position. Executing the Slave Axis Axis 2 for the ball screw that moves in the horizontal direction moves in synchronization with axis 1.
  • Page 368 3 Axis Command Instructions Name Data type Default Comment Pwr2_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR2 instance of the MC_Power instruction. This variable changes to TRUE when the Servo is turned ON. StartPg BOOL FALSE...
  • Page 369 3 Axis Command Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON for the axes. PWR1 MC_Power Pwr1_Status...
  • Page 370 3 Axis Command Instructions The parameters are set for the MC_MoveVelocity (Velocity Control) and MC_MoveLink (Synchronous Positioning) instructions. InitFlag Note: The contents of the inline ST are given below. The MC_MoveVelocity (Velocity Control) instruction is executed if home is defined for axis 1. MC_MoveVelocity Vel_InVel MC_Axis000...
  • Page 371 3 Axis Command Instructions Mv_Link_LnkOpt := _eMC_LINKOPTION#_mcTriggerDetection; // Change InitFlag to TRUE after setting the input parameters. InitFlag := TRUE; Structured Text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis 1. MC_Axis000.MFaultLvl.Active BOOL FALSE...
  • Page 372 3 Axis Command Instructions Timing Chart MC_Axis001.DrvStatus.Latch1 Mv_Link_Ex Mv_Link_D Mv_Link_InSync Mv_Link_Bsy Master axis Velocity MC_Axis000.Cmd.Vel Time Slave axis Velocity MC_Axis001.Cmd.Vel Time 3-288 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 373 3 Axis Command Instructions Sample Programming // Processing when input parameters are not set IF InitFlag=FALSE THEN // MC_MoveVelocity parameters Vel_Vel := LREAL#1000.0; Vel_Acc := LREAL#0.0; Vel_Dec := LREAL#0.0; // MC_MoveLink parameters Mv_Link_TrigRef.Mode := _eMC_TRIGGER_MODE#_mcDrive; Mv_Link_TrigRef.LatchID := _eMC_TRIGGER_LATCH_ID#_mcLatch1; Mv_Link_TrigRef.InputDrive := _eMC_TRIGGER_INPUT_DRIVE#_mcEXT; Mv_Link_TrigVar := FALSE;...
  • Page 374 3 Axis Command Instructions END_IF; // MC_MoveLink is executed for axis 2 if home is defined for axis 2 and the target velocity was reached for axis IF (MC_Axis001.Details.Homed=TRUE) AND (Vel_InVel=TRUE) THEN Mv_Link_Ex:=TRUE; END_IF; // The actuator is turned ON if axis 1 and axis 2 are synchronized. IF Mv_Link_InSync=TRUE THEN Actuator:=TRUE;...
  • Page 375 3 Axis Command Instructions InVelocity => Vel_InVel, Busy => Vel_Bsy, Active => Vel_Act, CommandAborted => Vel_Ca, Error => Vel_Err, ErrorID => Vel_ErrID // MC_MoveLink MV_LINK( Master := MC_Axis000, Slave := MC_Axis001, TriggerInput := Mv_Link_TrigRef, TriggerVariable := Mv_Link_TrigVar, Execute := Mv_Link_Ex, SlaveDistance := Mv_Link_SlvDis, MasterDistance...
  • Page 376: Mc_Combineaxes

    3 Axis Command Instructions MC_CombineAxes The MC_CombineAxes instruction outputs the sum or difference of the command positions of two axes as the command position. Instruction Name Graphic expression ST expression MC_CombineAxes Combine MC_CombineAxes_instance ( MC_CombineAxes_instance Axes Master :=parameter, MC_CombineAxes Auxiliary :=parameter, Master Master Slave :=parameter,...
  • Page 377 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Ratio Auxiliary Axis Positive or negative num- 10000 Reserved DINT Numerator Gear Ratio Auxiliary Numerator (Reserved) Ratio Auxiliary Axis Positive number 10000 Reserved UDINT Denominator Gear Ratio Auxiliary Denominator (Reserved) Reference...
  • Page 378 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE InCombination When combining axes is started. • When Error changes to TRUE. • When CommandAborted changes to TRUE. Busy When Execute changes to TRUE. •...
  • Page 379: Function

    3 Axis Command Instructions Function • The MC_CombineAxes instruction starts combining axes when Execute changes to TRUE. Precautions for Correct Use Precautions for Correct Use Do not execute the MC_SetPosition instruction for the Master (Master Axis) if you use this instruction on a CPU Unit with unit version 1.09 or earlier.
  • Page 380 3 Axis Command Instructions CombineMode Set to _mcSubAxes Slave (Slave Axis) position = Master (Master Axis) position (relative position) − Auxiliary (Auxiliary Axis) position (relative position) Master Execute of Velocity MC_CombineAxes changes to TRUE Slave Execute of Time MC_CombineAxes Velocity changes to TRUE Position: 600 Position: 200...
  • Page 381 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use Here, the task period is the primary period if the task is the primary periodic task and the task period of the priority-5 periodic task if the task is the priority-5 periodic task. In the same way, the periodic task is the primary periodic task or the priority-5 periodic task.
  • Page 382 3 Axis Command Instructions CombineMode Set to _mcAddAxes Execute InCombination Busy Active Command Aborted Error ErrorID 16#0000 Master axis position Auxiliary axis position Time Slave axis position Time Time 3-298 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 383 3 Axis Command Instructions CombineMode Set to _mcSubAxes Execute InCombination Busy Active Command Aborted Error ErrorID 16#0000 Master axis position Auxiliary axis position Time Time Slave axis position Time NY-series Motion Control Instructions Reference Manual (W561) 3-299...
  • Page 384 3 Axis Command Instructions When the Instruction Is Aborted Execute InCombination Busy Active Command Aborted Error ErrorID 16#0000 Master axis position Time Auxiliary axis position Time Multi-execution of Slave axis position Operation for multi- another instruction execution of instructions Time Re-execution of Motion Instructions This instruction cannot be re-executed.
  • Page 385 3 Axis Command Instructions Errors Timing Chart When Error Occurs If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. The axis decelerates to a stop at the maximum deceleration rate that is set in the axis parameters. You can find out the cause of the error by referring to the value output by ErrorID (Error Code).
  • Page 386 3 Axis Command Instructions If a minor fault level error occurs during instruction execution, CommandAborted will change to TRUE and the axis will stop. The axis decelerates to a stop at the maximum deceleration rate that is set in the axis parameters. You can find out the cause of the error by referring to the value output to the MFalutLvl.Code Axis Variable for the Slave (Slave Axis).
  • Page 387 3 Axis Command Instructions If you clear the error for this instruction, the instruction will not start until Execute changes to TRUE again. Execute InCombination Busy Active Command Aborted Error reset. Error ErrorID 16#0000 Error code Master axis position Auxiliary axis position Time Slave axis position Time...
  • Page 388: Mc_Phasing

    3 Axis Command Instructions MC_Phasing The MC_Phasing instruction shifts the phase of the master axis currently in synchronized control. Instruction Name FB/FUN Graphic expression ST expression MC_Phasing Shift Master Axis MC_Phasing_instance ( MC_Phasing_instance Phase Master :=parameter, MC_Phasing Slave :=parameter, Master Master Execute :=parameter, Slave...
  • Page 389 3 Axis Command Instructions *2 Always set the target velocity. A Target Velocity Setting Out of Range error (error code: 5422 hex) occurs when the instruction is executed if the target velocity is not set. *3 The default value for an enumeration variable is actually not the number, but the enumerator. Output Variables Name Meaning...
  • Page 390: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When phase shift is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 391 3 Axis Command Instructions • Shifting is ended when execution of the synchronized control instruction is completed. If a synchro- nized control instruction is executed again, the previous amount of shift is not affected. • You can shift the phase of the master axis for the following synchronized control instructions: MC_- CamIn (Start Cam Operation), MC_GearIn (Start Gear Operation), MC_GearInPos (Positioning Gear Operation), and MC_MoveLink (Synchronous Positioning).
  • Page 392 3 Axis Command Instructions Instruction Details This section describes the instruction in detail. Specifying Master (Master Axis) and Slave (Slave Axis) Specify axes variable names to specify the axes for Master (Master Axis) and Slave (Slave Axis). An axis specification error will occur if you specify a Master (Master Axis) or Slave (Slave Axis) for which execution of a synchronized control instruction is not in progress.
  • Page 393 3 Axis Command Instructions Example: Master Axis Phase Shift for an Electronic Cam The interpolation velocity as viewed from the Slave (Slave Axis) is the velocity relative to the Master (Master Axis) velocity. Execute Done Busy Active Command Aborted Error ErrorID 16#0000 Master axis position as...
  • Page 394 3 Axis Command Instructions Reversing operation for multi-execution of instructions is performed according to the Operation Selection at Reversing setting for the master axis. For details on BufferMode (Buffer Mode Selection), refer to the NJ/NX-series CPU Unit Motion Con- trol User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Con- trol User’s Manual (Cat.
  • Page 395 3 Axis Command Instructions Error If an error occurs during instruction execution, Error will change to TRUE and the slave axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). CommandAborted of the MC_Phasing (Shift Master Axis Phase) instruction changes to TRUE when the Slave (Slave Axis) is released from synchronization due to an error.
  • Page 396: Mc_Torquecontrol

    3 Axis Command Instructions MC_TorqueControl The MC_TorqueControl instruction uses the Torque Control Mode of the Servo Drive to control the torque. Precautions for Correct Use Precautions for Correct Use You cannot use this instruction for an NX-series Pulse Output Unit. Instruction Name Graphic expression...
  • Page 397 3 Axis Command Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer Mode _eM- 0: _mcAborting Specify the behavior when execut- Selection C_BUFFER_ ing more than one motion instruc- 1: _mcBuffered MODE tion. 0: Aborting 1: Buffered *1 If a value that is higher than 1,000.0% is specified, it will be treated as 1,000.0%. If a negative value is specified, it will be treated as 0.0%.
  • Page 398: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE Error When there is an error in the execution conditions or When the error is cleared. input parameters for the instruction. In-Out Variables Name Meaning Data type Valid range Description...
  • Page 399 Also, the axis does not stop even if the limit input signal turns ON. • Process data 607F hex is used for the velocity limit value. When you use an OMRON 1S- series Servo Drive or G5-series Servo Drive, set the advanced settings in the Axis Parameter Settings of the Sysmac Studio to use the Velocity Limit Value (607F hex).
  • Page 400 Processing to change to CSP Mode is performed by the MC Function Module when the Status out- put variable from the MC_Power (Power Servo) instruction changes to FALSE. However, for an OMRON G5-series Servo Drive, commands to change the Control Mode are not acknowledged from the MC Function Module when the Servo is OFF.
  • Page 401 3 Axis Command Instructions The operation for reversing for multi-execution of instructions is as follows: • If the command position reverses for multi-execution of an instruction that uses CSP during execu- tion of this instructions, the operation at reversing is performed according to the Operation Selec- tion at Reversing axis parameter.
  • Page 402 3 Axis Command Instructions Instruction Execution to Abort Immediately Preceding Operation The following timing chart shows an application in which the axis stops and holding is performed while this instruction is in execution. Position Control Instruction (First Instruction) Execute Done Busy Active CommandAborted...
  • Page 403 3 Axis Command Instructions Instruction Execution for Buffered during Immediately Preceding Operation The following timing chart shows an application in which the axis stops and holding is performed while this instruction is in execution. Position Control Instruction (First Instruction) Execute Done Busy Active...
  • Page 404 Criteria for Changing the Control Mode When you stop an axis for an OMRON 1S-series Servo Drive or G5-series Servo Drive, the MC Function Module sets the Velocity Limit Value (607F hex) to 0. The Control Mode is changed to CSP Mode when the following criterion is met for three consecutive periodic tasks after that.
  • Page 405 3 Axis Command Instructions MC_TorqueControl executed. Current velocity Position control Torque control Current velocity Command velocity The command velocity of this instruction is maintained until torque control is started. Torque Time Position control Torque control Command torque Current torque Torque Time The first command torque when this instruction is executed is the current torque.
  • Page 406 3 Axis Command Instructions Multi-execution of Motion Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Execution during Execution of Other Instructions You can switch to this instruction or buffer this instruction if you execute it during execution of another instruction.
  • Page 407: Mc_Settorquelimit

    3 Axis Command Instructions MC_SetTorqueLimit The MC_SetTorqueLimit instruction limits the torque output from the Servo Drive through the torque limit function of the Servo Drive. Precautions for Correct Use Precautions for Correct Use • You cannot use this instruction for an NX-series Pulse Output Unit. Instruction Name Graphic expression...
  • Page 408: Function

    3 Axis Command Instructions Name Meaning Data type Valid range Default Description NegativeValue Negative LREAL 0.1 to 1000.0 or 0.0 300.0 Set the torque limit in the negative Torque Limit direction in increments of 0.1%. If a value that exceeds the Maxi- mum Negative Torque Limit axis parameter, the negative torque will be the Maximum Negative Torque...
  • Page 409 • NegativeValue (Negative Torque Limit) Relation to Holding Operation of the MC_Home or MC_HomeWithParameter Instruction for OMRON 1S-series Servo Drives or G5-series Servo Drives Torque limits that are set in the Servo Drive in advance are used for the Proximity Reverse Turn/Holding Time (12) or No Home Proximity Input/Holding Home Input (13) Homing Operation Modes to automatically start torque control in the holding direction.
  • Page 410 For details on homing, refer to MC_Home on page 3-16 and MC_HomeWithParameter on page 3-38. Settings for OMRON 1S-series Servo Drives To use this instruction, you must set the Torque Limit - Switch Selection (3330-01 hex) for the 1S- series Servo Drive with the Sysmac Studio.
  • Page 411 3 Axis Command Instructions • If the Torque Limit Selection to 4, the values of the input variables to this instruction are always used. You must set torque limits that are suitable for both for the holding operation during homing and for other operations.
  • Page 412 3 Axis Command Instructions Timing Charts The following chart shows the timing of the torque limits. Enable PositiveEnable NegativeEnable Busy Enabled Error ErrorID 16#0000 Re-execution of Motion Control Instructions You cannot re-execute motion instructions with Enable inputs. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 413 3 Axis Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs MC_SetTorqueLimit Instruction Enable...
  • Page 414: Mc_Zoneswitch

    3 Axis Command Instructions MC_ZoneSwitch The MC_ZoneSwitch instruction determines if the command current position or actual current position of an axis is within a specified zone. Instruction Name Graphic expression ST expression MC_ZoneSwitch Zone Monitor MC_ZoneSwitch_instance ( MC_ZoneSwitch_instance Axis :=parameter, MC_ZoneSwitch Enable :=parameter, Axis...
  • Page 415 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Enabled Enable BOOL TRUE or TRUE while the axis is being controlled. FALSE InZone In Zone BOOL TRUE or TRUE when the axes position is within the zone. FALSE Busy Executing...
  • Page 416: Function

    3 Axis Command Instructions Function • If the axis command position or actual current position is above the FirstPosition and below the Last Position (i.e., if it is in the specified zone) when Enable of this instruction is TRUE, the output variable InZone will change to TRUE.
  • Page 417 3 Axis Command Instructions Modulo Maximum Position LastPosition FirstPosition Modulo Minimum Position InZone Zone Zone Zone − LastPosition = 330° Zone : The positions indicated with filled dots are included. FirstPosition = 210° When Maximum/Minimum Position Is Included Set FirstPosition to a larger value than LastPosition. Modulo Maximum Position FirstPosition...
  • Page 418 3 Axis Command Instructions Relationship between Axis Types and Position Types The relationship between the axis types that you can monitor and position types that is monitored is shown below. ReferenceType Axis Type _mcCommand _mcFeedback Servo axis Encoder axis Virtual servo axis Virtual encoder axis * A Position Type Selection Out of Range error (error code: 5430 hex) occurs when the instruction is executed.
  • Page 419 3 Axis Command Instructions Timing Chart When Error Occurs Enable Enabled InZone Busy Error ErrorID Error code 16#0000 Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561) 3-335...
  • Page 420: Mc_Touchprobe

    3 Axis Command Instructions MC_TouchProbe The MC_TouchProbe instruction records the position of an axis when a trigger signal occurs. Instruction Name Graphic expression ST expression MC_TouchProbe Enable MC_TouchProbe_instance ( MC_TouchProbe_instance External Axis :=parameter, MC_TouchProbe Latch TriggerInput :=parameter, Axis Axis TriggerVariable :=parameter, TriggerInput TriggerInput Execute :=parameter,...
  • Page 421 3 Axis Command Instructions *2 Refer to Unit Conversion Settings in the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NYseries Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559) for information on com- mand units.
  • Page 422 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done • When the latched position is recorded • When Execute is TRUE and changes to FALSE. and the instruction is completed after the •...
  • Page 423: Function

    3 Axis Command Instructions _sTRIGGER_REF Name Meaning Data type Valid range Function Mode Mode _eMC_TRIGGER_ 0: _mcDrive Specify the trigger mode. MODE 1: _mcController 0: Drive Mode 1: Controller Mode LatchID Latch ID _eMC_TRIGGER_ 0: _mcLatch1 Specify which of the two latch Selection LATCH_ID functions to use in Drive Mode.
  • Page 424 • LatchID is also used to specify the latch to abort for the MC_AbortTrigger (Disable External Latch) instruction. Additional Information • Latching a position is also possible if an encoder axis that is connected to an OMRON GX- series GX-EC02 EtherCAT Encoder Input Slave is used.
  • Page 425 • The width of the latch signal depends on the performance of the Servo Drive or other device and other factors. Additional Information Set InputDrive to _mcEXT (External Input) if you use an OMRON GX-series GX-EC02 Ether- CAT Encoder Input Slave.
  • Page 426 Select _mcEXT to use an external signal input to the Servo Drive as the trigger. • For an OMRON 1S-series Servo Drive, there are two options for _mcEXT: Ext1, and Ext2. For an OMRON G5-series Servo Drive, there are three options for _mcEXT: Ext1, Ext2, and Ext3.
  • Page 427 3 Axis Command Instructions TriggerInput Execute WindowOnly Done Busy RecordedPosition Position CommandAborted Error ErrorID 16#0000 Axis position LastPosition FirstPosition Position WindowOnly Set to Enable Only trigger inputs within the window are detected to latch the axis position. Trigger enabled TriggerInput Execute WindowOnly Done...
  • Page 428 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • Latching is not possible immediately after WindowOnly changes to TRUE and until the latch function is activated. • Time is needed until the latch function is activated. If the effective range for WindowOnly is too small, latching is not possible.
  • Page 429 • An in-position check is not performed when stopping for _mcImmediateStop. Additional Information • When an OMRON 1S-series Servo Drive is used, the operation will be the same as those described in below for CPU Units with unit version 1.10 or later, regardless of actual unit ver- sion of the CPU Unit that you use.
  • Page 430 • If an axis error occurs for an axis for which _mcImmediateStop (Immediate Stop) is specified and a trigger occurs before the axis is stopped, an immediate stop is performed for the axis by the OMRON G5-series Servo Drive. Also, the trigger will cause CommandAborted (Instruction Aborted) to change to TRUE.
  • Page 431 OMRON G5-series Servo Drive or NX-series Pulse Output Unit is used. The MC Function Module processes the stop if an OMRON 1S-series Servo Drive or a servo drive from another manufacturer is used. In either case, the axis will stop beyond the latched position, and the axis will then return to the latched position for a command from the Control- ler.
  • Page 432 3 Axis Command Instructions Aborting the Instruction End the MC_TouchProbe (Enable External Latch) instruction with the MC_AbortTrigger (Disable Exter- nal Latch) instruction. Specify the Axis and the LatchID (Latch ID Selection) to stop for the MC_Abort- Trigger instruction and execute it to stop the axis. MC_TouchProbe Instruction TriggerInput Execute...
  • Page 433 3 Axis Command Instructions Re-execution of Motion Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. An error occurs if Execute changes to TRUE again before the MC_TouchProbe instance completes reading RecordedPosition (Latched Position).
  • Page 434 3 Axis Command Instructions Multi-execution of Motion Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Execution during Execution of Other Instructions You can execute only one trigger at a time for a single LatchID on the same Axis.
  • Page 435: Sample Programming

    3 Axis Command Instructions Error If an error occurs during execution of the MC_TouchProbe instruction, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Execute Done Busy...
  • Page 436 3 Axis Command Instructions Operation Example Sensor 1 Servo axis Axis 1 Operation Pattern Axis 1 position Pos2 Latched position Pos1 Time Sensor 1 status Time Starting the Master Axis Velocity control is performed for axis 1. Detecting Workpiece Sensor 1 detects the workpiece. Latching the Position If the workpiece is detected in the window (Pos1 to Pos2), the position of axis 1 is latched.
  • Page 437 3 Axis Command Instructions Name Data type Default Comment Pos2 LREAL This variable specifies the last position of the win- dow. StartPg BOOL FALSE The Servo is turned ON if this variable is TRUE and EtherCAT process data communications are established.
  • Page 438 3 Axis Command Instructions The parameters are set for the MC_MoveVelocity (Velocity Control) and MC_TouchProbe (Enable External Latch) instructions. InitFlag Note: The contents of the inline ST are given below. The MC_MoveVelocity (Velocity Control) instruction is executed if home is defined for axis 1. MC_MoveVelocity Vel_InVel MC_Axis000...
  • Page 439 3 Axis Command Instructions Structured Text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF This is the Axis Variable for axis 1. MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axis 1. MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 1.
  • Page 440 3 Axis Command Instructions ELSE Pwr_En:=FALSE; END_IF; // Processing for a minor fault level error // Program the FaultHandler according to the device. IF MC_Axis000.MFaultLvl.Active=TRUE THEN FaultHandler(); END_IF; // If the Servo is ON and home is not defined, the Home instruction is executed. IF (Pwr_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN Hm_Ex:=TRUE;...
  • Page 441 3 Axis Command Instructions Active => Vel_Act, CommandAborted => Vel_Ca, Error => Vel_Err, ErrorID => Vel_ErrID //MC_TouchProbe T_PROBE( Axis := MC_Axis000, TriggerInput := T_Probe_TrigRef, TriggerVariable := T_Probe_TrigVar, Execute := T_Probe_Ex, WindowOnly := T_Probe_Wo, FirstPosition := T_Probe_FstPos, LastPosition := T_Probe_LstPos, Done =>...
  • Page 442: Mc_Aborttrigger

    3 Axis Command Instructions MC_AbortTrigger The MC_AbortTrigger instruction aborts a current latch operation. Instruction Name FB/FUN Graphic expression ST expression MC_AbortTrigger Disable MC_AbortTrigger_instance ( MC_AbortTrigger_instance External Axis :=parameter, MC_AbortTrigger Latch TriggerInput :=parameter, Axis Axis Execute :=parameter, TriggerInput TriggerInput Done =>parameter, Execute Done Busy =>parameter,...
  • Page 443 3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done • When latching is stopped. • When Execute is TRUE and changes to FALSE. • When this instruction is executed for a •...
  • Page 444: Function

    3 Axis Command Instructions Function • The MC_AbortTrigger cancels a latch operation. • You can specify the latch operation to abort by specifying the Axis and LatchID for the MC_AbortTrig- ger (Disable External Latch) instruction. • If you execute MC_AbortTrigger (Disable External Latch) for a trigger for which there is no latch request, MC_AbortTrigger does nothing and ends normally.
  • Page 445 3 Axis Command Instructions Timing Charts • Done for the MC_AbortTrigger (Disable External Latch) instruction changes to TRUE one period after Execute changes to TRUE. MC_TouchProbe TriggerInput Execute Done Busy Command Aborted Error ErrorID 16#0000 MC_AbortTrigger Execute Done Busy Command Aborted Error ErrorID 16#0000...
  • Page 446 3 Axis Command Instructions Errors If an error occurs during execution of the MC_AbortTrigger (Disable) instruction. Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). MC_AbortTrigger Execute Done...
  • Page 447: Mc_Axesobserve

    3 Axis Command Instructions MC_AxesObserve The MC_AxesObserve instruction monitors the deviation between the command position or feedback position for the specified axis to see if it exceeds the allowed value. Instruction Name Graphic expression ST expression MC_AxesObserve Monitor Axis MC_AxesObserve_instance ( MC_AxesObserve_instance Following Master :=parameter,...
  • Page 448 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Enabled Enable BOOL TRUE or FALSE TRUE when the axis is being controlled. Invalid Excessive BOOL TRUE or FALSE TRUE when the permitted following error between Following axes is exceeded.
  • Page 449: Function

    3 Axis Command Instructions Additional Information You can also set axes that belong to groups. Function • If the command positions of the specified Master (Master Axis) and Slave (Slave Axis) or the differ- ence between the actual positions exceeds the permitted following error, Invalid (Excessive Following Error between Axes) changes to TRUE.
  • Page 450 3 Axis Command Instructions • _mcCommand: Command position (value calculated in the previous task period) The master axis command position that was calculated in the previous task period is used for the current period. The command value that was calculated for the master axis in the last periodic task is used to cal- culate the command position of the slave axis in the current period.
  • Page 451 3 Axis Command Instructions ReferenceType (Position Type Selection) Set to _mcFeedback The DeviatedValue (Following Error between Axes) is the shorter distance between the actual cur- rent position of the Master (Master Axis) and the actual current position of the Slave (Slave Axis) in the range of the ring counter.
  • Page 452 3 Axis Command Instructions Re-execution of Motion Instructions You cannot re-execute enable-type motion instructions. Multi-execution of Motion Instructions There are no restrictions for multi-execution of instructions. For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 453: Mc_Syncmovevelocity

    3 Axis Command Instructions MC_SyncMoveVelocity The MC_SyncMoveVelocity instruction outputs the value set for the target velocity every task period to the Servo Drive in Cyclic Synchronous Velocity Mode. Precautions for Correct Use Precautions for Correct Use • You cannot use this instruction for an NX-series Pulse Output Unit. •...
  • Page 454 3 Axis Command Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer Mode _eMC_BUFFER_ 0: _mcAborting Specify the behavior when execut- Selection MODE ing more than one motion instruc- 1: _mcBuffered tion. 0: Aborting 1: Buffered *1 Refer to Unit Conversion Settings in the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY- series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 455: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE InVelocity When the target velocity is reached. • When Error changes to TRUE. • When CommandAborted changes to TRUE. Busy When Execute changes to TRUE. •...
  • Page 456 3 Axis Command Instructions MC_SyncMoveVelocity Programmed in Priority-16 Periodic Task Command Command Servo Velocity velocity velocity Drive Target velocity (black dots) specified with the input Time Primary period Task period Precautions for Correct Use Precautions for Correct Use Refer to Precautions for Master and Auxiliary Axes in Synchronized Control on page 1-6 for pre- cautions on using this instruction for the master axis of synchronized control.
  • Page 457 The actual current position is used until the instruction is ended. While the OMRON 1S-series Servo Drive or G5-series Servo Drive is processing the switch to CSP Mode, the CSP reference position that was mapped in advance is sent in the PDO. Until processing to switch from CSV to CSP Mode is completed, this reference position is used as the command cur- rent position.
  • Page 458 3 Axis Command Instructions Additional Information Of the OMRON G5-series Servo Drives, those for Linear Motors do not support the CSP Refer- ence Position (4020 hex). When Using a Servo Drive Other Than an OMRON 1S-series Servo Drive or G5-series Servo Drive...
  • Page 459 3 Axis Command Instructions Change Criterion Whether it is possible to change the Control Mode depends on Servo Drive specifications. To ensure that the Control Mode is switched to CSP Mode during stop processing for stop instruc- tions or errors, it is necessary to sufficiently decelerate the Servomotor first. The Control Mode is changed to CSP Mode when the following criterion is met for three consecutive periodic tasks after the command velocity changes to 0.
  • Page 460 3 Axis Command Instructions Home Status If CmdPosMode (Command Current Position Count Selection) is set to _mcCount, the home will remain defined. Overrides Overrides are disabled for this instruction. Software Limits Software limits are enabled for this instruction. These are enabled even for the following axis param- eter settings.
  • Page 461 3 Axis Command Instructions MC_SyncMoveVelocity Instruction Execute InVelocity Busy Active CommandAborted Error ErrorID 16#0000 MC_Stop Instruction Execute Done Busy Active Velocity Decelerates to a stop when MC_Stop is executed. Target velocity Time Target velocity is The target changed each velocity does primary period.
  • Page 462 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 463: Mc_Syncmoveabsolute

    3 Axis Command Instructions MC_SyncMoveAbsolute The MC_SyncMoveAbsolute instruction cyclically outputs the specified target position for the axis. Instruction Name Graphic expression ST expression MC_SyncMove Cyclic Syn- MC_SyncMoveAbsolute_instance ( MC_SyncMoveAbsolute_instance Absolute chronous Axis :=parameter, MC_SyncMoveAbsolute Absolute Execute :=parameter, Axis Axis Positioning Position :=parameter, Execute InPosition...
  • Page 464 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description TRUE when the actual current position is within InPosition In Position BOOL TRUE or FALSE the in-position range of the target position. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. Active Controlling BOOL...
  • Page 465: Function

    3 Axis Command Instructions Function • The MC_GroupSyncMoveAbsolute instruction outputs the target position from the user program every task period to the Servo Drive or other device in Cyclic Synchronous Position (CSP) Control Mode. The target position is given as an absolute position. •...
  • Page 466 3 Axis Command Instructions Even if the target position is changed while InPosition is TRUE, it will remain TRUE for the remainder of the period and change to FALSE the next period. The setting of the In-position Check Time axis parameter is disabled. Stop Processing This section describes the methods that are used to stop axis operations.
  • Page 467 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • InPosition changes to TRUE when the actual current position is within the in-position range from Position (Target Position).
  • Page 468 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 469 3 Axis Command Instructions Timing Chart When Error Occurs Execute InPosition Busy Active CommandAborted Error ErrorID Error code 16#0000 Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561) 3-385...
  • Page 470: Mc_Reset

    3 Axis Command Instructions MC_Reset The MC_Reset instruction clears axis errors. Instruction Name FB/FUN Graphic expression ST expression MC_Reset Reset Axis MC_Reset_instance ( MC_Reset_instance Error Axis :=parameter, MC_Reset Execute :=parameter, Axis Axis Done =>parameter, Execute Done Busy =>parameter, Busy Failure =>parameter, Failure Error =>parameter, Error...
  • Page 471: Function

    3 Axis Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When error clear processing is completed • When Execute is TRUE and changes to FALSE. normally. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 472 Act.Vel (Actual Current Velocity) in the Axis Variable is 0 if the axis is completely stopped. Use this to confirm when the axis is completely stopped. • If you use this instruction for an OMRON G5-series Servo Drive, perform exclusive control of instructions so that the ResetECError (Reset EtherCAT Error) instruction is not executed at the same time.
  • Page 473 3 Axis Command Instructions Aborting the Instruction The instruction is aborted if it is not possible to clear errors that occur when the axis is decelerating to a stop for an error or errors that occur during axis errors resulting from axis common errors. Execute Done Busy...
  • Page 474: Mc_Changeaxisuse

    3 Axis Command Instructions MC_ChangeAxisUse The MC_ChangeAxisUse instruction temporarily changes the Axis Use axis parameter. Instruction Name FB/FUN Graphic expression ST expression MC_ChangeAxisUse Change MC_ChangeAxisUse_instance ( MC_ChangeAxisUse_instance Axis Use Axis :=parameter, MC_ChangeAxisUse Execute :=parameter, Axis Axis AxisUse :=parameter, Execute Done Done =>parameter, AxisUse Busy...
  • Page 475: Function

    3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or TRUE when the instruction is completed. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted.
  • Page 476 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • You cannot change an axis to a used axis if the axis number exceeds the highest axis number that can be controlled by the CPU Unit. The number of real axes that you can change to used axes is the maximum number of used real axes.
  • Page 477 3 Axis Command Instructions Timing Charts MC_ChangeAxisUse Instruction Execute Done Busy CommandAborted Error 16#0000 ErrorID Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 478: Mc_Digitalcamswitch

    3 Axis Command Instructions MC_DigitalCamSwitch The MC_DigitalCamSwitch instruction turns a digital output ON or OFF according to the axis position. Instruction Name FB/FUN Graphic expression ST expression MC_Digi- Enable MC_DigitalCamSwitch_instance ( MC_DigitalCamSwitch_instance talCamSwitch Digital Axis :=parameter, MC_DigitalCamSwitch Switches :=parameter, Axis Axis Switch Outputs :=parameter,...
  • Page 479: Variables

    3 Axis Command Instructions Variables Input Variables Name Meaning Data type Valid range Default Description Enable Enable BOOL TRUE or FALSE The instruction is executed while Enable is TRUE. FALSE The values in Outputs will not change while Enable is FALSE.
  • Page 480: Function

    3 Axis Command Instructions In-Out Variables Valid Name Meaning Data type Description range Axis Axis _sAXIS_REF Specify the axis for which to access the position. Switches Switches ARRAY[0..255] OF Specify an array variable of _sCAMSWITCH_REF switch structures for use as switch ON/OFF pattern _sCAMSWITCH_REF data.
  • Page 481 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use • This instruction is not sufficient to actually turn digital outputs ON and OFF. • This instruction requires that you use an NX-series Encoder Input Unit and that time stamping is operating.
  • Page 482 3 Axis Command Instructions Additional Information For details on the NX_AryDOutTimeStamp instruction, refer to the NJ/NX-series Controller Instructions Reference Manual (Cat. No. W502) or NY-series Instructions Reference Manual (Cat. No. W560). Instruction Details You can use this instruction to implement a mechanical cam switch that controls a sensor output signal according to cam rotation angles in a program in the Controller.
  • Page 483 3 Axis Command Instructions For DOut (DOut Unit Output Bit), specify as the actual digital output, the device variable that is assigned to the output bit of the Digital Output Unit that supports time stamp refreshing. instMC_DigitalCamSwitch MC_DigitalCamSwitch MC_Axis001 Axis Axis MC_Axis001 Switches...
  • Page 484 3 Axis Command Instructions Switch Structure (_sCAMSWITCH_REF Data Type) The switch structure (_sCAMSWITCH_REF) is used to specify the ON/OFF pattern for the output signal. You can specify up to 256 ON/OFF patterns for this instruction with an array variable. You can specify up to 16 ON/OFF patterns for one track.
  • Page 485 3 Axis Command Instructions The operation is as shown below when the axis continuously rotates in the positive direction. Here, the Count Mode is set to Rotary Mode and the ring counter range is set to 0 to 5,000 in the axis parame- ters.
  • Page 486 3 Axis Command Instructions Track Option Structure (_sTRACK_REF Data Type) The switch structure (_sTRACK_REF) is used to specify the operating condition for a switch. You can specify up to 16 output conditions for this instruction with an array variable. The variable that is specified for TrackOptions and the variable that is specified for Outputs must have the same number of array elements.
  • Page 487 3 Axis Command Instructions Precautions for Correct Use Precautions for Correct Use If you set the Count Mode to Rotary Mode and use OnCompensation or OffCompensation, set the parameters so that the relationship between FirstOnPosition and LastOnPosition is not reversed. The output timing will be unstable.
  • Page 488 3 Axis Command Instructions Timing Charts A timing chart for execution of the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction is shown below. Enable InOperation Busy Error ErrorID 16#0000 The following timing chart is for when an unused axis is specified or when an MC Test Run is in prog- ress.
  • Page 489 3 Axis Command Instructions Errors If this instruction cannot be executed, an error occurs and Error of this instruction changes to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Timing Chart When Error Occurs Enable InOperation...
  • Page 490: Sample Programming

    3 Axis Command Instructions Sample Programming This section provides sample programming for the example that is given in Setting Example on page 3- 400. Configuration Devices The following devices are used in this sample programming. Device Model number EtherCAT Coupler Unit NX-ECC201 (Ver.1.1) Pulse Output Unit NX-PG0122...
  • Page 491 3 Axis Command Instructions Ladder Diagram Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for axis 1. MC_Axis001 _sAXIS_REF Axis Variable for axis 2. E001_Time_Stamp_of_Synchronous_Output ULINT Device variable N3_Output_Bit_00 BOOL Device variable N3_Output_Bit_00_Time_Stamp ULINT Device variable N3_Output_Bit_01 BOOL Device variable N3_Output_Bit_01_Time_Stamp...
  • Page 492 3 Axis Command Instructions If the Servo is ON for axis 1 and home is not defined, the Home instruction is executed to define home. MC_Home Hm_D MC_Axis000 Axis Axis MC_Axis000 Pwr_Status Done Execute Busy Hm_Bsy CommandAborted Hm_Ca Error Hm_Err ErrorID Hm_ErrID The parameters are set for the MC_MoveVelocity (Velocity Control) instruction and for the Switches variables for the...
  • Page 493 3 Axis Command Instructions inst_NX_AryDOutTimeStamp2 InOperation NX_AryDOutTimeStamp Enable Outputs[1] SetDOut SetDOut Outputs[1] E001_Time_Stamp_of_Synchronous_Output SyncOutTime N3_Output_Bit_01 DOut DOut N3_Output_Bit_01 N3_Output_Bit_01_Time_Stamp TimeStamp TimeStamp N3_Output_Bit_01_Time_Stamp Contents of Inline ST // MC_MoveVelocity parameters Vel_Vel := LREAL#1000.0; Vel_Acc := LREAL#0.0; Vel_Dec := LREAL#0.0; Vel_Jrk := LREAL#1000.0; InitFlag := BOOL#TRUE;...
  • Page 494 3 Axis Command Instructions Structured Text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for axis 1. MC_Axis001 _sAXIS_REF Axis Variable for axis 2. E001_Time_Stamp_of_Synchronous_Output ULINT Device variable N3_Output_Bit_00 BOOL Device variable N3_Output_Bit_00_Time_Stamp ULINT Device variable N3_Output_Bit_01 BOOL Device variable...
  • Page 495 3 Axis Command Instructions Switches[1].LastOnPosition := LREAL#3000.0; Switches[1].AxisDirection := _eMC_DIRECTION#_mcNegativeDirection; Switches[1].CamSwitchMode := _eMC_SWITCH_MODE#_mcPositionBased; Switches[2].TrackNumber := UINT#0; Switches[2].FirstOnPosition := LREAL#4000.0; Switches[2].LastOnPosition := LREAL#1000.0; Switches[2].AxisDirection := _eMC_DIRECTION#_mcNoDirection; Switches[2].CamSwitchMode := _eMC_SWITCH_MODE#_mcPositionBased; Switches[3].TrackNumber := UINT#1; Switches[3].FirstOnPosition := LREAL#3000.0; Switches[3].Duration := T#1350ms; Switches[3].AxisDirection := _eMC_DIRECTION#_mcNoDirection; Switches[3].CamSwitchMode := _eMC_SWITCH_MODE#_mcTimeBased;...
  • Page 496 3 Axis Command Instructions Axis := MC_Axis000, Execute := Hm_Ex, Done => Hm_D, Busy => Hm_Bsy, CommandAborted => Hm_Ca, Error => Hm_Err, ErrorID => Hm_ErrID //MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, Jerk := Vel_Jrk,...
  • Page 497: Mc_Timestamptopos

    3 Axis Command Instructions MC_TimeStampToPos The MC_TimeStampToPos instruction calculates the position of the axis for the specified time stamp. Instruction Name Graphic expression ST expression MC_TimeStamp- Time Stamp MC_TimeStampToPos_instance ( MC_TimestampToPos_instance ToPos to Axis Posi- Axis :=parameter, MC_TimestampToPos tion Calcula- Enable :=parameter, Axis Axis...
  • Page 498: Function

    3 Axis Command Instructions Output Variables Data Name Meaning Valid range Description type Enabled Enable BOOL TRUE or FALSE TRUE when the axis is being controlled. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. CalcPosition Calculated LREAL Negative number, Contains the position for the specified time stamp.
  • Page 499 3 Axis Command Instructions Position Current position Calculated position Current time Specified time Time stamp stamp Precautions for Correct Use Precautions for Correct Use • This instruction requires that you use an NX-series Encoder Input Unit and that time stamping is operating.
  • Page 500 3 Axis Command Instructions Enable Enabled Busy CalcPosition Undefined. Error ErrorID 16#0000 Re-execution of Motion Instructions You cannot re-execute enable-type motion instructions. Multi-execution of Motion Instructions This instruction is executed independently from other instructions. The restrictions for multi-execution of motion instructions do not apply. For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 501: Sample Programming

    3 Axis Command Instructions Sample Programming This section shows sample programming that measures the distances between workpieces that move on a conveyor belt. Configuration Devices The following devices are used in this sample programming. Device Model number EtherCAT Coupler Unit NX-ECC201 (Ver.1.1) Pulse Output Unit NX-PG0122...
  • Page 502 3 Axis Command Instructions Operation Example The sensor output turns ON when the sensor detects a workpiece. When the workpiece passes, the sensor output turns OFF. When the sensor detects the next workpiece, the sensor output turns ON again. The position of the encoder input is calculated based on the time stamp when the sensor output turns ON.
  • Page 503 3 Axis Command Instructions Sample Programming If StartPg input is TRUE, EtherCAT communications are checked to see if process data communications are normal for axis 1. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] If process data communications are active for axis 1, the Servo is turned ON. MC_Power Pwr_Status MC_Axis000...
  • Page 504 3 Axis Command Instructions After the MC_MoveVelocity (Velocity Control) instruction is executed for axis 1, the MC_TimeStampToPos (Time Stamp to Axis Position Calculation) instruction is executed for axis 2. instMC_TimeStampToPos MC_TimeStampToPos inst_Enabled MC_Axis001 Axis Axis MC_Axis001 Vel.Act Enable Enabled N3_Input_Bit_00_Time_Stamp TimeStamp Busy TTP_Busy...
  • Page 505 3 Axis Command Instructions Contents of Inline ST 1 // MC_MoveVelocity parameters Vel_Vel := LREAL#1000.0; Vel_Acc := LREAL#0.0; Vel_Dec := LREAL#0.0; Vel_Jrk := LREAL#1000.0; InitFlag := BOOL#TRUE; Contents of Inline ST 2 IF MC_Axis001.Act.Pos=LREAL#0.0 THEN Inc(RotaryCount); END_IF; Contents of Inline ST 3 IF Index <...
  • Page 506 3 Axis Command Instructions Structured Text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for axis 1. MC_Axis001 _sAXIS_REF Axis Variable for axis 2. N3_Input_Bit_00 BOOL Device variable N3_Input_Bit_00_Time_Stamp ULINT Device variable Hm_Ex BOOL FALSE The HM instance of MC_Home is executed when this variable changes to TRUE.
  • Page 507 3 Axis Command Instructions // If the Servo is ON and home is not defined, the Home instruction is executed. IF (Pwr_Status=TRUE) THEN Hm_Ex:=TRUE; END_IF; // After home is defined, MC_MoveVelocity is executed. IF MC_Axis000.Details.Homed=TRUE AND Hm_D=TRUE THEN Vel_Ex:=TRUE; END_IF; // The number of rotations of the encoder axis is counted.
  • Page 508 3 Axis Command Instructions //MC_Power PWR( Axis := MC_Axis000, Enable := Pwr_En, Status => Pwr_Status, Busy => Pwr_Bsy, Error => Pwr_Err, ErrorID => Pwr_ErrID //MC_Home Axis := MC_Axis000, Execute := Hm_Ex, Done => Hm_D, Busy => Hm_Bsy, CommandAborted => Hm_Ca, Error =>...
  • Page 509: Mc_Syncoffsetposition

    3 Axis Command Instructions MC_SyncOffsetPosition The MC_SyncOffsetPosition instruction compensates the position of a slave axis currently in synchronized con- trol. Instruction Name Graphic expression ST expression MC_SyncOffsetPosi- Cyclic Synchro- MC_SyncOffsetPosition_instance ( MC_SyncOffsetPosition_instance tion nous Position Axis :=parameter, Offset Compen- MC_SyncOffsetPosition Execute :=parameter, Axis Axis...
  • Page 510 3 Axis Command Instructions Output Variables Data Name Meaning Valid range Description type OutputtedOffset- Position Off- LREAL Negative number, Contains the position offset that was added to the Position set Output positive number, or command current position. Value The value is updated when Active is TRUE. Updating is stopped and the value is retained when CommandAborted or Error is TRUE.
  • Page 511: Function

    3 Axis Command Instructions Function • The MC_SyncOffsetPosition instruction adds an offset that is calculated based on the value of the OffsetPosition (Position Offset) input variable to the command current position and outputs the result to the Servo Drive. • You can change the value of the OffsetPosition (Position Offset) input variable while the Active (Con- trolling) output variable is TRUE.
  • Page 512 3 Axis Command Instructions • The following timing chart shows execution of this instruction while execution of the MC_GearIn (Start Gear Operation) instruction is in progress in the primary periodic task and then CommandAborted (Instruction Aborted) of the MC_GearIn (Start Gear Operation) instruction changes to TRUE. MC_GearIn Instruction Execute Active...
  • Page 513 3 Axis Command Instructions Repeatedly Starting and Stopping this Instruction If you execute this instruction again after it is aborted, 0 is used as the starting point for the OffsetPosi- tion (Position Offset) input variable. If you specify 0 for OffsetPosition (Position Offset) when you exe- cute the instruction the second time, the offset that is added to the command position is 0.
  • Page 514 3 Axis Command Instructions InputOffsetPosition PreviousOffsetPos MC_SyncOffsetPosition Instruction Execute OffsetPosition Active CommandAborted OutputtedOffsetPosition Offset 0 20 Command position (increased or decreased by offset) Time Executable Axis Status You can execute this instruction for any axis for which Status.Synchronized (Synchronized Motion) in the status of the axis specified for Axis is TRUE.
  • Page 515 3 Axis Command Instructions Timing Charts The following timing charts show when the position offset is applied when this instruction is executed. When this Instruction Is Executed in the Primary Periodic Task or Priority-5 Periodic Task The position offset that is specified for the input is output to the Servo Drive during the next task period. The following timing chart shows an example of the operation for when this instruction is executed in the primary periodic task.
  • Page 516 3 Axis Command Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 517 3 Axis Command Instructions Multi-execution of MC_SyncOffsetPosition Instructions If you perform multi-execution of MC_SyncOffsetPosition instructions, CommandAborted (Instruction Aborted) of the instance for which execution is currently in progress changes to TRUE and the next instance is executed. The starting point for instances that are executed later is found by adding the position offset that was output one cycle before the previous instance was aborted.
  • Page 518 3 Axis Command Instructions Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-434 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 519: Axes Group Instructions

    Axes Group Instructions This section describes the instructions to perform multi-axes coordinated control for the MC Function Module. MC_GroupEnable ..........4-2 MC_GroupDisable .
  • Page 520: Mc_Groupenable

    4 Axes Group Instructions MC_GroupEnable The MC_GroupEnable instruction enables an axes group. Instruction Name Graphic expression ST expression MC_GroupEnable Enable Axes MC_GroupEnable_instance ( MC_GroupEnable_instance Group AxesGroup :=parameter, MC_GroupEnable Execute :=parameter, AxesGroup AxesGroup Done =>parameter, Execute Done Busy =>parameter, Busy CommandAborted CommandAborted =>parameter, Error...
  • Page 521: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 522 4 Axes Group Instructions Basic Function • The MC_GroupEnable (Enable Axes Group) instruction places the axes group specified by Axes- Group into the GroupEnable state. • When an axes group is in the GroupEnable state, you can execute any multi-axes coordinated control instructions for the axes group.
  • Page 523 4 Axes Group Instructions Errors If an error occurs during execution of the MC_GroupEnable instruction, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Execute Busy Done CommandAborted...
  • Page 524: Mc_Groupdisable

    4 Axes Group Instructions MC_GroupDisable The MC_GroupDisable instruction disables an axes group. Instruction Name Graphic expression ST expression MC_GroupDisable Disable Axes MC_GroupDisable_instance ( MC_GroupDisable_instance Group AxesGroup :=parameter, MC_GroupDisable Execute :=parameter, AxesGroup AxesGroup Done =>parameter, Execute Done Busy =>parameter, Busy CommandAborted CommandAborted =>parameter, Error...
  • Page 525: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the axes group state is changed to • When Execute is TRUE and changes to FALSE. GroupDisable. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 526 4 Axes Group Instructions If you execute the MC_GroupDisable instruction for an AxisGroup that is under multi-axes coordinated control, CommandAborted of multi-axes coordinated control instruction will change to TRUE. Com- mandAborted of any buffered multi-axes coordinated control instruction will also change to TRUE. If the axes are moving, they will decelerate to a stop at the maximum deceleration rate for each axis.
  • Page 527 4 Axes Group Instructions Errors If an error occurs during execution of the MC_GroupDisable instruction, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Execute Done Busy Error...
  • Page 528: Mc_Movelinear

    4 Axes Group Instructions MC_MoveLinear The MC_MoveLinear instruction performs linear interpolation. Instruction Name Graphic expression ST expression MC_MoveLinear Linear Interpolation MC_MoveLinear_instance ( MC_MoveLinear_instance AxesGroup :=parameter, MC_MoveLinear Execute :=parameter, AxesGroup AxesGroup Position :=parameter, Execute Done Velocity :=parameter, Position Busy Acceleration :=parameter, Velocity Active Deceleration :=parameter,...
  • Page 529 4 Axes Group Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer Mode _eMC_ 0: _mcAborting Specify the behavior when Selection BUFFER_ executing more than one 1: _mcBuffered MODE motion instruction. 2: _mcBlendingLow 0: Aborting 3: _mcBlendingPrevious 1: Buffered 4: _mcBlendingNext 2: Blending low 5: _mcBlendingHigh...
  • Page 530: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When positioning is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 531 4 Axes Group Instructions Registering Axes Groups for Interpolation • Select the axes group to perform interpolation. An axes group is represented by _MC_GRP[*], or by _MC1_GRP[*] and _MC2_GRP[*]. • Specify the axis composition with Composition in the Axis Group Variable. You can specify two to four axes.
  • Page 532 4 Axes Group Instructions Position (Target Position) • Set the target position in Position (Target Position) for all of the axes specified in the Axis Selection Axes Group Variable. • You must create a 1×4 array variable in the Sysmac Studio to assign Position (A0, A1, A2, and A3).
  • Page 533 4 Axes Group Instructions Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Deceleration Rate), and Jerk Set Velocity, Acceleration, Deceleration, and Jerk to specify the interpolation velocity, acceleration rate, deceleration rate, and jerk for linear interpolation. Linear interpolation separates the interpo- lated motion into motion on each axis.
  • Page 534 4 Axes Group Instructions L, Fa0, Fa1, Fa2, and Fa3 can be expressed with the following formulas. × Fa0 = F × Fa1 = F × Fa2 = F × Fa3 = F + La1 + La2 + La3 Velocity (Target Velocity) •...
  • Page 535 4 Axes Group Instructions • Short Travel Distance When Jerk Is 0 The interpolation velocity will not reach the specified Vt (Target Velocity). Interpolation velocity Time Acceleration rate Time Deceleration rate Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate. •...
  • Page 536 4 Axes Group Instructions • Short Travel Distance When Jerk Is Not 0 The interpolation velocity will not reach the specified Vt (Target Velocity). Interpolation velocity Time Acceleration rate Time Deceleration rate Jerk Time Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate, Jt: Specified jerk Additional Information •...
  • Page 537 4 Axes Group Instructions BufferMode (Buffer Mode Selection) • BufferMode specifies how to join the axis motions for this interpolation instruction and the previous interpolation instruction. • There are the following six settings. Buffer Mode Selection Description Aborting Aborts the instruction being executed and switches to this instruction. If the direction of axis motion is reversed by switching instructions, the motion will be reversed according to the Operation Selection at Reversing axis parameter.
  • Page 538 4 Axes Group Instructions Transition Disabled The path is given priority when creating the velocity command value, so velocity command values of the axes may change rapidly when switching from one operation to the next. Operation Example The Velocity (Target Velocity), BufferMode, and TransitionMode when transitioning from P1 to P2, and from P2 to P3 are shown below.
  • Page 539 4 Axes Group Instructions Superimpose Corners Use the superimpose corners specification when you want make the axes command velocities con- tinuous. Operation Example The Velocity (Target Velocity), BufferMode, and TransitionMode when transitioning from P1 to P2, and from P2 to P3 are shown below. •...
  • Page 540 4 Axes Group Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted, and all axes in the linear interpolation motion stop. Execute Done Busy Active...
  • Page 541: Sample Programming

    4 Axes Group Instructions Sample Programming This section shows sample programming for linear interpolation with periodic multi-execution of instruc- tions. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Types Axis Axis Type Axis 1 Servo axis Axis 2...
  • Page 542 4 Axes Group Instructions Operation Example The following is an example of operation that performs linear interpolation automatically and then returns to home and stops. Linear interpolations (2) to (7) are executed with multi-exe- cution of instructions while linear interpolation (1) is being executed. Set the Buffer Mode Selection to Buffered.
  • Page 543 4 Axes Group Instructions Name Data type Default Comment Pwr2_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR2 instance of the MC_Power instruction. This variable changes to TRUE when the Servo is turned ON. StartPg BOOL FALSE...
  • Page 544 4 Axes Group Instructions If the Servo is ON for axis 1 and home is not defined, the Home instruction is executed to define home. MC_Home Hm1_D MC_Axis000 Axis Axis Pwr1_Status MC_Axis000.Details.Homed Execute Done Busy Hm1_Bsy CommandAborted Hm1_Ca Error Hm1_Err ErrorID Hm1_ErrID If the Servo is ON for axis 2 and home is not defined, the Home instruction is executed to define home.
  • Page 545 4 Axes Group Instructions Linear interpolation (2) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_LIN2 MC_MoveLinear Mv_Lin2_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Done Execute Mv_Lin2_Pos Position Busy Mv_Lin2_Bsy Mv_Lin2_Vel Velocity Active Mv_Lin2_Act Mv_Lin2_Acc Acceleration CommandAborted Mv_Lin2_Ca Mv_Lin2_Dec Deceleration Error...
  • Page 546 4 Axes Group Instructions Linear interpolation (5) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_LIN5 MC_MoveLinear Mv_Lin5_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Done Execute Mv_Lin5_Pos Position Busy Mv_Lin5_Bsy Mv_Lin5_Vel Velocity Active Mv_Lin5_Act Mv_Lin5_Acc Acceleration CommandAborted Mv_Lin5_Ca Mv_Lin5_Dec Deceleration Error...
  • Page 547 4 Axes Group Instructions Mv_Lin2_Dec := LREAL#100.0; Mv_Lin2_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin2_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN3 parameters Mv_Lin3_Pos[0] := LREAL#50.0; Mv_Lin3_Pos[1] := LREAL#15.0; Mv_Lin3_Vel := LREAL#100.0; Mv_Lin3_Acc := LREAL#100.0; Mv_Lin3_Dec := LREAL#100.0; Mv_Lin3_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin3_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN4 parameters Mv_Lin4_Pos[0] := LREAL#0.0;...
  • Page 548 4 Axes Group Instructions Structured Text (ST) Main Variables Name Data type Default Comment MC_Group000 _sGROUP This is the Axes Group Variable for axes group _REF MC_Group000.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axes group 0. MC_Group000.Status.Disabled BOOL FALSE...
  • Page 549 4 Axes Group Instructions // MV_LIN2 parameters Mv_Lin2_Pos[0] := LREAL#0.0; Mv_Lin2_Pos[1] := LREAL#10.0; Mv_Lin2_Vel := LREAL#100.0; Mv_Lin2_Acc := LREAL#100.0; Mv_Lin2_Dec := LREAL#100.0; Mv_Lin2_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin2_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN3 parameters Mv_Lin3_Pos[0] := LREAL#50.0; Mv_Lin3_Pos[1] := LREAL#15.0; Mv_Lin3_Vel := LREAL#100.0; Mv_Lin3_Acc := LREAL#100.0;...
  • Page 550 4 Axes Group Instructions AND (_EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]=FALSE) THEN Pwr1_En:=TRUE; // Turn ON the Servo for axis 1. ELSE Pwr1_En:=FALSE; // Turn OFF the Servo for axis 1. END_IF; // If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 2 is turned ON. // If EtherCAT communications are not normal, the Servo is turned OFF.
  • Page 551 4 Axes Group Instructions PWR2( Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_Status, Busy => Pwr2_Bsy, Error => Pwr2_Err, ErrorID => Pwr2_ErrID // MC_Home for axis 1 HM1( Axis := MC_Axis000, Execute := Hm1_Ex, Done => Hm1_D, Busy => Hm1_Bsy, CommandAborted =>...
  • Page 552 4 Axes Group Instructions Velocity := Mv_Lin2_Vel, Acceleration := Mv_Lin2_Acc, Deceleration := Mv_Lin2_Dec, BufferMode := Mv_Lin2_Bm, MoveMode := Mv_Lin2_Mm, Done => Mv_Lin2_D, Busy => Mv_Lin2_Bsy, Active => Mv_Lin2_Act, CommandAborted => Mv_Lin2_Ca, Error => Mv_Lin2_Err, ErrorID => Mv_Lin2_ErrID // Linear interpolation (3) MV_LIN3( AxesGroup := MC_Group000,...
  • Page 553 4 Axes Group Instructions // Linear interpolation (6) MV_LIN6( AxesGroup := MC_Group000, Execute := Mv_Lin6_Ex, Position := Mv_Lin6_Pos, Velocity := Mv_Lin6_Vel, Acceleration := Mv_Lin6_Acc, Deceleration := Mv_Lin6_Dec, BufferMode := Mv_Lin6_Bm, MoveMode := Mv_Lin6_Mm, Done => Mv_Lin6_D, Busy => Mv_Lin6_Bsy, Active =>...
  • Page 554: Mc_Movelinearabsolute

    4 Axes Group Instructions MC_MoveLinearAbsolute The MC_MoveLinearAbsolute instruction performs linear interpolation for a specified absolute position. Instruction Name Graphic expression ST expression MC_MoveLinearAbsolute Absolute MC_MoveLinearAbsolute_ MC_MoveLinearAbsolute_instance Linear instance ( MC_MoveLinearAbsolute Interpolation AxesGroup :=parameter, AxesGroup AxesGroup Execute :=parameter, Execute Done Position :=parameter, Position Busy Velocity :=parameter,...
  • Page 555 4 Axes Group Instructions Name Meaning Data type Valid range Default Description CoordSystem Coordinate _eMC_ 0: _mcACS Specify the coordinate System COORD_ system. SYSTEM 0: Axis coordinate sys- tem (ACS) BufferMode Buffer Mode _eMC_ 0: _mcAborting Specify the behavior Selection BUFFER_ when executing more 1: _mcBuffered...
  • Page 556: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When positioning is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 557: Mc_Movelinearrelative

    4 Axes Group Instructions MC_MoveLinearRelative The MC_MoveLinearRelative instruction performs linear interpolation for a specified relative position. Instruction Name Graphic expression ST expression MC_MoveLinearRelative Relative MC_MoveLinearRelative_ MC_MoveLinearRelative_instance Linear instance ( MC_MoveLinearRelative Interpolation AxesGroup :=parameter, AxesGroup AxesGroup Execute :=parameter, Execute Done Distance :=parameter, Distance Busy Velocity :=parameter,...
  • Page 558 4 Axes Group Instructions Name Meaning Data type Valid range Default Description CoordSystem Coordinate _eMC_ 0: _mcACS Specify the coordinate System COORD_ system. SYSTEM 0: Axis coordinate system (ACS) BufferMode Buffer Mode _eMC_ 0: _mcAborting Specify the behavior Selection BUFFER_ when executing more 1: _mcBuffered MODE...
  • Page 559: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When positioning is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 560: Mc_Movecircular2D

    4 Axes Group Instructions MC_MoveCircular2D The MC_MoveCircular2D instruction performs circular interpolation for two axes. Instruction Name Graphic expression ST expression MC_MoveCircular2D Circular 2D MC_MoveCircular2D_instance ( MC_MoveCircular2D_instance Interpolation AxesGroup :=parameter, MC_MoveCircular2D Execute :=parameter, AxesGroup AxesGroup CircAxes :=parameter, Execute Done CircMode :=parameter, CircAxes Busy AuxPoint :=parameter,...
  • Page 561 4 Axes Group Instructions Name Meaning Data type Valid range Default Description AuxPoint Auxiliary ARRAY [0,1] OF Negative number, positive number, Specify the border Point LREAL or 0 point, center, or radius. The unit is command units. EndPoint End Point ARRAY [0,1] OF Negative number, positive number, Specify the target...
  • Page 562 4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or TRUE when the instruction is completed. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE Active Controlling BOOL TRUE or TRUE when the axes group is being controlled.
  • Page 563: Function

    4 Axes Group Instructions Function • The MC_MoveCircular2D instruction performs 2D circular interpolation for two axes. Precautions for Correct Use Precautions for Correct Use • An Instruction Execution Error with Undefined Home (error code: 5466 hex) occurs if home is undefined for any of the composition axes in the axes group.
  • Page 564 4 Axes Group Instructions • Turn ON the Servo for the composition axes of the axes group, and then define home for each of the composition axes. • Execute MC_GroupEnable (Enable Axes Group) instruction to enable the registered axes group. Using the Circular Interpolation instruction is now enabled.
  • Page 565 4 Axes Group Instructions Circular Interpolation Method: Border Point Specification Circular Interpolation Method: Border Point Specification with Absolute Positioning with Relative Positioning AuxPoint(X, Y) AuxPoint(X, Y) EndPoint(X, Y) EndPoint(X, Y) Start point Start point The following sections describe the operation assuming that absolute positioning has been specified as the MoveMode (Travel Mode).
  • Page 566 4 Axes Group Instructions If the start point and the end point are the same point, a complete circle is drawn with the start point and the AuxPoint(X, Y) border point as the diameter. PathChoice is specified as the circular interpolation direction. Start point, EndPoint(X, Y) Center The current position is the starting point.
  • Page 567 4 Axes Group Instructions Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Deceleration Rate), and Jerk Set Velocity, Acceleration, Deceleration, and Jerk to specify the interpolation velocity, acceleration rate, deceleration rate, and jerk for circular interpolation. If you set the interpolation velocity for circu- lar interpolation to 0, a velocity specification error will occur and operation will stop for all axes in the group.
  • Page 568 4 Axes Group Instructions Jerk The relationships between Acceleration (Acceleration Rate), Deceleration (Deceleration Rate), and Velocity (Target Velocity) when Jerk is set to 0 and when it is set to any other value are shown below. • Jerk Set to 0 The command value for the velocity is created with acceleration rate At and deceleration rate Dt.
  • Page 569 4 Axes Group Instructions • Jerk Set to Value Other Than 0 The command value for the velocity is created with At as the upper acceleration limit and Dt as the upper deceleration limit. Interpolation velocity Time Acceleration rate Time Deceleration rate Jerk Time...
  • Page 570 4 Axes Group Instructions Precautions for Correct Use Precautions for Correct Use • If 0 is specified for Acceleration (Acceleration Rate), the specified interpolation velocity is used immediately. • If 0 is specified for Deceleration (Deceleration Rate), the axis stops immediately. However, if the Buffer Mode is set to Blending, axis operation will change to the interpolation velocity spec- ified by the next operation without stopping.
  • Page 571 4 Axes Group Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted, and all axes in the circular interpolation motion stop. Execute Done Busy Active...
  • Page 572: Sample Programming

    4 Axes Group Instructions Sample Programming This section shows sample programming for circular interpolation with multi-execution of instructions. Parameter Settings The minimum settings required for this sample programming are given below. Setting Axis Parameters Axis Types Axis Axis Type Axis 1 Servo axis Axis 2 Servo axis...
  • Page 573 4 Axes Group Instructions Operation Pattern Axis 2 (mm) 20.00 15.00 10.00 5.00 Axis 1 (mm) 10.00 15.00 20.00 Execution When you turn ON the operation start switch at home, the axes move to the point (10.00 mm, 5.00 mm) via linear interpolation. Continuous Motion The axes continue to move to the point (15.00 mm, 10.00 mm) via circular interpolation, to the point (15.00 mm, 15.00 mm) via linear interpolation, and to the point (20.00 mm, 20.00 mm) via...
  • Page 574 4 Axes Group Instructions Name Data type Default Comment Pwr2_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR2 instance of the MC_Power instruction. This variable changes to TRUE when the Servo is turned ON. StartPg BOOL FALSE...
  • Page 575 4 Axes Group Instructions Sample Programming If StartPg is TRUE, EtherCAT communications for the axes are checked to see if process data communications are normal. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] If process data communications are active, the Servo is turned ON. PWR1 MC_Power Pwr1_Status...
  • Page 576 4 Axes Group Instructions After home is defined for axis 1 and axis 2, the axes group is enabled. GRP_EN MC_GroupEnable Grp_En_D MC_Group000 AxesGroup AxesGroup Hm1_D Hm2_D Execute Done MC_Group000.Status.Disabled Busy Grp_En_Bsy CommandAborted Grp_En_Ca Error Grp_En_Err ErrorID Grp_En_ErrID The parameters are set for linear interpolation and circular interpolation. InitFlag Note: The contents of the inline ST are given below.
  • Page 577 4 Axes Group Instructions Linear interpolation (3) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_LIN2 MC_MoveLinear Mv_Lin2_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Execute Done Mv_Lin2_Pos Position Busy Mv_Lin2_Bsy Mv_Lin2_Vel Velocity Active Mv_Lin2_Act Mv_Lin2_Acc Acceleration CommandAborted Mv_Lin2_Ca Mv_Lin2_Dec Deceleration Error...
  • Page 578 4 Axes Group Instructions Mv_Circ2_Dec := LREAL#20.0; Mv_Circ2_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Circ2_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN1 parameters Mv_Lin1_Pos[0] := LREAL#10.0; Mv_Lin1_Pos[1] := LREAL#5.0; Mv_Lin1_Vel := LREAL#100.0; Mv_Lin1_Acc := LREAL#20.0; Mv_Lin1_Dec := LREAL#20.0; Mv_Lin1_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN2 parameters Mv_Lin2_Pos[0] := LREAL#15.0; Mv_Lin2_Pos[1] := LREAL#15.0;...
  • Page 579 4 Axes Group Instructions Name Data type Default Comment InitFlag BOOL FALSE This variable indicates if it is necessary to set the input parameters. Input parameters are set when this variable is FALSE. When setting the input parameters is completed, this variable changes to TRUE.
  • Page 580 4 Axes Group Instructions Mv_Lin1_Dec := LREAL#20.0; Mv_Lin1_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN2 parameters Mv_Lin2_Pos[0] := LREAL#15.0; Mv_Lin2_Pos[1] := LREAL#15.0; Mv_Lin2_Vel := LREAL#100.0; Mv_Lin2_Acc := LREAL#20.0; Mv_Lin2_Dec := LREAL#20.0; Mv_Lin2_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin2_Mm := _eMC_MOVE_MODE#_mcAbsolute; // Change InitFlag to TRUE after setting the input parameters. InitFlag := TRUE;...
  • Page 581 4 Axes Group Instructions // The rest of the instructions are executed with multi-execution of instructions when the Active output variable for linear interpolation (1) changes to TRUE. IF Mv_Lin1_Act=TRUE THEN Mv_Circ1_Ex:=TRUE; Mv_Lin2_Ex:=TRUE; Mv_Circ2_Ex:=TRUE; END_IF; // MC_Power for axis 1 PWR1( Axis := MC_Axis000,...
  • Page 582 4 Axes Group Instructions AxesGroup := MC_Group000, Execute := Mv_Lin1_Ex, Position := Mv_Lin1_Pos, Velocity := Mv_Lin1_Vel, Acceleration := Mv_Lin1_Acc, Deceleration := Mv_Lin1_Dec, MoveMode := Mv_Lin1_Mm, Done => Mv_Lin1_D, Busy => Mv_Lin1_Bsy, Active => Mv_Lin1_Act, CommandAborted => Mv_Lin1_Ca, Error => Mv_Lin1_Err, ErrorID =>...
  • Page 583 4 Axes Group Instructions Acceleration := Mv_Circ2_Acc, Deceleration := Mv_Circ2_Dec, BufferMode := Mv_Circ2_Bm, MoveMode := Mv_Circ2_Mm, Done => Mv_Circ2_D, Busy => Mv_Circ2_Bsy, Active => Mv_Circ2_Act, CommandAborted => Mv_Circ2_Ca, Error => Mv_Circ2_Err, ErrorID => Mv_Circ2_ErrID NY-series Motion Control Instructions Reference Manual (W561) 4-65...
  • Page 584: Mc_Groupstop

    4 Axes Group Instructions MC_GroupStop The MC_GroupStop instruction decelerates all of the axes in an interpolated motion to a stop. Instruction Name Graphic expression ST expression MC_GroupStop Group Stop MC_GroupStop_instance ( MC_GroupStop_instance AxesGroup :=parameter, MC_GroupStop Execute :=parameter, AxesGroup AxesGroup Deceleration :=parameter, Execute Done Jerk :=parameter,...
  • Page 585 4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or FALSE TRUE when the instruction is completed. Busy Executing BOOL TRUE or FALSE TRUE when the instruction is acknowledged. Active Controlling BOOL TRUE or FALSE TRUE when the axes group is being controlled.
  • Page 586: Function

    4 Axes Group Instructions Function • This instruction stops all of the axes that are in motion for an axes group instruction (i.e., all of the axes in the axes group that is specified with AxesGroup), and then disables the axes group instruc- tion.
  • Page 587 4 Axes Group Instructions • Jerk Set to Value Other Than 0 The command value for the velocity is created based on the current velocity with Dt as the upper limit to the deceleration rate. Interpolation velocity Time Time Deceleration rate Jerk Time Vt: Velocity when deceleration starts, Dt: Specified deceleration rate, Jt: Specified jerk...
  • Page 588 4 Axes Group Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • Done changes to TRUE when a velocity of 0 is reached. •...
  • Page 589 4 Axes Group Instructions Re-execution of Motion Control Instructions The deceleration rate changes if Execute changes to TRUE again while this instruction is being exe- cuted. The Jerk setting is not changed when a motion control instruction is re-executed. Jerk Set to Value Other Than 0 The velocity command value is created with Dt2 as the upper limit of the deceleration rate after it has changed based on the actual velocity and actual deceleration rate.
  • Page 590 4 Axes Group Instructions When the Status.Stopping (Axes Group Deceleration Stopping) in the Axes Group Variable Is TRUE Status.Stopping (Deceleration Stopping) in the Axis Variable changes to TRUE in the following cases. • While the axes group is decelerating for the MC_GroupStop Instruction •...
  • Page 591 4 Axes Group Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axes will stop. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Previous Instruction: MC_MoveLinear Execute Done...
  • Page 592 4 Axes Group Instructions Version Information Operation when an error is reset depends on the unit version of the CPU Unit as follows: Note that you must reset errors only after the axis has stopped. Do not reset errors during axis motion.
  • Page 593: Mc_Groupimmediatestop

    4 Axes Group Instructions MC_GroupImmediateStop The MC_GroupImmediateStop instruction stops all axes in an interpolated motion. If the specified axes group is enabled, all of the composition axes are stopped according to the stop mode that is specified in Immediate Stop Input Stop Method Selection regardless of the current status of the axes.
  • Page 594: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the immediate stop is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 595 4 Axes Group Instructions Timing Charts • Busy (Executing) changes to TRUE when Execute changes to TRUE. • Done changes to TRUE when processing of this instruction is completed. MC_MoveLiner Instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_GroupImmediateStop Instruction Execute Done Busy...
  • Page 596 4 Axes Group Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted, and the axis stops. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 597: Mc_Groupsetoverride

    4 Axes Group Instructions MC_GroupSetOverride The MC_GroupSetOverride instruction changes the combined target velocity during an interpolated motion. Instruction Name Graphic expression ST expression MC_GroupSetOverride Set Group MC_GroupSetOverride_ MC_GroupSetOverride_instance Overrides instance ( MC_GroupSetOverride AxesGroup :=parameter, AxesGroup AxesGroup Enable :=parameter, Enable Enabled VelFactor :=parameter, VelFactor Busy...
  • Page 598: Function

    4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description Enabled Enabled BOOL TRUE or TRUE when the axes group is being controlled. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE Error Error BOOL TRUE or...
  • Page 599 4 Axes Group Instructions • If an axes group error occurs during MC_GroupSetOverride execution, the value of Enabled for MC_GroupSetOverride is maintained. Precautions for Correct Use Precautions for Correct Use When Enable to this instruction changes to FALSE, Enabled and Busy from this instruction change to FALSE.
  • Page 600 4 Axes Group Instructions Re-execution of Motion Control Instructions You cannot re-execute enable-type motion control instructions. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 601: Mc_Groupreadposition

    4 Axes Group Instructions MC_GroupReadPosition The MC_GroupReadPosition instruction gets the command current positions and the actual current positions of an axes group. Instruction Name FB/FUN Graphic expression ST expression MC_GroupRead Read Axes MC_GroupReadPosition_instance ( MC_GroupReadPosition_instance Position Group AxesGroup :=parameter, MC_GroupReadPosition Position Enable :=parameter, AxesGroup...
  • Page 602 4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description Valid Enabled BOOL TRUE or TRUE when the axis group is being controlled. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE Error Error BOOL TRUE or...
  • Page 603: Function

    4 Axes Group Instructions Function • While Valid (Enabled) is TRUE, the MC_GroupReadPosition instruction gets the command current positions and the actual current positions of the composition axes in the axes group each control period. • The following table lists the position types that can be used for each axis type. Types of positions Axis type Command current position...
  • Page 604 4 Axes Group Instructions Multi-execution of Motion Control Instructions This instruction is executed independently from other instructions. The restrictions for multi-execution of instructions do not apply. For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 605: Mc_Changeaxesingroup

    4 Axes Group Instructions MC_ChangeAxesInGroup The MC_ChangeAxesInGroup instruction temporarily changes the Composition Axes axes group parameter. Instruction Name FB/FUN Graphic expression ST expression MC_Change Change MC_ChangeAxesInGroup_instance ( MC_ChangeAxesInGroup_instance AxesInGroup Axes in AxesGroup :=parameter, MC_ChangeAxesInGroup Group Axes :=parameter, AxesGroup AxesGroup Execute :=parameter, Axes Axes Done =>parameter,...
  • Page 606 4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description Done Done BOOL TRUE or TRUE when instruction execution is completed. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE CommandAborted Instruction BOOL TRUE or TRUE when the instruction is aborted.
  • Page 607: Function

    4 Axes Group Instructions Function • When Execute changes to TRUE, the MC_ChangeAxesInGroup instruction writes the composition axes that are specified in Axes (Axes Group Composition Axes) to the Axes Group parameter for the axes group that is specified in AxesGroup (Axes Group). •...
  • Page 608 4 Axes Group Instructions MC_ChangeAxesInGroup Instruction Execute Done Busy CommandAborted Error 16#0000 ErrorID Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 609: Mc_Groupsyncmoveabsolute

    4 Axes Group Instructions MC_GroupSyncMoveAbsolute The MC_GroupSyncMoveAbsolute instruction cyclically outputs the specified target positions for the axes. Instruction Name FB/FUN Graphic expression ST expression MC_GroupSyn- Axes Group MC_GroupSyncMoveAbsolute MC_GroupSyncMoveAbsolute_instance cMoveAbsolute Cyclic Syn- _instance ( MC_GroupSyncMoveAbsolute chronous AxesGroup :=parameter, AxesGroup AxesGroup Absolute Execute :=parameter, Execute...
  • Page 610 4 Axes Group Instructions Output Variables Name Meaning Data type Valid range Description InPosition In Position BOOL TRUE or TRUE when the actual current positions for all composi- FALSE tion axes are within the in-position range of their target positions. Busy Executing BOOL...
  • Page 611: Function

    4 Axes Group Instructions Function • The MC_GroupSyncMoveAbsolute instruction outputs the target position from the user program every task period to the Servo Drive or other device in Cyclic Synchronous Position (CSP) Control Mode. The target positions are given as absolute positions. •...
  • Page 612 4 Axes Group Instructions Instruction Details This section describes the instruction in detail. In-position Check If Position (Target Position) is not changed, InPosition changes to TRUE when the difference between the target position and the actual position is within the range that is set for the In-position Range axis parameter.
  • Page 613 4 Axes Group Instructions Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Con- trolling) changes to TRUE in the next period. • InPosition changes to TRUE when the actual current positions for all composition axes are within the in-position range from Positions (Target Positions).
  • Page 614 4 Axes Group Instructions Re-execution of Motion Control Instructions This instruction cannot be re-executed. A Motion Control Instruction Re-execution Disabled error (error code: 543B hex) occurs if re-execution is attempted. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat.
  • Page 615: Mc_Groupreset

    4 Axes Group Instructions MC_GroupReset The MC_GroupReset instruction clears axes group errors and axis errors. Instruction Name FB/FUN Graphic expression ST expression MC_GroupReset Group Reset MC_GroupReset_instance ( MC_GroupReset_instance AxesGroup :=parameter, MC_GroupReset Execute :=parameter, AxesGroup AxesGroup Done =>parameter, Execute Done Busy =>parameter, Busy Failure =>parameter, Failure...
  • Page 616: Function

    4 Axes Group Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When error clear processing is completed nor- • When Execute is TRUE and changes to mally. FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 617 • After you remove the cause of the error, execute the instruction only after you confirm that the axes have stopped completely. • If you use this instruction for an OMRON G5-series Servo Drive, perform exclusive control of instructions so that the ResetECError (Reset EtherCAT Error) instruction is not executed at the same time.
  • Page 618 4 Axes Group Instructions Aborting the Instruction The instruction is aborted if it is not possible to clear errors that occur when the axes group is decelerat- ing to a stop for an error or errors that occur during axes group errors resulting from axis common errors.
  • Page 619 4 Axes Group Instructions Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561) 4-101...
  • Page 620 4 Axes Group Instructions 4-102 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 621: Common Command Instructions

    Common Command Instructions This section describes the instructions that are used for both axes and axes groups. MC_SetCamTableProperty ........5-2 MC_SaveCamTable .
  • Page 622: Mc_Setcamtableproperty

    5 Common Command Instructions MC_SetCamTableProperty The MC_SetCamTableProperty instruction changes the end point index of the cam table that is speci- fied in an in-out parameter. Instruction Name Graphic expression ST expression MC_SetCamTableProperty Set Cam MC_SetCamTableProperty_ MC_SetCamTableProperty_instance Table Prop- instance ( MC_SetCamTableProperty erties CamTable :=parameter,...
  • Page 623: Function

    5 Common Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When overwriting cam table data is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 624 5 Common Command Instructions Precautions for Correct Use Precautions for Correct Use • When searching the cam table, an error will occur if the phases are not in ascending order before the 0 phase is found. • You cannot change the maximum number of cam data from the user program. •...
  • Page 625 5 Common Command Instructions The following tables show the relationship between overwriting of the cam data and the EndPointIndex. If this instruction is executed with a cam table in which the phases for MyCam1[1000] on are 0, End- PointIndex will be 999. If this instruction is executed for a cam table after the phase for MyCam1[997] is changed to 0, End- PointIndex will be 996.
  • Page 626 5 Common Command Instructions If this instruction is executed for a cam table after the phases for MyCam1[1000] to MyCam1[4997] are changed anything other than 0, EndPointIndex will be 4997. Cam data structure array Displacement Phase Phase Displacement MyCam1 [0] MyCam1 [998] 359.9 100.3...
  • Page 627 5 Common Command Instructions Multi-execution of Motion Control Instructions Execution during Execution of Other Instructions Multi-execution of instructions cannot be used for this instruction if the cam table specified by Cam- Table is used by another instruction such as MC_SaveCamTable, MC_SetCamTableProperty, or MC_GenerateCamTable Execution of Other Instructions during Instruction Execution Multi-execution of instructions cannot be used for other instructions such as MC_SaveCamTable,...
  • Page 628: Mc_Savecamtable

    5 Common Command Instructions MC_SaveCamTable The MC_SaveCamTable instruction saves the cam table specified with the input parameter to non-vola- tile memory. Instruction Name Graphic expression ST expression MC_SaveCamTable Save Cam MC_SaveCamTable_instance ( MC_SaveCamTable_instance Table CamTable :=parameter, MC_SaveCamTable Execute :=parameter, CamTable CamTable Done =>parameter, Execute...
  • Page 629: Function

    5 Common Command Instructions In-Out Variables Name Meaning Data type Valid range Description CamTable Cam Table ARRAY[0..N] OF Specify the start of a cam data structure _sMC_- _sMC_CAM_REF CAM_REF array variable as the cam table. * N in the array variable is set automatically by the Sysmac Studio. Specify a cam data variable that was created on Cam Edi- tor of the Sysmac Studio.
  • Page 630 5 Common Command Instructions * Online edits are saved from when you click the Yes Button in the confirmation dialog box until the Online Editing Pane closes (for a CPU Unit with unit version 1.04 or later and Sysmac Studio version 1.05 or higher, saving continues until the dialog box that indicates saving data to built-in non-volatile memory closes).
  • Page 631 5 Common Command Instructions Execution of Other Instructions during Instruction Execution Multi-execution of instructions cannot be used for other instructions, such as MC_SetCam- TableProperty, if the same cam table is specified with CamTable for this instruction. This instruction also cannot be executed during execution of another instance of this instruction. Errors If an error occurs during instruction execution, Error will change to TRUE.
  • Page 632: Mc_Write

    5 Common Command Instructions MC_Write The MC_Write instruction writes parts of the motion control parameters in the MC Function Module. Instruction Name FB/FUN Graphic expression ST expression MC_Write Write MC MC_Write_instance ( MC_Write_instance Setting Target :=parameter, MC_Write SettingValue :=parameter, Target Target Execute :=parameter, SettingValue...
  • Page 633: Variables

    5 Common Command Instructions Variables Input Variables Name Meaning Data type Valid range Default Description Execute Execute BOOL TRUE or FALSE FALSE The instruction is executed when Execute changes to TRUE. Parameter Parameter _eMC_ 0: _mcChkVel Specify the parameter to write. Number Number PARAMETER_...
  • Page 634 5 Common Command Instructions Parameter Data Types and Valid Ranges Data Parameter Valid range Comments type Velocity Warning UINT 0 to 100 The unit is %. Value/Interpola- tion Velocity Warning Value Acceleration UINT 0 to 100 The unit is %. Warning Value/Interpola- tion Acceleration...
  • Page 635: Function

    5 Common Command Instructions Output Variable Update Timing Name Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. • When Execute is TRUE and changes to FALSE. • After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 636 5 Common Command Instructions Precautions for Correct Use Precautions for Correct Use The values that are written by this instruction are not saved in non-volatile memory in the CPU Unit. Any values that are written are lost when the power supply to the Controller is turned OFF, when settings are downloaded, or when the MC Function Module is restarted.
  • Page 637 5 Common Command Instructions Timing Chart When Error Occurs Execute Done Busy CommandAborted Error ErrorID Error code Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561) 5-17...
  • Page 638: Mc_Generatecamtable

    5 Common Command Instructions MC_GenerateCamTable The MC_GenerateCamTable instruction creates a cam table for the cam properties and cam nodes specified in the I/O parameters. Instruction Name Graphic expression ST expression MC_GenerateCam- Generate MC_GenerateCamTable_instance MC_GenerateCamTable_instance Table Cam Table (CamTable :=parameter, CamProperty :=parameter, MC_GenerateCamTable CamTable CamTable...
  • Page 639 5 Common Command Instructions Output Variables Data Name Meaning Valid range Description type Done Done BOOL TRUE or TRUE when the instruction is completed. FALSE EndPointIndex End Point UINT Non-negative Contains the cam table end point index after the instruc- Index number tion is executed.
  • Page 640 5 Common Command Instructions In-Out Variables Valid Name Meaning Data type Description range CamTable Cam Table ARRAY[0..N] OF Specify an array variable of _sMC_CAM_REF cam _sMC_CAM_REF data structure as the cam table. Specify a cam data variable that was created on the Cam Editor of the Sysmac Studio.
  • Page 641: Function

    5 Common Command Instructions Function • The MC_GenerateCamTable instruction calculates cam data based on CamProperty (Cam Proper- ties) and CamNodes (Cam Nodes) that are specified for the in-out variables when Execute changes to TRUE. • The calculated cam data values are written to CamTable specified for the in-out variable. •...
  • Page 642 5 Common Command Instructions Precautions for Correct Use Precautions for Correct Use • Set the maximum number of cam data to a value that is equal to or higher than the number of data in the cam table that will be created by the instruction. •...
  • Page 643: Common Command Instructions I

    5 Common Command Instructions Additional Information • You can check the maximum number of cam data in the cam table with the data type of the global variable on the Sysmac Studio or by executing the SizeOfAry (Get Number of Array Ele- ments) instruction in the user program.
  • Page 644 5 Common Command Instructions Instruction Details This section describes the instruction in detail. Cam Property Structure (_sMC_CAM_PROPERTY Data Type) The cam property structure (_sMC_CAM_PROPERTY) is used to specify the properties. Some of the members correspond to the cam table properties that are set with the Cam Editor of the Sysmac Studio. This cam property structure is used for the CamProperty (Cam Properties) in-out variable that is speci- fied for this instruction.
  • Page 645 5 Common Command Instructions Element No. Phase (Master Axis Phase) Positive number Valid nodes Positive number Any value Invalid nodes Any value Specify the values of Phase (Master Axis Phase) so that they increase in the order of the array element numbers.
  • Page 646 5 Common Command Instructions Name Meaning Data type Valid range Description ConnectingAc- Connecting BOOL TRUE or FALSE Set to TRUE to enable the specified con- cEnable Acceleration necting acceleration when the specified Enable curve shape is polynomic 5. Set to FALSE to disable the connecting acceleration.
  • Page 647 5 Common Command Instructions Distance (Displace- Element No. Phase (Phase) ment) 1801 (Undefined) (Undefined) 3599 (Undefined) (Undefined) 3600 (Undefined) (Undefined) 3601 (Undefined) (Undefined) 3999 (Undefined) (Undefined) Next, we describe the sequence of changes that occur in the cam data variable as the instruction is executed.
  • Page 648 5 Common Command Instructions Distance (Displace- Element No. Phase (Phase) ment) 3601 (Undefined) (Undefined) 3999 (Undefined) (Undefined) In the same way, the number of cam data and the phase and displacement for each cam data are calcu- lated between node points according to the specified values for element 1 in CamNodes. The number of cam data calculates as 1,800, so the phases and displacements of element 1801 to 3600 are written to the cam data variable.
  • Page 649 5 Common Command Instructions Distance (Displace- Element No. Phase (Phase) ment) 1799 179.9 179.9 1800 180.0 180.0 1801 180.1 179.9 3599 359.9 3600 360.0 The number of the last element in the cam data variable that was written is output to the EndPointIndex output variable of the instruction as the end point index.
  • Page 650 5 Common Command Instructions − When (P ) / pitch is not an integer, final phase P final P phase – ⎛ ⎞ ------------------------------------------- - floor ⎝ ⎠ pitch ⋅ V init T -------------------------------------- - d final d init – ⋅...
  • Page 651 5 Common Command Instructions d final of element m+1 d init of element m+1 – ⋅ ------------------------------------------------------------------------------------------------------------------------------ - ------------------------------ - V fin P final of element m+1 P init of element m+1 CycleTime – • Curve (Curve Shape) of element m+1 in CamNodes is not a straight line (_mcStraightLine) Displacement Calculation Method for Polynomic 5 The element number in the array variable specified for CamNodes is “m.”...
  • Page 652 5 Common Command Instructions ⎛ ⎞ ⋅ ⋅ ⎜ -------------------------------------- - ⎟ A init A fin 6V fin 6V init -------------------------------------- - 12 – – – d final d init ⎝ ⎠ – – final init ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- P final P init –...
  • Page 653 5 Common Command Instructions Timing Charts Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. _MC_COM.Sta- tus.GenerateCamBusy (Cam Table Creation Busy) changes to TRUE in the next period. Execute Done Busy CommandAborted Error ErrorID 16#0000 _MC_COM.Status.GenerateCamBusy Re-execution of Motion Control Instructions This instruction cannot be re-executed.
  • Page 654 5 Common Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Depending on ErrorID (Error Code), attached information is output to ErrorParameterCode (Parameter Detail Code) and ErrorNodePointIndex (Node Point Element Number).
  • Page 655: Sample Programming

    5 Common Command Instructions Sample Programming This sample programming writes data to a cam data variable in the cam table that was created on Cam Editor of the Sysmac Studio. Parameter Settings The minimum settings required for this sample programming are given below. Axis Parameters Axis Type Axis...
  • Page 656 5 Common Command Instructions Data That Is Written This section describes the initial values of the cam property variable and cam node variable that were created in advanced with the Cam Editor of the Sysmac Studio and the values that are written with this sample programming.
  • Page 657 5 Common Command Instructions Ladder Diagram Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis MC_Axis001 _sAXIS_REF Axis Variable for the slave axis, axis 2. CamProfile0 ARRAY[0..36000] OF This is the cam data variable. _sMC_CAM_REF The cam data variable is created in advance on the Cam Editor of the...
  • Page 658 5 Common Command Instructions Timing Charts WriteCamDefinition WriteCamDefinitionDone _MC_COM.Status.GenerateCamBusy Command current position for master axis (axis 1) Command current position for slave axis (axis 2) Gene_D Gene_EPI 36000 Gene_Bsy Gene_Ca Gene_Err CamIn_InCam CamIn_Bsy CamIn_Act CamIn_Ca CamIn_Err 5-38 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 659 5 Common Command Instructions Sample Programming If StartPg input is TRUE, EtherCAT communications are checked to see if process data communications are normal for each axis. Lock1 StartPg _EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress] Lock2 _EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress] If process data communications are active, the Servos are turned ON for both axes. PWR1 MC_Power Pwr1_Status...
  • Page 660 5 Common Command Instructions After homing is completed for the master axis (axis 1), the MC_MoveVelocity (Velocity Control) instruction is executed. MC_MoveVelocity Vel_InVel MC_Axis000 Axis Axis Hm1_D Execute InVelocity LREAL#90.0 Velocity Busy Vel_Bsy LREAL#90.0 Acceleration Active Vel_Act LREAL#90.0 Deceleration CommandAborted Vel_Ca LREAL#0.0 Jerk...
  • Page 661 5 Common Command Instructions Contents of Inline ST CamProperty0.CycleTime := REAL#0.800; CamNode0[0].Curve := _eMC_CAM_CURVE#_mcPolynomic5; CamNode0[0].ConnectingVelEnable := FALSE; CamNode0[0].ConnectingVel := REAL#0.000; CamNode0[0].ConnectingAccEnable := FALSE; CamNode0[0].ConnectingAcc := REAL#0.000; CamNode0[1].Phase := REAL#200.000; CamNode0[1].Distance := REAL#-102.000; CamNode0[1].Curve := _eMC_CAM_CURVE#_mcStraightLine; CamNode0[1].ConnectingVelEnable := FALSE; CamNode0[1].ConnectingVel := REAL#0.000; CamNode0[1].ConnectingAccEnable := FALSE;...
  • Page 662 5 Common Command Instructions Structured text (ST) Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF Axis Variable for the master axis, axis MC_Axis001 _sAXIS_REF Axis Variable for the slave axis, axis 2. CamProfile0 ARRAY[0..36000] OF This is the cam data variable. _sMC_CAM_REF The cam profile curve is created in advance on the Cam Editor of the Sys-...
  • Page 663 5 Common Command Instructions Timing Charts WriteCamDefinition WriteCamDefinitionDone _MC_COM.Status.GenerateCamBusy Command current position for master axis (axis 1) Command current position for slave axis (axis 2) Gene_Exe Gene_D Gene_EPI 36000 Gene_Bsy Gene_Ca Gene_Err CamIn_Exe CamIn_InCam CamIn_Bsy CamIn_Act CamIn_Ca CamIn_Err Sample Programming If StartPg is TRUE, EtherCAT communications are checked for normal communications.
  • Page 664 5 Common Command Instructions Pwr2_En:=FALSE; END_IF; If a minor fault level error occurs in the MC Common Error Status variable or for any of the axes, the error handler for the device (FaultHandler) is executed. The FaultHandler is programmed according to the device. IF (MC_Axis000.MFaultLvl.Active=TRUE) OR (MC_Axis001.MFaultLvl.Active=TRUE) OR (_MC_COM.MFaultLvl.Active=TRUE) THEN...
  • Page 665 5 Common Command Instructions Gene_Exe := TRUE; END_IF; If cam table creation processing is completed and the master axis (axis 1) has reached the target velocity, the MC_CamIn (Start Cam Operation) instruction is executed. IF (Gene_D=TRUE) AND(_MC_COM.Status.GenerateCamBusy = FALSE) AND (Vel_InVel=TRUE) THEN Camin_Ex := TRUE;...
  • Page 666 5 Common Command Instructions CommandAborted => Hm2_Ca, Error => Hm2_Err, ErrorID => Hm2_ErrID //MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, Direction := Vel_Dir, InVelocity => Vel_InVel, Busy => Vel_Bsy, Active =>...
  • Page 667: Mc_Writeaxisparameter

    5 Common Command Instructions MC_WriteAxisParameter The MC_WriteAxisParameter instruction writes axis parameters in the MC Function Module. Instruction Name Graphic expression ST expression MC_WriteAxis- Write Axis MC_WriteAxisParameter_instance MC_WriteAxisParameter_instance Parameter Parameters (Axis :=parameter, MC_WriteAxisParameter AxisParameter :=parameter, Axis Axis Execute :=parameter, AxisParameter AxisParameter Done =>parameter, Execute Done...
  • Page 668 5 Common Command Instructions Data Name Meaning Valid range Description type Error Error BOOL TRUE or TRUE while there is an error. FALSE ErrorID Error Code WORD Contains the error code when an error occurs. A value of 16#0000 indicates normal execution. ErrorParameterCode Parameter WORD...
  • Page 669: Function

    5 Common Command Instructions Function • When Execute changes to TRUE, the MC_WriteAxisParameter instruction writes the values specified in AxisParameter (Axis Parameters) to the axis parameters for the axis specified with Axis. • You can write data only when the specified axis is an unused axis. If the instruction is executed for any other condition, an execution error occurs and the axis parameters are not written.
  • Page 670 5 Common Command Instructions • An example that uses this instruction with the MC_ChangeAxisUse (Change Axis Use) instruction is given. Execute this instruction only after confirming that Done from the MC_ChangeAxisUse (Change Axis Use) instruction changes to TRUE. MC_WriteAxisParameter MC_ChangeAxisUse Axis Axis AxisParameter...
  • Page 671 5 Common Command Instructions _sAXIS_UNIT_CONVERSION_SETTINGS (Unit Conversion Settings) The _sAXIS_UNIT_CONVERSION_SETTINGS structure data type is used to specify the values of the unit conversion settings in the axis parameters. Each member is described in the following table. Parameter Member Data type Valid range Description name...
  • Page 672 5 Common Command Instructions _sAXIS_OPERATION_SETTINGS (Operation Settings) The _sAXIS_OPERATION_SETTINGS structure data type is used to specify the values of axis param- eter operation settings. Each member is described in the following table. Parameter Member Data type Valid range Description name MaxVel Maximum LREAL...
  • Page 673 5 Common Command Instructions Parameter Member Data type Valid range Description name DecWarningVal Deceleration UINT 0 or 1 to 100 Set the percentage of the maximum Warning Value deceleration rate at which to output a deceleration warning for the axis. No deceleration warning is output if 0 is set.
  • Page 674 5 Common Command Instructions _sAXIS_OTHER_OPERATION_SETTINGS (Other Operation Settings) The _sAXIS_OTHER_OPERATION_SETTINGS structure data type is used to specify the values of other axis parameter operation settings. Each member is described in the following table. Parameter Member Data type Valid range Description name ImmediateStop Immediate Stop...
  • Page 675 5 Common Command Instructions _sAXIS_LIMIT_SETTINGS (Limit Settings) The _sAXIS_LIMIT_SETTINGS structure data type is used to specify the values of the limit settings in the axis parameters. Each member is described in the following table. Parameter Member Data type Valid range Description name SwLimitMode...
  • Page 676 5 Common Command Instructions _sAXIS_HOMING_SETTINGS (Homing Settings) The _sAXIS_HOMING_SETTINGS structure data type is used to specify the values of the homing set- tings in the axis parameters. Each member is described in the following table. Parameter Member Data type Valid range Description name Mode...
  • Page 677 5 Common Command Instructions Parameter Member Data type Valid range Description name Homing Accel- LREAL Non-negative long reals Set the acceleration rate for homing. eration If the homing acceleration is set to 0, the homing velocity or other target velocity is used without any accelera- tion.
  • Page 678 5 Common Command Instructions Axis Parameters That Are Written and Read The axis parameters that you can write with this instruction are given in the following table. The same axis parameters can be read with the MC_ReadAxisParameter (Read Axis Parameter) instruction.
  • Page 679 5 Common Command Instructions OK: Can be read and written. Axis parameter type Axis parameter name ---: Cannot be read and written. Other Operation Settings Immediate Stop Input Stop Method Limit Input Stop Method Drive Error Reset Monitoring Time Maximum Positive Torque Limit Maximum Negative Torque Limit Immediate Stop Input Logic Inversion Positive Limit Input Logic Inversion...
  • Page 680 5 Common Command Instructions *2 If ReducerUse of an axis for which to write a parameter is set to Used and the Count Mode of the axis is Rotary Mode, the value of Work Travel Distance Per Rotation is not written. The value of Work Travel Distance Per Rotation is determined by subtracting the modulo minimum position from the modulo maximum position.
  • Page 681 5 Common Command Instructions Errors If an error occurs during instruction execution, Error will change to TRUE and the axis parameters are not written. The values before the instruction was executed will be held. You can find out the cause of the error by referring to the value output by ErrorID (Error Code). Depend- ing on ErrorID (Error Code), attached information is output to ErrorParameterCode (Parameter Detail Code).
  • Page 682: Mc_Readaxisparameter

    5 Common Command Instructions MC_ReadAxisParameter The MC_ReadAxisParameter instruction reads axis parameters in the MC Function Module. Instruction Name Graphic expression ST expression MC_ReadAxisPa- Read Axis MC_ReadAxisParameter ( MC_ReadAxisParameter_instance rameter Axis :=parameter, Parameters MC_ReadAxisParameter AxisParameter :=parameter, Axis Axis Execute :=parameter, AxisParameter AxisParameter Done =>parameter, Execute...
  • Page 683 5 Common Command Instructions Output Variable Update Timing Variables Timing for changing to TRUE Timing for changing to FALSE Done When the instruction is completed. When Execute is TRUE and changes to FALSE. After one period when Execute is FALSE. Busy When Execute changes to TRUE.
  • Page 684: Function

    5 Common Command Instructions Function • When Execute changes to TRUE, the MC_ReadAxisParameter instruction reads the axis parameters of the axis specified with Axis and outputs them to AxisParameter (Axis Parameters). • You can use this instruction to read the axis parameters regardless of the status of the Cfg.AxEnable (Axis Use) axis variable.
  • Page 685 5 Common Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507) or NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 686 5 Common Command Instructions 5-66 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 687: Appendices

    Appendices The appendices describe the error codes that are generated by the instructions. A-1 Instructions for Which Multi-execution Is Supported ....A-2 A-1-1 Axis and Axes Group Status ........A-3 A-1-2 State Transitions and Instructions for which Multi-execution Is Supported .
  • Page 688: Instructions For Which Multi-Execution Is Supported

    Appendices Instructions for Which Multi- execution Is Supported Whether multi-execution of a motion control instruction is supported depends on the current axis status, the current axes group status, and the instruction to execute. This section describes the relationships between these. For details on multi-execution of instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 689: A-1-1 Axis And Axes Group Status

    Appendices Axis and Axes Group Status A-1-1 Whether multi-execution of a motion control instruction is supported depends on the current axis status and the current axes group status. You can use the Axis variable and the Axes Group variable of the rel- evant axis to find the axis status and the axes group status.
  • Page 690 Appendices Variables in an Axes Group Variable That Give the Axes Group Status The following five variables in an Axes Group variable give the status of the axes group. These variables are mutually exclusive. Only one of them can be TRUE at any one time. Name Data type Meaning...
  • Page 691: A-1-2 State Transitions And Instructions For Which Multi-Execution Is Supported

    Appendices A-1-2 State Transitions and Instructions for which Multi-execution Is Supported This section tells whether multi-execution of a motion control instruction is supported based on the axis status and the axes group status. It also gives how the axis status and axes group status change. For details on the state transitions for the MC Function Module and details on motion control instruc- tions in relation to state transitions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 692 Appendices Axis Command Instructions Axes group status before Axis status before instruction execution instruction execution Instruction MC_Power with Enable = TRUE MC_Power with Enable = FALSE MC_MoveJog MC_Home MC_HomeWithParameter MC_Move MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveZeroPosition MC_MoveFeed MC_Stop MC_ImmediateStop MC_SetPosition MC_SetOverride MC_ResetFollowingError MC_CamIn MC_CamOut MC_GearIn...
  • Page 693 Appendices *1 If Execute for MC_Stop is FALSE, the status will change to Stopping (B). If Execute is TRUE, the status will change to Deceleration Stopping (G). *2 The status will change to Stopping (d) or Deceleration Stopping (d) depending on the maximum deceleration rate.
  • Page 694 Appendices *1 If the servo is OFF, CommandAborted changes to TRUE. *2 The status changes as follows for the given conditions: If there is no error and the servo is OFF, the status will change to Axis Disabled (A). If Execute for MC_GroupStop is FALSE and the servo is OFF, the status will change to Stopping (B). If Execute for MC_GroupStop is TRUE and the servo is ON, the status will change to Deceleration Stopping (G).
  • Page 695 Appendices Axis Command Instructions Axis status before instruction execution Instruction Error Deceleration Axis Disabled Stopping MC_Power MC_MoveJog MC_Home MC_HomeWithParameter MC_Move MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveZeroPosition MC_MoveFeed MC_Stop MC_ImmediateStop MC_SetPosition MC_SetOverride MC_ResetFollowingError MC_CamIn MC_CamOut MC_GearIn MC_GearInPos MC_GearOut MC_MoveLink MC_CombineAxes MC_Phasing MC_TorqueControl MC_SetTorqueLimit MC_ZoneSwitch MC_TouchProbe MC_AbortTrigger...
  • Page 696: Connecting To Nx Units

    Appendices Connecting to NX Units Observe the following precautions when you use the NX-series Position Interface Units. NX-series Position Interface Units A CPU Unit with unit version 1.05 or later and Sysmac Studio version 1.06 or higher are required to use the NX-series Position Interface Units.
  • Page 697 Index NY-series Motion Control Instructions Reference Manual (W561) Index-1...
  • Page 698 Index Index Absolute Linear Interpolation ........4-36 Linear Interpolation ............4-10 Absolute Positioning ............ 3-49 linear interpolation ..........4-36, 4-39 Axes Group Cyclic Synchronous Absolute Positioning ..............4-91 Axes Group Immediate Stop ........4-75 MC_AbortTrigger (Disable External Latch) ....3-358 MC_AxesObserve (Monitor Axis Following Error) ..3-363 MC_CamIn (Start Cam Operation) ......3-165 Change Axes in Group ..........
  • Page 699 Index MC_SetTorqueLimit (Set Torque Limit) .....3-323 MC_Stop (Stop) ............3-133 MC_SyncMoveAbsolute Zone Monitor ............. 3-330 (Cyclic Synchronous Absolute Positioning) ....3-379 MC_SyncMoveVelocity (Cyclic Synchronous Velocity Control) ....3-369 MC_SyncOffsetPosition (Cyclic Synchronous Position Offset Compensation) ..........3-425 MC_TimeStampToPos (Time Stamp to Axis Position Calculation) ....3-413 MC_TorqueControl (Torque Control) ......3-312 MC_TouchProbe (Enable External Latch) ....3-336 MC_Write (Write MC Setting) ........5-12...
  • Page 700 Index Index-4 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 702 OMRON ELETRÔNICA DO BRASIL LTDA • HEAD OFFICE São Paulo, SP, Brasil • 55.11.2101.6300 • www.omron.com.br OMRON EUROPE B.V. • Wegalaan 67-69, NL-2132 JD, Hoofddorp, The Netherlands. • +31 (0) 23 568 13 00 • www.industrial.omron.eu Authorized Distributor: Controllers & I/O •...

This manual is also suitable for:

Ny512-1500Ny532-1400Ny512-1400Ny512-1300Ny532-1300

Table of Contents