Omron Sysmac NY-series Instruction & Reference Manual

Omron Sysmac NY-series Instruction & Reference Manual

Industrial pc platform, motion control
Hide thumbs Also See for Sysmac NY-series:
Table of Contents

Advertisement

Quick Links

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

Advertisement

Table of Contents
loading

Summary of Contents for Omron Sysmac NY-series

  • 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-05...
  • Page 2 Moreover, because OMRON is constantly striving to improve its high-quality products, the infor- mation contained in this manual is subject to change without notice. 3. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON as- sumes no responsibility for errors or omissions.
  • Page 3: Intended Audience

    Introduction Introduction Thank you for purchasing an NY-series IPC Machine Controller Industrial Panel PC / Industrial Box In this manual, the Industrial Panel PCs and Industrial Box PCs may be collectively referred to as “NY- series Industrial PCs”. In this manual, the range of devices that are directly controlled by the Controller functions embedded in the Real-Time OS in the NY-series Industrial PC may be expressed as the Controller.
  • Page 4: Relevant Manuals

    Relevant Manuals Relevant Manuals The following table provides the relevant manuals for the NY-series Controller. Read all of the manuals that are relevant to your system configuration and application before you use the NY-series Controller. Most operations are performed from the Sysmac Studio Automation Software. Refer to the Sysmac Studio Version 1 Operation Manual (Cat.
  • Page 5 Relevant Manuals Manual Basic information Purpose of use Testing operation and debug- ging Using motion control ¡ ¡ Using EtherCAT ¡ Using EtherNet/IP ¡ Using numerical con- ¡ trol Learning about error manage- ¡ ment and corrections Maintenance Using motion control ¡...
  • Page 6: Manual Structure

    Manual Structure Manual Structure Some of the instructions described in this manual are common to the NJ/NX-series. Therefore, note the following conditions. • You cannot connect a CJ-series Unit with NY-series Controllers. In explanation of the instructions, skip items and samples related to CJ-series Units. •...
  • Page 7: Special Information

    Manual Structure 3 Axis Command Instructions In-Out Variables Name Meaning Data type Valid range Description Axis Axis _sAXIS_REF Specify the axis. * Specify an Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio. (The default axis variable names are MC_Axis***.) Function Level-2 section heading...
  • 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: Table Of Contents

    CONTENTS CONTENTS Introduction ......................1 Intended Audience............................1 Applicable Products ............................1 Relevant Manuals..................... 2 Manual Structure...................... 4 Page Structure..............................4 Special Information ............................5 Sections in this Manual ................... 7 Terms and Conditions Agreement................ 13 Warranty, Limitations of Liability ........................13 Application Considerations ..........................14 Disclaimers ..............................14 Safety Precautions....................
  • Page 11 CONTENTS 2-1-3 Axes Group Variables........................2-10 2-1-4 Input Variables for Motion Control Instructions................2-12 2-1-5 Output Variables for Motion Control Instructions...............2-27 2-1-6 In-Out Variables for Motion Control Instructions................2-30 Instructions ..........................2-33 2-2-1 Common Commands ........................2-33 2-2-2 Axis Commands ........................2-33 2-2-3 Axes Group Commands ......................2-35 PDO Mapping ........................2-37 2-3-1 Required Objects ........................2-37...
  • Page 12 CONTENTS Variables ..............................3-154 Function ..............................3-155 MC_SetOverride ...........................3-161 Variables ..............................3-161 Function ..............................3-162 MC_ResetFollowingError ......................3-167 Variables ..............................3-167 Function ..............................3-168 MC_CamIn.............................3-174 Variables ..............................3-174 Function ..............................3-178 Sample Programming 1 ..........................3-201 Sample Programming 2 ..........................3-212 MC_CamOut..........................3-232 Variables ..............................3-232 Function ..............................3-233 MC_CamMonitor...........................3-237 Variables ..............................3-237 Function ..............................3-240 Precautions for Correct Use ........................3-245 MC_GearIn ............................3-246 Variables ..............................3-246...
  • Page 13 CONTENTS Function ..............................3-382 MC_AxesObserve.........................3-385 Variables ..............................3-385 Function ..............................3-387 MC_SyncMoveVelocity ........................3-391 Variables ..............................3-391 Function ..............................3-393 MC_SyncMoveAbsolute ......................3-401 Variables ..............................3-401 Function ..............................3-403 MC_Reset............................3-408 Variables ..............................3-408 Function ..............................3-409 MC_ChangeAxisUse ........................3-412 Variables ..............................3-412 Function ..............................3-413 MC_DigitalCamSwitch .........................3-416 Variables ..............................3-416 Function ..............................3-418 Sample Programming ..........................3-427 MC_TimeStampToPos .........................3-436 Variables ..............................3-436 Function ..............................3-437...
  • Page 14 CONTENTS Function ..............................4-76 MC_GroupImmediateStop ......................4-82 Variables ..............................4-82 Function ..............................4-83 MC_GroupSetOverride ........................4-86 Variables ..............................4-86 Function ..............................4-87 MC_GroupReadPosition........................4-91 Variables ..............................4-91 Function ..............................4-92 MC_ChangeAxesInGroup......................4-95 Variables ..............................4-95 Function ..............................4-96 MC_GroupSyncMoveAbsolute......................4-99 Variables ..............................4-99 Function ..............................4-101 MC_GroupReset ...........................4-106 Variables ..............................4-106 Function ..............................4-107 Section 5 Common Command Instructions MC_SetCamTableProperty ......................5-2 Variables ...............................5-2 Function ................................5-3...
  • Page 15: Terms And Conditions Agreement

    Omron’s exclusive warranty is that the Products will be free from defects in materials and work- manship for a period of twelve months from the date of sale by Omron (or such other period ex- pressed in writing by Omron). Omron disclaims all other warranties, express or implied.
  • Page 16: Application Considerations

    WAY CONNECTED WITH THE PRODUCTS, WHETHER SUCH CLAIM IS BASED IN CONTRACT, WARRANTY, NEGLIGENCE OR STRICT LIABILITY. Further, in no event shall liability of Omron Companies exceed the individual price of the Product on which liability is asserted. Application Considerations...
  • Page 17 Product. Errors and Omissions Information presented by Omron Companies has been checked and is believed to be accurate; how- ever, no responsibility is assumed for clerical, typographical or proofreading errors or omissions. NY-series Motion Control Instructions Reference Manual (W561)
  • Page 18: 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 19: 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 20: 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 21: Regulations And Standards

    Regulations and Standards Regulations and Standards Refer to the following manuals for Regulations and Standards. • 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 Motion Control Instructions Reference Manual (W561)
  • Page 22: Versions

    Versions Versions Hardware revisions and unit versions are used to manage the hardware and software in NY-series Controllers 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 hard- ware revisions or unit versions.
  • Page 23 Versions The view will change between the production information details and outline. 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 dis- plays only the unit version.
  • Page 24: 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-££££ Learning the basic An introduction to the entire NY-series sys- IPC Machine Controller specifications of the tem is provided along with the following in- Industrial Panel PC...
  • Page 25 Related Manuals Manual name Cat. No. Model numbers Application Description NY-series W562 NY532-££££ Using the built-in Information on the built-in EtherCAT port is IPC Machine Controller NY512-££££ EtherCAT port in an provided. Industrial Panel PC NY-series Industrial This manual provides an introduction and / Industrial provides information on the configuration, Box PC...
  • Page 26 Related Manuals Manual name Cat. No. Model numbers Application Description NX-series W521 NX-ID££££ Learning how to use Describes the hardware, setup methods, NX Units NX-IA££££ NX Units. and functions of the NX Units. User’s Manual NX-OC££££ Manuals are available for the following NX-OD££££...
  • Page 27: 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-05 Cat. No. Revision code Revision Date Revised content code September 2016 Original production April 2017 Corrected mistakes.
  • Page 28 Revision History NY-series Motion Control Instructions Reference Manual (W561)
  • Page 29: Introduction To Motion Control Instructions

    Introduction to Motion Control In- structions This section gives an introduction to motion control instructions supported by NY-ser- ies Controllers. Motion Control Instructions ................1-2 ® 1-1-1 Function Blocks for PLCopen Motion Control..........1-2 1-1-2 Overview of Motion Control Instructions ............1-2 1-1-3 Precautions for Master and Auxiliary Axes in Synchronized Control....
  • 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 1 Introduction to Motion Control Instructions Classification Type Functional group Description Instructions for Common adminis- Cam tables These instructions are used to control the com- common com- tration instructions mon status of the MC Function Module, and to Parameters mands manipulate and monitor data.
  • 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 Checking for Communications Errors between the CPU Unit and Servo Drive ConnectErr MC_Axis000.MFaultLvl.Code WORD#16#8440 Changing Input Variables during Execution of Motion Control In- structions (Restarting Instructions) If the values of the input variables to an instruction instance are changed while the motion control in- struction 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 Structures Used for Motion Control ® Information required for motion control are defined as structures in PLCopen technical materials. Da- ta type names and basic aspects are defined, but the contents of the structures are not defined. ®...
  • Page 35 1 Introduction to Motion Control Instructions • When the immediate stop input signal or limit stop input signal changes to TRUE for the master or auxiliary axis • When the Servo turns OFF for the master or auxiliary axis When the Servo is turned OFF when the master or auxiliary axis is a vertical axis, the position of the axis may change suddenly.
  • 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 in- structions for the MC Function Module built into the NY-series Controller. For details on motion control instructions, refer to Section 3 Axis Command Instructions on page 3-1, Section 4 Axes Group Instructions on page 4-1, and Section 5 Common Command In- structions on page 5-1.
  • Page 37: Motion Control Instruction Locations

    1 Introduction to Motion Control Instructions • The status of the instruction or the status of the Servo Drive is output with output variables. • If input parameters are omitted, input variables are set to default values. Structured Text (ST) The instruction instance name is specified.
  • Page 38 1 Introduction to Motion Control Instructions Applica- Task type Remarks bility Event task (execution priority: 48) Not Appli- cable 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.
  • Page 39 1 Introduction to Motion Control Instructions MC_Power MC_Power Axis Axis Axis Axis Equivalent Enable Status Status_PW Enable Status Status_PW Busy Busy_PW Busy Busy_PW PW1.Busy_PW PW1.Status_PW Servo ON/OFF Enable of the motion control instruction changes to FALSE and the Servo turns OFF. ...
  • Page 40 1 Introduction to Motion Control Instructions Rel1.Execute Rel1.Busy_1 Positioning starts when Execute changes to TRUE. Rel1.Active_1 Rel1.Done_1 Positioning is completed when Execute changes to FALSE, so Rel.Done_1 changes to TRUE for one period. Precautions for Correct Use Execute-type motion control instructions are executed when G0 changes to TRUE. It is not rec- ommended to use them in the master control region.
  • Page 41 1 Introduction to Motion Control Instructions Additional Information To switch the execution of an execute-type instruction with the condition expression, place only the Execute input parameter in the ST structure. Place the execute-type instruction itself out- side of the ST structure. For details on the ST structure instructions, refer to the NY-series Instructions Reference Manual (Cat.
  • Page 42 1 Introduction to Motion Control Instructions Exponent Expression From the previous equation, e-127 = 6. Therefore e = 133. The number 133 is 10000101 as a binary number. This expresses the exponent. Mantissa Expression Numbers following the decimal point in 1.010110101 are 010110101. This number is expressed using 23 bits, but here there are insufficient digits.
  • Page 43 1 Introduction to Motion Control Instructions Data type Special number Sign s Exponent e Mantissa f +∞ -∞ REAL Nonnumeric data --- Not 0 +∞ 2047 -∞ 2047 LREAL Nonnumeric data --- 2047 Not 0  Subnormal Numbers Numbers that are very close to 0 (with very small absolute values) cannot be expressed using the floating-point decimal format.
  • Page 44 1 Introduction to Motion Control Instructions Sign Exponent Mantissa REAL data (32 bits) 0 00000000 01100000000000000000000 31 30 23 22 Subnormal numbers have fewer effective digits than normalized numbers. Therefore, if the calcula- tion of a normalized number results in an subnormal number, or if an intermediate result is an sub- normal number, the number of effective digits of the calculated result may be less than that of the normalized number.
  • Page 45: Multi-Execution Of Motion Control Instructions

    1 Introduction to Motion Control Instructions • If a nonnumeric number is included in a comparison, the comparison instruction always returns "Not Equal". Precautions for Correct Use Floating-point decimal (LREAL) variables are used to set electronic gears, target positions, and other parameters of motion control instructions in the MC Function Module.
  • Page 46: Online Editing Of Motion Control Instructions

    1 Introduction to Motion Control Instructions Additional Information If the MC_SetOverride (Set Override Factors) instruction is executed simultaneously in the same way as the instructions shown above, the override value is valid even when it is placed on the bottom. When different override values are set with the MC_SetOverride (Set Override Fac- tors) instruction, the following type of programming is recommended.
  • Page 47 1 Introduction to Motion Control Instructions • If saving the cam table is in progress for the Save Cam Table instruction, the save operation contin- ues. • If creation of the cam table is in progress for the Generate Cam Table instruction, the creation oper- ation continues.
  • Page 48 1 Introduction to Motion Control Instructions 1-20 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 49: Variables And Instructions

    Variables and Instructions This section describes the variables and instructions for the Motion Control Function Module. Variables ......................2-2 2-1-1 MC Common Variables ................... 2-3 2-1-2 Axis Variables ....................2-4 2-1-3 Axes Group Variables ................... 2-10 2-1-4 Input Variables for Motion Control Instructions ..........2-12 2-1-5 Output Variables for Motion Control Instructions ..........
  • Page 50: 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 pa- rameter settings. System-defined variables that are used by the MC Function Module are called sys- tem-defined variables for motion control.
  • Page 51: Mc Common Variables

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

    2 Variables and Instructions Name Data type Meaning Function Code WORD MC Common Observa- Contains the code for an MC common ob- tion Code servation. The upper four digits of the event code have the same value. 2-1-2 Axis Variables The variable names of the system-defined Axis Variables are _MC_AX[0..63].
  • Page 53 2 Variables and Instructions Name Data type Meaning Function _MC_AX[0..63] _sAXIS_REF Axis Variable Status _sAXIS_REF_STA Axis Status Ready BOOL Axis Ready-to-exe- TRUE when preparations for axis execution are cute finished and the axis is stopped. This variable gives the same status as _MC_AX[*].Status.Standstill (TRUE: standstill).
  • Page 54 2 Variables and Instructions Name Data type Meaning Function 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. InPosWaiting BOOL In-position Waiting...
  • Page 55 2 Variables and Instructions Name Data type Meaning Function BOOL Cyclic Synchronous TRUE when the Servo is ON at the Servo Drive Velocity (CSV) Con- and the current mode is CSV Mode. trol Mode BOOL Cyclic Synchronous TRUE when the Servo is ON at the Servo Drive Torque (CST) Control and the current mode is CST Mode.
  • Page 56 2 Variables and Instructions Name Data type Meaning Function LREAL Actual Current Veloc- Contains the actual current velocity. (Unit: com- mand units/s) A plus sign is added when traveling in the posi- tive direction, and a minus sign when traveling in the negative direction.
  • Page 57 TRUE depends on the specifications of the Servo Drive. Refer to the manual for the servo driver. For the OMRON 1S-series Servo Drive or G5-series Servo Drive, this variable gives one of the following limits: torque limits, velocity limit, drive prohibit inputs, and software limits.
  • Page 58: Axes Group Variables

    2 Variables and Instructions *16. If the Count Mode is set to Linear Mode, the position just before an underflow is given. In Rotary Mode, the modulo minimum position is given. 2-1-3 Axes Group Variables The variable name of the system-defined Axes Group Variable is _MC_GRP[0..31]. The data type is _sGROUP_REF, which is a structure.
  • Page 59 2 Variables and Instructions Name Data type Meaning Function ErrorStop BOOL Error Deceleration TRUE while the axes group is stopping or Stopping stopped for the MC_GroupImmediateStop in- struction or during an axes group minor fault (when _MC_GRP[*].MFaultLvl.Active is TRUE). Axes group motion instructions are not exe- cuted in this state.
  • Page 60: Input Variables For Motion Control Instructions

    2 Variables and Instructions Name Data type Meaning Function Code WORD Axes Group Observa- Contains the code for an axes group obser- tion Code vation. The upper four digits of the event code have the same value. _sGROUP_REF_CFG Axes Group Basic Settings GrpNo UINT Axes Group Number...
  • Page 61 2 Variables and Instructions Input Variables Name Meaning Data type Valid range Description fault Execute Execute BOOL TRUE or FALSE FALS The instruction is executed when the value of this variable changes to TRUE. Other input variables are also input when Execute changes to TRUE.
  • Page 62 2 Variables and Instructions Name Meaning Data type Valid range Description fault • NegativeEn- Negative Di- BOOL TRUE or FALSE FALS MC_MoveJog Instruction able rection Enable When this variable changes to TRUE, the axis starts moving in the negative direction. When it changes to FALSE, the axis stops moving.
  • Page 63 2 Variables and Instructions Name Meaning Data type Valid range Description fault AccFactor Acceleration/ LREAL 0 to 500 (Reserved) (Reserved) Deceleration Override Fac- JerkFactor Jerk Override LREAL 0 to 500 (Reserved) (Reserved) Factor Reference- Position Type _eMC_REF- 0: _mcCommand Specifies the master axis input infor- Selection ERENCE_TY 1: _mcFeedback...
  • Page 64 2 Variables and Instructions Name Meaning Data type Valid range Description fault MasterOffset Master Offset LREAL Negative number, posi- The phase of the master axis is shift- tive number, or 0 ed using the specified offset value. SlaveOffset Slave Offset LREAL Negative number, posi- The displacement of the slave axis is...
  • Page 65 2 Variables and Instructions Name Meaning Data type Valid range Description fault LinkOption Synchroniza- _eMC_LINK- 0: _mcCommandExecu- Specifies the condition for the slave tion Start OPTION tion axis to synchronize with the master Condition 1: _mcTriggerDetection axis. 2: _mcMasterReach 0: When instruction execution starts 1: When trigger is detected 2: When the master axis reaches the master following distance.
  • Page 66 2 Variables and Instructions Name Meaning Data type Valid range Description fault PositiveVal- Positive Tor- LREAL 0.1 to 1000.0 or 0.0 300.0 Specifies the torque limit in the posi- que Limit tive direction in increments of 0.1%. If a value that exceeds the Maximum Positive Torque Limit axis parameter, the positive torque will be the Maximum Positive...
  • Page 67 2 Variables and Instructions Name Meaning Data type Valid range Description fault MoveMode Travel Mode _eMC_MOVE 0: _mcAbsolute Selects the travel method. _MODE 1: _mcRelative 0: Absolute positioning 1: Relative positioning CircAxes Circular Axes ARRAY [0,1] 0 to 3 Specifies the axes for circular inter- OF UINT polation.
  • Page 68 Specifies the time stamp for which to calculate the position. A time stamp that is based on the time in a Digital Input Unit, Encoder Input Unit, or OMRON 1S-series Servo Drive with built-in EtherCAT communications that supports time stamp refreshing is specified. The unit is nanoseconds.
  • Page 69 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. ...
  • Page 70 2 Variables and Instructions Mean- Outside the maximum Outside the minimum val- Name Valid range value range ue range (excluding 0) Distance Travel (0 x FFFFFF0000000001) ≤ and ≤ Error Values outside of the mini- Dis- (0 x 000000FFFFFFFFFF) mum value range do not oc- tance cur.
  • Page 71 2 Variables and Instructions Position must be an absolute value in pulses and must be no more than 40 bits signed. The unit is %. The upper limit of the Maximum Interpolation Velocity in the axis parameters is the twice as high as the upper limit of the Maximum Velocity in the axis parameters.
  • Page 72 2 Variables and Instructions Corresponding instruc- Data type Valid range Description tion variable (Meaning) _eMC_EXECU- 0: _mcImmediately (Reserved) ExecutionMode TION_MODE (Execution Mode) _eMC_LINKOP- 0: _mcCommandExecution Specifies the condition for the slave LinkOption TION 1: _mcTriggerDetection axis to synchronize with the master (Synchronization Start 2: _mcMasterReach axis.
  • Page 73 2 Variables and Instructions Corresponding instruc- Data type Valid range Description tion variable (Meaning) _eMC_REFER- 0: _mcCommand Specifies the position type. ReferenceType 1: _mcFeedback 0: Command position (value calculat- (Position Type Selection) ENCE_TYPE 2: _mcLatestCommand ed in the previous primary period) ReferenceTypeMaster 1: Actual position (value obtained in (Master Axis Position...
  • Page 74 2 Variables and Instructions Corresponding instruc- Data type Valid range Description tion variable (Meaning) _eMC_HOM- 0: _mcHomeSwTurnHomeSwOff Specify the new setting of the ING_MODE 1: _mcHomeSwTurnHomeSwOn Homing Method. 4: _mcHomeSwOff 0: Proximity reverse turn/home prox- 5: _mcHomeSwOn imity input OFF 8: _mcLimitInputOff 1: Proximity reverse turn/home prox- 9: _mcHomeSwTurnHomeMask...
  • Page 75: Output Variables For Motion Control Instructions

    2 Variables and Instructions Corresponding instruc- Data type Valid range Description tion variable (Meaning) _eMC_ACCDE- 0: _mcAccDecOverBuffer Sets the operation for when the maxi- COVER 1: _mcAccDecOverRapid mum acceleration/deceleration rate 2: _mcAccDecOverErrorStop would be exceeded after excessive acceleration/deceleration during ac- celeration/deceleration control of the axis because stopping at the target position is given priority.
  • Page 76 2 Variables and Instructions Valid Name Meaning Data type Description range Done Done BOOL TRUE or TRUE when the instruction is completed. FALSE At this time, output variables Active, Error, and CommandAborted are FALSE. Done will be TRUE for at least one period if the input variable Execute is FALSE when the instruction is completed.
  • Page 77 2 Variables and Instructions Valid Name Meaning Data type Description range RecordedPosition Latched Po- LREAL Negative Contains the latched position. sition number, positive number, or Invalid Excessive BOOL TRUE or TRUE when the permitted following error between Following Er- FALSE axes is exceeded.
  • Page 78: In-Out Variables For Motion Control Instructions

    2 Variables and Instructions Valid Name Meaning Data type Description range InPosition In Position BOOL TRUE or TRUE when the actual current positions for all com- FALSE position axes are within the in-position range of their target positions. InOperation In Operation BOOL TRUE or TRUE when the operation for the instruction is in...
  • Page 79 2 Variables and Instructions Name Meaning Data type Valid range Description CamTable Cam Table ARRAY [0..N] OF Specifies the cam data structure _sMC_CAM_REF _sMC_CAM_REF array variable as the cam ta- ble. TriggerInput Trigger Input _sTRIGGER_REF Sets the trigger condition. Condition TriggerVariable Trigger Variable BOOL...
  • Page 80 2 Variables and Instructions Name Meaning Data type Valid range Description AxisParameter Axis Parameters _sAXIS_PARAM When writing, specifies the axis parameters to write. When reading, specifies the variable with a da- ta type of _sAXIS_PARAM to which to write the axis parameters that are read.
  • Page 81: 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 coordinated control For details on common commands, refer to Section 5 Common Command Instructions on page 5-1.
  • Page 82 2 Variables and Instructions The symbols have the following meanings. ® : Instructions defined in PLCopen technical specifications. O : Instructions defined for the MC Function Module. Instruction Instruction name Outline Classification MC_Power Power Servo Makes the Servo Drive ready to operate. Adminis- tration MC_MoveJog...
  • Page 83: Axes Group Commands

    2 Variables and Instructions Instruction Instruction name Outline Classification MC_CombineAxes Combine Axes Outputs the sum or difference of the command positions of Motion two axes as the command position. MC_Phasing Shift Master Axis Shifts the phase of the master axis currently in synchron- Motion Phase ized control.
  • Page 84 2 Variables and Instructions The "Classification" column gives "Group administration" for non-motion instructions and "Group motion" for motion instructions. The symbols have the following meanings. ® : Instructions defined in PLCopen technical specifications. O : Instructions defined for the MC Function Module. Instruction Instruction name Outline...
  • Page 85: Pdo Mapping

    Digital Inputs (60FD hex) Additional Information To perform fully-closed control with an OMRON G5-series R88D-KN£££-ECT Servo Drive, select 1701 hex or 1600 hex for RxPDO. For 1600 hex, the total size of objects should be 12 bytes or less (for version 2.1 or later).
  • Page 86: Objects Required For Specific Instructions

    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 Modes of Operation Display (6061 hex) mapped (6061 hex) not mapped •...
  • Page 87 Setting is required when LinkOption (Synchronization Start Condition) is set to _mcTriggerDetection and Mode is set to Drive Mode. 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 88 MC_TouchProbe Conditionally required Conditionally required Setting is required when Mode is set to Drive Mode. Setting is required when an OMRON GX-series encoder slave is used and Mode is set to Drive Mode.  Input Settings Function Touch probe sta-...
  • Page 89 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 ......................3-8 MC_Home ........................ 3-18 MC_HomeWithParameter..................3-41 MC_Move......................... 3-48 MC_MoveAbsolute ....................3-53 MC_MoveRelative ....................3-80 MC_MoveVelocity ....................3-88 MC_MoveZeroPosition..................
  • Page 90 3 Axis Command Instructions MC_SetTorqueLimit....................3-348 MC_ZoneSwitch....................3-355 MC_TouchProbe ....................3-361 MC_AbortTrigger ....................3-381 MC_AxesObserve ....................3-385 MC_SyncMoveVelocity ..................3-391 MC_SyncMoveAbsolute..................3-401 MC_Reset ......................3-408 MC_ChangeAxisUse .................... 3-412 MC_DigitalCamSwitch..................3-416 MC_TimeStampToPos..................3-436 MC_SyncOffsetPosition..................3-448 MC_OffsetPosition ....................3-458 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 91: Mc_Power

    3 Axis Command Instructions MC_Power The MC_Power instruction makes a Servo Drive ready to operate. Instruction Name Graphic expression ST expression MC_Power Power Servo MC_Power_instance ( MC_Power_instance Axis :=parameter, MC_Power Enable :=parameter, Axis Axis Enable Status Status =>parameter, Busy Busy =>parameter, Error Error =>parameter, ErrorID...
  • Page 92: 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 condi- When the error is cleared. tions or input parameters for the instruction. In-Out Variables Valid Name Meaning Data type...
  • Page 93 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 94 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 • Status (Servo ON) will not change to TRUE until Enable changes to TRUE and the process- ing is finished at the axis.
  • Page 95 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 96: Mc_Movejog

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

    3 Axis Command Instructions Data Valid Name Meaning Description type range CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted. Aborted FALSE Error Error BOOL TRUE or TRUE while there is an error. FALSE ErrorID Error Code WORD Contains the error code when an error occurs.
  • Page 98 3 Axis Command Instructions • If the command velocity of the MC_MoveJog (Jog) instruction exceeds the Maximum Jog Velocity value that is set in the axis parameters, the Maximum Jog Velocity value is used. 3-10 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 99 3 Axis Command Instructions Precautions for Correct Use • When creating a ladder diagram program, you must connect the PositiveEnable (Positive Di- rection Enable) input variable to the left bus bar and specify a variable for the NegativeEnable (Negative Direction Enable) input variable as shown below. MC_MoveJog_instance MC_MoveJog MC_Axis000...
  • Page 100 3 Axis Command Instructions 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 NegativeEnable CommandAborted J_CA Velocity Error...
  • Page 101 3 Axis Command Instructions PositiveEnable NegativeEnable Busy CommandAborted Error ErrorID 16#0000 Velocity Target velocity Acceleration Deceleration Time Decelerates to a stop when another instruction causes an error. You can specify the Velocity (Target Velocity), Acceleration (Acceleration Rate), and Deceleration (De- celeration Rate) as input variables.
  • Page 102 3 Axis Command Instructions PositiveEnable NegativeEnable Velocity Busy CommandAborted Error ErrorID 16#0000 Velocity Time  Timing Chart When Acceleration/Deceleration Rate Is 0 When the Acceleration (Acceleration Rate) or Deceleration (Deceleration Rate) is 0 and you start jog- ging the axis, the axis will reach the target velocity without accelerating or decelerating. The timing chart below shows an example when the Acceleration (Acceleration Rate) and Deceleration (Deceleration Rate) are 0.
  • Page 103 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 Ena- ble) to TRUE when it is FALSE and the axis is decelerating, the axis will begin to accelerate towards the target velocity.
  • Page 104 3 Axis Command Instructions If NegativeEnable (Negative Direction Enable) changes to TRUE while PositiveEnable (Positive Direc- tion Enable) is TRUE, the axis starts jogging in the negative direction. In this case, the axis will not jog in the positive direction even if NegativeEnable (Negative Direction Enable) changes to FALSE. To jog the axis in the positive direction, change PositiveEnable (Positive Direction Enable) to FALSE, and then back to TRUE again.
  • Page 105 3 Axis Command Instructions  Timing Chart When Error Occurs PositiveEnable NegativeEnable Busy CommandAborted Error ErrorID Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-17 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 106: 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 Graphic expression ST expression MC_Home Home MC_Home_instance ( MC_Home_instance Axis :=parameter, MC_Home Execute :=parameter, Axis Axis...
  • Page 107: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • •...
  • Page 108 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 MC_Home instruction in the OMRON 1S-series Servo Drive.
  • Page 109 3 Axis Command Instructions (¡: Parameter is used, ---: Parameter is not used.) Homing parameters Homing Operation Mode Proximity reverse turn/home ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ proximity input OFF Proximity reverse turn/home ¡...
  • Page 110 3 Axis Command Instructions Home proximity input signal Limit in direction opposite to detection direction Limit in detection direction MC_Home instruction Homing velocity Homing approach velocity Stops. Start • An error occurs and the axis stops if the axis is set to Reverse turn for the limit input operation in both directions and home cannot be detected after moving from the limit input opposite to the home input detection direction to the other limit input.
  • Page 111 3 Axis Command Instructions : The home proximity signal is ON, so the axis starts moving in the direction opposite to the home input detection direction. Homing start direction: Negative Home input detection direction: Negative Home proximity input signal Operation command Start Start Positive direction...
  • Page 112 3 Axis Command Instructions Home Input Mask Distance Set the feed distance when you set the Homing Operation Mode to 9: Proximity Reverse Turn/Home Input Mask Distance. For details on the operation, refer to 9: Proximity Reverse Turn/Home Input Mask Distance Operation on page 3-28.
  • Page 113 3 Axis Command Instructions Home input detection direction Home proximity input signal Home input signal Homing velocity Homing approach velocity Command output Negative direction Positive direction Stops Start Homing velocity • If you start homing while the home proximity input signal is ON, the operation will start at the homing velocity in the direction opposite to the home input detection direction.
  • Page 114 3 Axis Command Instructions When the home proximity input signal turns ON, the axis starts decelerating to the homing ap- proach velocity. After the axis reaches the homing approach velocity, the axis stops at the first home input signal after the home proximity input signal turns OFF. This defines home. Home input detection direction Negative limit input signal Home proximity input signal...
  • Page 115 3 Axis Command Instructions Home input detection direction Negative limit input signal Positive limit input signal Home proximity input signal Home input signal Homing velocity Homing approach velocity Positive direction Negative direction Start Stop Homing start direction Homing approach velocity Negative direction Positive direction Stop...
  • Page 116 3 Axis Command Instructions Home input detection direction Negative limit input signal Home input signal Homing velocity Homing approach velocity Command output Positive direction Negative direction Stops. Start Homing approach velocity Negative direction Positive direction Stops. Start • If you perform homing while the limit input on the opposite side of the home input detection di- rection is ON, the homing operation starts at the home approach velocity in the home input de- tection direction.
  • Page 117 3 Axis Command Instructions • Homing is started and home is defined when the home input signal turns ON after the axis trav- els the home input mask distance after the home proximity input signal turns ON while the velocity is below the homing approach velocity. ...
  • Page 118 3 Axis Command Instructions For Homing Operation Mode 11, the MC Function Module detects when the limit signal turns OFF to define home. It differs from a Homing Operation Mode that uses the home input as an external latch signal in the following ways. Make sure that you understand these differences with other Homing Operation Modes before you use Homing Operation Mode 11.
  • Page 119 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 120  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 121 Positive direction Stops. Start Torque limit Command torque from previous operation • Releasing the torque limit also differs between OMRON 1S-series as well as G5-series Servo Drives and other Servo Drives. Servo Drive Operation 1S-series, G5- Automatically released when the axis moves in the direction opposite to homing for series the first time after homing.
  • Page 122 3 Axis Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 Homing Homed (Home Defined) Command current position Actual current position Instruction Details This section describes the instruction in detail.  Axis Stopping Method and In-position Check When Homing The axis is stopped with the following procedure when homing. The actual position where the home input signal was detected is latched and the axis stops imme- diately.
  • Page 123 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 12: Proximity Reverse Turn/Holding Time or 13: No Home Proximity Input/Holding Home Input for the homing operation, the torque limit will be automatically started in the holding direction.
  • Page 124 3 Axis Command Instructions  Holding Operation for OMRON 1S-series Servo Drives Torque limits that are set in the Servo Drive in advance are used for the Homing Operation Modes, 12: Proximity Reverse Turn/Holding Time and 13: No Home Proximity Input/Holding Home Input, to automatically start torque control in the home input detection direction.
  • Page 125 3 Axis Command Instructions  Holding Operation for OMRON G5-series Servo Drives Torque limits that are set in the Servo Drive in advance are used for the Homing Operation Modes, 12: Proximity Reverse Turn/Holding Time and 13: No Home Proximity Input/Holding Home Input, to automatically start torque control in the home input detection direction.
  • Page 126 3 Axis Command Instructions For details on monitoring the following error, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Timing Charts The following charts show the timing of homing.  No Homing Compensation Execute Done Busy...
  • Page 127 3 Axis Command Instructions  With Homing Compensation Execute Done Busy CommandAborted Error ErrorID 16#0000 Homing Homed(Home Defined) Velocity Time  Execution When Home Is Defined Execute Done Busy CommandAborted Error ErrorID 16#0000 Homing Homed (Home Defined) Velocity Time 3-39 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 128 3 Axis Command Instructions  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) Velocity Time 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.
  • Page 129: Mc_Homewithparameter

    3 Axis Command Instructions MC_HomeWithParameter The MC_HomeWithParameter instruction sets the homing parameter and operates the motor to deter- mine home. It uses the limit signals, home proximity signal, and home signal. Instruction Name Graphic expression ST expression MC_Home- Home with MC_HomeWithParameter_in- MC_HomeWithParameter_instance WithParame-...
  • Page 130 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. •...
  • Page 131 3 Axis Command Instructions  _sHOMING_REF Name Meaning Data type Valid range Function HomingMode Homing _eMC_HOM- 0: _mcHomeSwTurnHo- Specify the new setting of the Homing Meth- Method ING_MODE meSwOff 1: _mcHomeSwTurnHo- 0: Proximity reverse turn/home proximity in- meSwOn put OFF 4: _mcHomeSwOff 1: Proximity reverse turn/home proximity in- 5: _mcHomeSwOn...
  • Page 132 3 Axis Command Instructions Name Meaning Data type Valid range Function ApproachVel Homing Ap- LREAL Positive number Set the velocity to use after the home prox- proach Ve- imity input turns ON. locity Set the homing velocity to a value that is less than the maximum velocity and greater than or equal to the homing approach veloci- The unit is command units/s.
  • Page 133: Function

    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 134 3 Axis Command Instructions Homing parameter Homing method Proximity reverse turn/home ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ proximity input OFF Proximity reverse turn/home ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡...
  • Page 135 3 Axis Command Instructions Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-47 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 136: Mc_Move

    3 Axis Command Instructions MC_Move The MC_Move instruction performs absolute positioning or relative positioning. Instruction Name Graphic expression ST expression MC_Move Positioning MC_Move_instance ( MC_Move_instance Axis :=parameter, MC_Move Execute :=parameter, Axis Axis Execute Done Position :=parameter, Position Busy Velocity :=parameter, Velocity Active Acceleration :=parameter,...
  • Page 137 3 Axis Command Instructions Name Meaning Data type Valid range Description fault Jerk Jerk LREAL Non-negative number Specify the jerk. The unit is command units/s Direction Direction _eMC_DIREC- 0: _mcPositiveDirection Specify the direction of rotation TION 1: _mcShortestWay when MoveMode is set to 0: 2: _mcNegativeDirec- Absolute positioning tion...
  • Page 138: Function

    3 Axis Command 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. •...
  • Page 139 3 Axis Command Instructions 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 ax- is parameters are not exceeded. If the target position is set outside of the settings of the Modulo Maximum Position Setting Value and Modulo Minimum Position Setting Value axis parameters, a Target Position Set- ting Out of Range error (error code 5478 hex) will occur.
  • Page 140 3 Axis Command Instructions Buffer Mode Selec- Description tion Blending low The lower of the target velocities of the current instruction and the buffered instruction is used as the transit velocity. Blending previ- The target velocity of the current instruction is used as the transit velocity. Blending next The target velocity of the buffered instruction is used as the transit velocity.
  • Page 141: 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_MoveAbso- Absolute Po- MC_MoveAbsolute_instance ( MC_MoveAbsolute_instance lute sitioning Axis :=parameter, MC_MoveAbsolute Execute :=parameter, Axis Axis Execute Done Position :=parameter, Position Busy...
  • Page 142 3 Axis Command Instructions Name Meaning Data type Valid range Description fault Direction Direction _eMC_DIREC- 0: _mcPositiveDirection Specify the direction of rotation TION 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 143: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Active When the instruction is started. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • •...
  • Page 144 3 Axis Command Instructions Velocity Target Deceleration velocity Time Target position Command current position Specify Jerk when you want to accelerate or decelerate smoothly. The following chart shows an operation example when Jerk is specified. Velocity Target velocity Time Command current Target position position For details on Jerk, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control...
  • Page 145 3 Axis Command Instructions Modulo maximum position setting Command current value: 100 position: 50 Target position: Target position: Modulo minimum position setting value: -70 Moves in positive direction. Positioning starts in the negative direction towards the target position when 2: _mcNegativeDirection (Negative direction) is specified for Direction.
  • Page 146 3 Axis Command Instructions When 4: _mcNoDirection (No direction specified) 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 exceeding the modulo maximum position setting value as a relative distance.
  • Page 147 3 Axis Command Instructions Precautions for Correct Use • When you perform absolute positioning, set the target position so that it is less than the Modulo Maximum Position Setting Value axis parameter and greater than or equal to the Modulo Minimum Position Setting Value axis parameter. If the target position is greater than or equal to the setting of the Modulo Maximum Position Setting Value axis parameter or less than the setting of the Modulo Minimum Position Setting Value axis parameter, a Target Position Setting Out of Range error (error code 5478...
  • Page 148 3 Axis Command Instructions Re-execution of Motion Control 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 Position (Target Position), Velocity (Target Velocity), Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate) can be changed by re-executing the motion control instruction.
  • Page 149: 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 Execute Done Busy...
  • Page 150 3 Axis Command Instructions Operation Example In this sample, BufferMode (Buffer Mode Selection) is set to Buffered for MC_MoveAbsolute (Abso- lute Positioning) instructions and the axis is moved to the final target position by executing multiple in- structions. When the axis reaches the final target position, it is returned to home with the MC_ZeroPosition (High- speed Home) instruction.
  • Page 151 3 Axis Command Instructions Name Data type Default Comment Pwr_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR instance of the MC_Pow- er instruction. This variable changes to TRUE when the Servo is turned ON. StartPg BOOL FALSE...
  • Page 152 3 Axis Command Instructions If a minor fault level error occurs for axis 1, the error handler for the device (FaultHandler) is executed. Program the FaultHandler according to the device. MC_Axis000.MFaultLvl.Active FaultHandler FaultHandler If the Servo is ON and home is not defined, the Home instruction is executed. MC_Home Hm_D MC_Axis000...
  • Page 153 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 154 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 155 3 Axis Command Instructions Mv_Abs2_Acc := LREAL#1000.0; Mv_Abs2_Dec := LREAL#1000.0; Mv_Abs2_Dir :=_eMC_DIRECTION#_mcNoDirection; Mv_Abs2_Bm :=_eMC_BUFFER_MODE#_mcBuffered; // MV_ABS3 parameters Mv_Abs3_Pos := LREAL#200.0; Mv_Abs3_Vel := LREAL#30.0; Mv_Abs3_Acc := LREAL#1000.0; Mv_Abs3_Dec := LREAL#1000.0; Mv_Abs3_Dir :=_eMC_DIRECTION#_mcNoDirection; Mv_Abs3_Bm :=_eMC_BUFFER_MODE#_mcBuffered; // MV_ZERO parameters Mv_Zero_Vel := LREAL#250; Mv_Zero_Acc := LREAL#1000.0; Mv_Zero_Dec := LREAL#1000.0;...
  • Page 156 3 Axis Command Instructions END_IF; // After MV_ABS1 is started, MV_ABS2 is executed with multi-execution of instructio IF Mv_Abs1_Act=TRUE THEN Mv_Abs2_Ex:=TRUE; END_IF; // After MV_ABS2 is started, MV_ABS3 is executed with multi-execution of instructio IF Mv_Abs2_Act=TRUE THEN Mv_Abs3_Ex:=TRUE; END_IF; // After MV_ABS3 is started, MV_ZERO is executed with multi-execution of instructio IF Mv_Abs3_Act=TRUE THEN Mv_Zero_Ex:=TRUE;...
  • Page 157 3 Axis Command Instructions Acceleration := Mv_Abs1_Acc, Deceleration := Mv_Abs1_Dec, Direction := Mv_Abs1_Dir, Done => Mv_Abs1_D, Busy => Mv_Abs1_Bsy, Active => Mv_Abs1_Act, CommandAborted => Mv_Abs1_Ca, Error => Mv_Abs1_Err, ErrorID => Mv_Abs1_ErrID MV_ABS2( Axis := MC_Axis000, Execute := Mv_Abs2_Ex, Position := Mv_Abs2_Pos, Velocity := Mv_Abs2_Vel, Acceleration := Mv_Abs2_Acc, Deceleration := Mv_Abs2_Dec,...
  • Page 158: Sample Programming 2

    3 Axis Command Instructions Axis := MC_Axis000, Execute := Mv_Zero_Ex, Velocity := Mv_Zero_Vel, Acceleration := Mv_Zero_Acc, Deceleration := Mv_Zero_Dec, BufferMode := Mv_Zero_Bm, Done => Mv_Zero_D, Busy => Mv_Zero_Bsy, Active => Mv_Zero_Act, CommandAborted => Mv_Zero_Ca, Error => Mv_Zero_Err, ErrorID => Mv_Zero_ErrID Sample Programming 2 In this sample, when the Count Mode is set to Rotary Mode and positioning is performed toward the target position, the shortest direction, clockwise or counterclockwise, is automatically determined and...
  • Page 159 3 Axis Command Instructions Operation Example In this sample, multi-execution of absolute positioning instructions is used to position in a range of 0° to 360°. The actual position returns to 0° once it exceeds the range of 0° to 360°. Multi-execution of instructions is performed when the Active (Controlling) output variable from the pre- vious instruction is TRUE.
  • Page 160 3 Axis Command Instructions  Timing Chart Pwr_Status Hm_D Hm_Bsy Mv_Abs1_D Mv_Abs1_Bsy Mv_Abs1_Act Mv_Abs2_D Mv_Abs2_Bsy Mv_Abs2_Act Mv_Abs3_D Mv_Abs3_Bsy Mv_Abs3_Act Mv_Abs4_D Mv_Abs4_Bsy Mv_Abs4_Act Command velocity MC_Axis000 Time  Sample Programming If StartPg is TRUE, check that the Servo Drive is ready. Lock1 StartPg MC_Axis000.DrvStatus.Ready...
  • Page 161 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 162 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 163 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 := LREAL#290.0;...
  • Page 164 3 Axis Command Instructions Mv_Abs2_Acc := LREAL#1000.0; Mv_Abs2_Dec := LREAL#1000.0; Mv_Abs2_Dir := _eMC_DIRECTION#_mcShortestWay; Mv_Abs2_Bm := _eMC_BUFFER_MODE#_mcBuffered; // MV_ABS3 parameters 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;...
  • Page 165 3 Axis Command Instructions IF Hm_D=TRUE THEN Mv_Abs1_Ex:=TRUE; END_IF; // After MV_ABS1 is started, MV_ABS2 is executed with multi-execution of instructio IF Mv_Abs1_Act=TRUE THEN Mv_Abs2_Ex:=TRUE; END_IF; // After MV_ABS2 is started, MV_ABS3 is executed with multi-execution of instructio IF Mv_Abs2_Act=TRUE THEN Mv_Abs3_Ex:=TRUE;...
  • Page 166 3 Axis Command Instructions Position := Mv_Abs1_Pos, Velocity := Mv_Abs1_Vel, Acceleration := Mv_Abs1_Acc, Deceleration := Mv_Abs1_Dec, Direction := Mv_Abs1_Dir, Done => Mv_Abs1_D, Busy => Mv_Abs1_Bsy, Active => Mv_Abs1_Act, CommandAborted => Mv_Abs1_Ca, Error => Mv_Abs1_Err, ErrorID => Mv_Abs1_ErrID // Absolute positioning (2) MV_ABS2( Axis := MC_Axis000, Execute := Mv_Abs2_Ex,...
  • Page 167 3 Axis Command Instructions // 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, Direction := Mv_Abs4_Dir, BufferMode := Mv_Abs4_Bm, Done => Mv_Abs4_D, Busy => Mv_Abs4_Bsy, Active => Mv_Abs4_Act, CommandAborted =>...
  • Page 168: 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_MoveRela- Relative Posi- MC_MoveRelative_instance ( MC_MoveRelative_instance tive tioning Axis :=parameter, MC_MoveRelative Execute :=parameter, Axis Axis Execute...
  • Page 169 3 Axis Command Instructions Name Meaning Data type Valid range Default Description BufferMode Buffer Mode _eMC_BUF- 0: _mcAborting Specify the behavior when executing Selection FER_MODE 1: _mcBuffered more than one motion instruction. 2: _mcBlendingLow 0: Aborting 3: _mcBlendingPrevi- 1: Buffered 2: Blending low 4: _mcBlendingNext 3: Blending previous...
  • Page 170: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to other motion control instruction was executed FALSE. with the Buffer Mode set to Aborting. •...
  • Page 171 3 Axis Command Instructions Velocity Target velocity Acceleration Time Command current position Travel distance Specify Jerk when you want to accelerate or decelerate smoothly. The following chart shows an operation example when Jerk is specified. Velocity Target velocity Time Command current position Travel distance For details on Jerk, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 172 3 Axis Command Instructions When Distance (Travel Distance) is 0 and the instruction is executed, the axis will not move, but Done will change to TRUE. Precautions for Correct Use Observe the following precautions if you re-execute relative positioning just before the comple- tion of positioning.
  • Page 173 3 Axis Command Instructions Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Multi-execution of Velocity instructions Time Re-execution of Motion Control 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 Distance (Travel Distance), Velocity (Target Velocity), Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate) can be changed by re-executing the motion control instruction.
  • Page 174 3 Axis Command Instructions 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 175 3 Axis Command Instructions Buffer Mode Selec- Description tion Blending low The lower of the target velocities of the current instruction and the buffered instruction is used as the transit velocity. Blending previ- The target velocity of the current instruction is used as the transit velocity. Blending next The target velocity of the buffered instruction is used as the transit velocity.
  • Page 176: Mc_Movevelocity

    3 Axis Command Instructions MC_MoveVelocity The MC_MoveVelocity instruction performs velocity control with the Position Control Mode of the Ser- vo Drive. Instruction Name Graphic expression ST expression MC_MoveVelocity Velocity Con- MC_MoveVelocity_instance ( MC_MoveVelocity_instance trol Axis :=parameter, MC_MoveVelocity Execute :=parameter, Axis Axis Execute InVelocity...
  • Page 177 3 Axis Command Instructions Name Meaning Data type Valid range Description fault BufferMode Buffer Mode _eMC_BUF- 0: _mcAborting Specify the behavior when exe- Selection FER_MODE 1: _mcBuffered cuting more than one motion in- struction. 0: Aborting 1: Buffered Continuous Continua- BOOL TRUE or FALSE FALSE (Reserved)
  • Page 178: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to other motion control instruction was executed FALSE. with the Buffer Mode set to Aborting or •...
  • Page 179 3 Axis Command Instructions Precautions for Correct Use If 3: _mcCurrentDirection (Current direction) is specified for Direction, operation is in the same command direction as the previous motion. Therefore, depending on the instructions that are used together, the direction may not be the same as the direction that was specified with the input to the motion control instruction for the previous motion.
  • Page 180 3 Axis Command Instructions Execute InVelocity Busy Active CommandAborted Error ErrorID 16#0000 Velocity Target velocity Time When the Acceleration (Acceleration Rate) or Deceleration (Deceleration Rate) is 0 and the instruction is executed, the axis will reach the target velocity without accelerating or decelerating. The following chart shows an operation example of when the Acceleration (Acceleration Rate) is 0.
  • Page 181 3 Axis Command Instructions When Velocity (Target Velocity) is changed by re-executing a motion control instruction, InVelocity (Target Velocity Reached) operates for the new target velocity that was set at re-execution. For details on re-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 182: Sample Programming

    3 Axis Command Instructions  Timing Chart When Error Occurs Execute InVelocity Busy Active CommandAborted Error ErrorID 16#0000 Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 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.
  • Page 183 3 Axis Command Instructions  Operation Pattern Velocity Second velocity Third velocity First velocity Time Sensor2 Sensor3 Stop command Starting Velocity Control Sensor 1 detects the insertion of liquid chemical. When it turns ON, velocity control starts for axis Changing to the Second Velocity When the Sensor2 bit changes to TRUE, the override factor is set to 500% and the velocity is changed.
  • Page 184 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 variable from the VEL instance of the MC_MoveVelocity instruction.
  • Page 185 3 Axis Command Instructions  Sample Programming If StartPg is TRUE, check that the Servo Drive is ready. Lock1 StartPg MC_Axis000.DrvStatus.Ready If the Servo Drive is ready, the Servo is turned ON. MC_Power Pwr_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr_Bsy Error...
  • Page 186 3 Axis Command Instructions The MC_SetOverride (Set Override Factors) instruction is executed during execution of the MC_MoveVelocity (Velocity Control) instruction. SET_OV MC_SetOverride Set_Ov_End MC_Axis000 Axis Axis Vel_Act Enable Enabled Set_Ov_Velfct VelFactor Busy Set_Ov_Bsy AccFactor Error Set_Ov_Err JerkFactor ErrorID Set_Ov_ErrID When the stop command (StopTrig) changes to TRUE, the MC_Stop instruction is executed. MC_Stop Stp_D MC_Axis000...
  • Page 187 3 Axis Command Instructions Name Data type Default Comment Vel_Act BOOL FALSE This variable is assigned to the Active output variable from the VEL instance of the MC_MoveVelocity instruction. It is TRUE during velocity control by the VEL instance. Set_Ov_Velfct LREAL This is the velocity override factor.
  • Page 188 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 189 3 Axis Command Instructions AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN Pwr_En:=TRUE; ELSE Pwr_En:=FALSE; END_IF; // If a minor fault level error occurs for axis 1, the error handler for the device (FaultHandler) is executed. // Program the FaultHandler according to the device. IF MC_Axis000.MFaultLvl.Active=TRUE THEN FaultHandler();...
  • Page 190 3 Axis Command Instructions Enable := Pwr_En, Status => Pwr_Status, Busy => Pwr_Bsy, Error => Pwr_Err, ErrorID => Pwr_ErrID // MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, Direction := Vel_Dir, InVelocity =>...
  • Page 191 3 Axis Command Instructions ErrorID => Stp_ErrID 3-103 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 192: 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_MoveZero- High-speed MC_MoveZeroPosition_instance ( MC_MoveZeroPosition_instance Position Home Axis :=parameter, MC_MoveZeroPosition Execute :=parameter, Axis Axis...
  • Page 193 3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range 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 axis is being controlled.
  • Page 194: Function

    3 Axis Command Instructions If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axis variable name for AT specifi- cation of a user-defined variable. This will allow you to specify the user-defined variable. If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Function •...
  • Page 195 3 Axis Command Instructions  In-position Check An in-position check is performed for this instruction according to the settings in In-position Range and In-position Check Time axis parameters.  Operation Example Velocity Target velocity Acceleration Deceleration Time Command current position When the Acceleration (Acceleration Rate) or Deceleration (Deceleration Rate) is 0 and the instruction is executed, it will reach the target velocity without accelerating or decelerating.
  • Page 196 3 Axis Command Instructions Execute Done Busy Active 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. Re-execution of Motion Control Instructions You can change the operation of the instruction if you change an input variable during positioning and change Execute to TRUE again.
  • Page 197 3 Axis Command Instructions Buffer Mode Selec- Description tion 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 re- versed according to the Operation Selection at Reversing axis parameter. Buffered Buffers this instruction and executes it automatically after the current instruction is com- pleted.
  • Page 198 3 Axis Command Instructions  Timing Chart When Error Occurs Execute Done Busy Active CommandAborted Error ErrorID Error code 16#0000  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-110 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 199: 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 positioning, relative positioning, and velocity control. Instruction Name Graphic expression ST expression MC_MoveFeed...
  • Page 200 3 Axis Command Instructions Name Meaning Data type Valid range Description fault FirstPosition First Posi- LREAL Negative number, positive Specify the position where latch- tion number, or 0 ing is enabled. The unit is command units. LastPosition Last Posi- LREAL Negative number, positive Specify the position where latch- tion...
  • Page 201 3 Axis Command Instructions Name Meaning Data type Valid range Description fault FeedDistance Feed Dis- LREAL Negative number, positive Specify the travel distance after tance number, or 0 the interrupt feed input. Specify a positive value to feed in the same direction as the axis was moving before the interrupt input and specify a negative val- ue to feed in the opposite direc-...
  • Page 202 3 Axis Command Instructions Data Valid Name Meaning Description type range ErrorID Error Code WORD Contains the error code when an error occurs. A value of 16#0000 indicates normal execution. The upper four digits of the event code give the error code for ErrorID. Refer to the NY-series Troubleshooting Manual (Cat.
  • Page 203: Function

    3 Axis Command Instructions Define a user-defined variable with a data type of _sTRIGGER_REF.  _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 Se- _eMC_TRIG-...
  • Page 204 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 Settings Area of the Axis Basic Settings Display of the Sysmac Studio.
  • Page 205 3 Axis Command Instructions Input signal to Servo Drive Trigger detection Input filter delay Axis position Position (latched position) Position when trigger signal is input Time 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.
  • Page 206 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 Sys- mac Studio to make the setting.
  • Page 207 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 range TriggerInput Execute WindowOnly...
  • Page 208 3 Axis Command Instructions Precautions for Correct Use • Latching is not possible at the moment that 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 209 3 Axis Command Instructions FirstPosition > LastPosition − − Window only range FirstPosition FirstPosition LastPosition : The positions indicated with open dots are not included. LastPosition Window only range  ReferenceType (Position Type Selection) The position type is as follows: •...
  • Page 210 3 Axis Command Instructions  When MoveMode (Travel Mode) is _mcAbsolute or_mcRelative Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Velocity Time *1. There may be a delay of up to several control periods from when the interrupt input turns ON until InFeed changes to TRUE.
  • Page 211 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 Selection at Reversing axis parameter When Motion Variable Is 0 (Decelerate to a Stop After Reversing) 3-123...
  • Page 212 3 Axis Command Instructions Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Velocity Time 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...
  • Page 213 3 Axis Command Instructions  When MoveMode (Travel Mode) is _mcAbsolute and an Interrupt Input Is Not Re- ceived When ErrorDetect (Error Detection Selection) Is FALSE Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Velocity Time When ErrorDetect (Error Detection Selection) Is TRUE Execute Done InFeed...
  • Page 214 3 Axis Command Instructions  When WindowOnly Is TRUE Execute Done InFeed Busy Active CommandAborted Error ErrorID 16#0000 Interrupt input Position LastPosition FirstPosition Time Velocity Time 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.
  • Page 215: Sample Programming

    3 Axis Command Instructions Buffer Mode Selec- Description tion 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 re- versed according to the Operation Selection at Reversing axis parameter. Buffered Buffers this instruction and executes it automatically after the current instruction is com- pleted.
  • Page 216 3 Axis Command 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 Count Modes Axis Count Mode Axis 1 Rotary Mode Axis 2 Linear Mode...
  • Page 217 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 218 3 Axis Command Instructions Name Data type Default Comment TrigRef _sTRIG- This is the specified variable for the interrupt in- GER_REF put. Latch 1 of the Servo Drive is used in this sam- ple. When the rising edge of the external input for sensor 1 is detected, interrupt feeding is executed.
  • Page 219 3 Axis Command Instructions  Sample Programming If StartPg is TRUE, check that the Servo Drives for each axis are ready. Lock1 StartPg MC_Axis000.DrvStatus.Ready Lock2 MC_Axis001.DrvStatus.Ready If the Servo Drives are ready, the Servos are turned ON for each axis. PWR1 MC_Power Pwr1_Status...
  • Page 220 3 Axis Command Instructions If the Servo is ON for axis 2 and home is not defined, the Home instruction is executed. MC_Home Hm2_D MC_Axis001 Axis Axis Pwr2_Status MC_Axis001.Details.Homed Execute Done Busy Hm2_Bsy CommandAborted Hm2_Ca Error Hm2_Err ErrorID Hm2_ErrID The parameters are set for interrupt feeding, absolute positioning, and high-speed homing. InitFlag Note: The contents of the inline ST are given below.
  • Page 221 3 Axis Command Instructions After absolute positioning is completed, the MC_MoveZeroPosition (High-speed Home) instruction is executed to move to home. MV_ZERO MC_MoveZeroPosition Mv_Zero_D MC_Axis001 Axis Axis Mv_Abs_Act Execute Done Mv_Zero_Vel Velocity Busy Mv_Zero_Bsy Mv_Zero_Acc Acceleration Active Mv_Zero_Act Mv_Zero_Dec Deceleration CommandAborted Mv_Zero_Ca Mv_Zero_Jrk Jerk...
  • Page 222 3 Axis Command Instructions Structured Text (ST)  Main Variables Name Data type Default Comment MC_Axis000 _sAXIS_REF 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 223 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 :=_eMC_TRIGGER_MODE#_mcDrive;...
  • Page 224 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 225 3 Axis Command Instructions xecuted for axis 1. IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN Hm1_Ex:=TRUE; END_IF; // If the Servo is ON for axis 2 and home is not defined, the Home instruction is e xecuted for axis 2. IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN Hm2_Ex:=TRUE;...
  • Page 226 3 Axis Command Instructions // MC_Home for axis 1 HM1( Axis := MC_Axis000, Execute := Hm1_Ex, Done => Hm1_D, Busy => Hm1_Bsy, CommandAborted => Hm1_Ca, Error => Hm1_Err, ErrorID => Hm1_ErrID // MC_Home for axis 2 HM2( Axis := MC_Axis001, Execute := Hm2_Ex, Done =>...
  • Page 227 3 Axis Command Instructions Axis := MC_Axis001, Execute := Mv_Abs_Ex, Position := Mv_Abs_Pos, Velocity := Mv_Abs_Vel, Acceleration := Mv_Abs_Acc, Deceleration := Mv_Abs_Dec, Jerk := Mv_Abs_Jrk, Done => Mv_Abs_D, Busy => Mv_Abs_Bsy, Active => Mv_Abs_Act, CommandAborted => Mv_Abs_Ca, Error => Mv_Abs_Err, ErrorID =>...
  • Page 228: Mc_Stop

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

    3 Axis Command Instructions Data Valid Name Meaning Description type range Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE Active Controlling BOOL TRUE or TRUE when the axis is being controlled. FALSE CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted.
  • Page 230 3 Axis Command Instructions • The deceleration stop operation starts when Execute changes to TRUE. • CommandAborted for the instruction that is currently in operation will change to TRUE when MC_Stop is executed. Precautions for Correct Use You cannot execute this instruction if the Status.ErrorStop (Error Deceleration Stopping) varia- ble that gives the status of this axis is TRUE.
  • Page 231 3 Axis Command Instructions Velocity Velocity Time Deceleration rate Time Jerk Time Vt: Velocity when deceleration starts, Dt: Specified deceleration rate, Jt: Specified jerk Additional Information If you set the Deceleration to 0, an Immediate Stop instruction is executed. This will stop the axis immediately without decelerating.
  • Page 232 3 Axis Command Instructions Executing an Axis Instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Executing MC_Stop Instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Velocity Time Re-execution of Motion Control Instructions Deceleration (Deceleration Rate) changes if Execute is changed to TRUE again while this instruction is in execution.
  • Page 233 3 Axis Command Instructions Velocity Executed. Re-executed. Velocity Time Deceleration rate Time -Dt2 -Dt1 Jerk Time Vt: Velocity when deceleration starts, Dt: Specified deceleration rate, Jt: Specified jerk Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 234 OFF) b) When 1: _mcImmediateStop is selected for the StopMode input variable to the MC_TouchP- robe (Enable External Latch) instruction, the trigger condition is met, and the OMRON 1S-series Servo Drive or G5-series Servo Drive stops immediately Errors Operation will stop if an error (e.g., axis error) occurs during instruction execution.
  • Page 235 3 Axis Command Instructions MC_MoveVelocity Execute Busy Active CommandAborted Error ErrorID 16#0000 MC_Stop Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Error code Velocity The current instruction is stopped for an error if an axis error occurs. Time 3-147 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 236 3 Axis Command Instructions Additional Information Operation in Error Reset is shown below. Note that you must reset errors only after the axis has stopped. Do not reset errors during axis motion. If you clear the error for this instruction, the instruction will not start until Execute changes to TRUE again.
  • Page 237: 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_Immediate- Immediate MC_ImmediateStop_instance (...
  • Page 238: Function

    3 Axis Command Instructions Data Valid Name Meaning Description type range ErrorID Error Code WORD Contains the error code when an error occurs. A value of 16#0000 indicates normal execution. The upper four digits of the event code give the error code for ErrorID. Refer to the NY-series Troubleshooting Manual (Cat.
  • Page 239 3 Axis Command Instructions Precautions for Correct Use Refer to 1-1-3 Precautions for Master and Auxiliary Axes in Synchronized Control on page 1-6 for precautions on the master axis. Timing Charts • Busy (Executing) changes to TRUE when Execute changes to TRUE. •...
  • Page 240 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the 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 axis and an immediate stop is performed.
  • Page 241 3 Axis Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-153 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 242: 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 Graphic expression ST expression MC_SetPosition Set Position MC_SetPosition_instance ( MC_SetPosition_instance Axis :=parameter, MC_SetPosition Execute :=parameter, Axis Axis Execute...
  • Page 243: Function

    3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range 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 244 3 Axis Command Instructions If you execute this instruction on an encoder axis, the actual current position will change to the specified target position. • Specify the target position in absolute coordinates. • The actual current position changes at the same time as the command current position changes. The following error is kept the same before and after the change.
  • Page 245 3 Axis Command Instructions Timing Charts  Execution While Axis Is Stopped The actual position starts changing when Execute changes to TRUE. Busy (Executing) changes to TRUE when Execute changes to TRUE. Done changes to TRUE after the actual position is changed. Execute Done Busy...
  • Page 246 3 Axis Command Instructions Previous Instruction (Example MC_MoveAbsolute) Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Point where actual position is 200 mm Current Instruction (MC_SetPosition) Execute Done Busy The actual position changes to 800 mm and reverse operation Velocity is performed to move to a position of 400 mm.
  • Page 247 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559).  Execution during Execution of Other Instructions You cannot use the MC_SetPosition instruction on an axis for which any of the following instructions is being executed.
  • Page 248 3 Axis Command Instructions  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-160 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 249: Mc_Setoverride

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

    3 Axis Command Instructions Data Valid Name Meaning Description type range Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE 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.
  • Page 251 3 Axis Command Instructions • If the velocity override factor is set to 0, the target velocity will be 0. Axis operation will decelerate to a velocity of 0, and operation will continue. If you want to pause the axis motion while maintaining the operation status, set the override factor to Status.Discrete and Status.Continuous in the Axis Variable do not change at this time.
  • Page 252 3 Axis Command Instructions Previous Instruction: MC_MoveAbsolute Execute Done Busy Active CommandAborted Current Instruction Enable VelFactor Enabled Busy Velocity Override factor: 200% Override factor: 100% Override factor: 50% Time If the MC_SetOverride instruction is disabled, the target velocity returns to an override factor of 100%. ...
  • Page 253 3 Axis Command Instructions Previous Instruction: MC_MoveVelocity Execute InVelocity Busy Active Current Instruction Enable VelFactor Enabled Busy Velocity Override factor: 200% Override factor: 100% Override factor: 50% Time Re-execution of Motion Control Instructions You cannot re-execute motion instructions with enable-type inputs. Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 254 3 Axis Command Instructions  Timing Chart When Error Occurs Enable VelFactor Enabled Busy Error ErrorID Error code 16#0000 Velocity Override factor: 200% Override factor: 100% Time  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-166 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 255: Mc_Resetfollowingerror

    3 Axis Command Instructions MC_ResetFollowingError The MC_ResetFollowingError instruction resets the following error between the command current po- sition and the actual current position. Instruction Name Graphic expression ST expression MC_ResetFollowingError Reset MC_ResetFollowingError_in- MC_ResetFollowingError_instance Fol- stance ( MC_ResetFollowingError lowing Axis :=parameter, Axis Axis Error...
  • Page 256: Function

    3 Axis Command Instructions Data Valid Name Meaning Description type range 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. The upper four digits of the event code give the error code for ErrorID.
  • Page 257 3 Axis Command Instructions For example, when a following error occurs in the holding operation shown below, you can execute this instruction to implement a position command in the reverse direction and therefore set the fol- lowing error to 0. CommandAborted for the instruction for which the following error occurred changes to TRUE and instruction execution is aborted.
  • Page 258 3 Axis Command Instructions  Applicable Axes and Execution Condition • You can use this instruction for servo and virtual servo axes in the following cases. During single-axis position control During the MC_MoveVelocity (Velocity Control) instruction During synchronized control • An error occurs if the instruction is executed for an encoder or virtual encoder axis. ...
  • Page 259 3 Axis Command Instructions MC_MoveAbsolute instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_ResetFollowingError instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Position Command position Actual position Time Velocity Holding status Command velocity Actual velocity Time Re-execution of Motion Control Instructions This instruction cannot be re-executed.
  • Page 260 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the 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 261 3 Axis Command Instructions MC_MoveAbsolute instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_ResetFollowingError Instruction Execute Done Busy Active CommandAborted Error Error code ErrorID 16#0000  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-173 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 262: 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 Slave Slave CamTable :=parameter, CamTable CamTable...
  • Page 263 3 Axis Command Instructions Name Meaning Data type Valid range Description fault StartMode Start Mode _eMC_START_MO 0: _mcAbsolutePosi- Specify the coordinates used by tion MasterStartDistance. 1: _mcRelativePosi- 0: Absolute position tion 1: Relative position StartPosition Cam Table LREAL Negative number, Specify the starting point of the Start Posi- positive number, or 0...
  • Page 264 3 Axis Command Instructions Name Meaning Data type Valid range Description fault CamTransition Cam Tran- _eMC_CAM_TRAN 0: _mcCTNone (Reserved) (Reserved) sition Se- SITION lection BufferMode Buffer _eMC_BUF- 0: _mcAborting Specify the behavior when execut- Mode Se- FER_MODE 1: _mcBuffered ing more than one motion instruc- lection tion.
  • Page 265 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 266: Function

    3 Axis Command Instructions 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 • The MC_CamIn instruction executes a cam motion that synchronizes the master axis phase and slave axis displacement according to a cam table.
  • Page 267 3 Axis Command Instructions 1 cycle Command position during electronic cam operation The phase is calculated from the master axis position for each cycle. The linear interpolation of cam data is used to calculate displacements from the phases. (These are the red dots on the line.) Displace- ment Phase...
  • Page 268 3 Axis Command Instructions TYPE (*Cam data structure*) _sMC_CAM_REF : STRUCT Phase : REAL; (*Phase*) Distance : REAL; (*Displacement*) END_STRUCT; END_TYPE Create the cam data variables on the Sysmac Studio. You can specify a name for the cam table name (i.e., the name of the cam data variable). For example, if you make a cam table called MyCam1 with 1,000 points, use the following variable declaration, which is automatically made by the Sysmac Studio.
  • Page 269 3 Axis Command Instructions Relative amounts are applied to the phase and displacements in the cam table so that the start point is zeroed. The absolute position of each axis at each phase is the relative value from the absolute posi- tion of the axis at the start point of the cam table.
  • Page 270 3 Axis Command Instructions axis passes 80° . For condition 2, cam operation starts in the middle of the cam table, so the slave axis will accelerate rapidly. *1. Because StartMode is set to _mcRelativePosition, the cam operation starts at StartPosition + MasterStartDistance, or 80°.
  • Page 271 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 MasterStartDistance (Master Following Distance) and rapid acceleration is prevented.
  • Page 272 3 Axis Command Instructions For condition 3, the InCam (Cam Motion) changes to TRUE when the master axis passes 40°. Then, the InSync output variable changes to TRUE and the slave axis starts cam operation when the master axis passes 120° *1.
  • Page 273 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 274 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 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 275 3 Axis Command Instructions Reciprocal Cam Operation Slave axis Distance of one cam rotation Displace- ment Starting position Starting position Master axis Feeding Cam Operation Distance of one cam rotation Slave axis Displace- ment Starting position Starting position Master axis ...
  • Page 276 3 Axis Command Instructions Master scaling  Offset You can shift the phase and displacement by an offset from the specified cam table. You can specify separate offsets for the master axis phase and slave axis displacement. MasterOffset > 0 Displacement One period MasterOffset = 100...
  • Page 277 3 Axis Command Instructions Displacement SlaveOffset = 50 Cam table start position Phase SlaveOffset < 0 Displacement Phase SlaveOffset = −50 Cam table start position  ReferenceType (Position Type Selection) Any of the following position types can be selected for the master axis to which the slave axis is synchronized.
  • Page 278 3 Axis Command Instructions Precautions for Correct Use Here, the task period is the primary period. The periodic task is the primary periodic task. 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.
  • Page 279 3 Axis Command Instructions Slave position Time Master position Time _mcNegativeDirection Cam operation starts when the master axis is moving in the negative direction. Slave position Time Master position Time 3-191 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 280 3 Axis Command Instructions Additional Information If MasterStartDistance (Master Following Distance) is exceeded while the master axis is moving in the opposite direction from Direction (Direction) and InSync (In Sync) changes to TRUE, the operation will be as follows: • When InSync (In Sync) changes to TRUE, the slave axis moves to the displacement accord- ing to the phase in the cam table.
  • Page 281 3 Axis Command Instructions Buffer Mode Selection Description Buffered The buffered instruction is executed automatically starting from the period in which the current instruction is completed normally. When the master axis passes StartPosition (Cam Table Start Position) and then passes MasterStartDistance (Master Following Distance), the cam operation of the slave axis starts and the InSync output variable changes to TRUE.
  • Page 282 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 283 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  Index Of the two cam data used to find the command positions of the master and slave axes, the one with the smaller cam data index number is output to the Index output variable.
  • Page 284 3 Axis Command Instructions Master Axis Position MasterStartDistance StartPosition Slave axis position Execute InCam InSync EndOfProfile Busy Active  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.
  • Page 285 3 Axis Command Instructions Master Axis Position MasterStartDistance StartPosition Slave axis position Decel- eration Velocity of 0 MC_CamIn Execute InCam InSync EndOfProfile Busy Active MC_CamOut Execute Done Busy  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.
  • Page 286 3 Axis Command Instructions Master Axis Position MasterStartDistance StartPosition Slave axis position Deceleration stopping MC_CamIn Execute InCam InSync EndOfProfile Busy Active MC_Stop Execute Done Busy Active 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.
  • Page 287 3 Axis Command Instructions Master axis position MasterStartDistance StartPosition Deceleration Slave axis position stopping Execute InCam InSync Busy Active CommandAborted Re-execution of Motion Control Instructions You can re-execute this instruction to change the cam table during operation. To change any condi- tions other than the cam table, use multi-execution of instructions for this instruction.
  • Page 288 3 Axis Command Instructions  Execution of Other Instructions during Instruction Execution Multi-execution of instructions cannot be used for the MC_GenerateCamTable (Generate Cam Table) instruction during execution of an MC_CamIn instruction for which the same cam table is specified with CamTable. To use multi-execution of motion instructions for this instruction, specify the slave axis.
  • Page 289: Sample Programming 1

    3 Axis Command Instructions If blending is used for multi-execution of two MC_CamIn (Start Cam Operation) instructions, the in- structions that shift the phase are not aborted as CommandAborted does not change to TRUE, and processing is continued. 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).
  • Page 290 3 Axis Command Instructions  Setting Axis Parameters Axis Types Axis Axis Type Axis 1 Servo axis (master axis) Axis 2 Servo axis (slave axis) Count Modes Axis Count Mode Axis 1 Rotary Mode Axis 2 Linear Mode Ring Counter Modulo Modulo Axis...
  • Page 291 3 Axis Command Instructions If the cam table start point position (zero phase position) is 20°, the slave axis starts operation when the master axis reaches a position where the relative angle from that point is 40°. Cam operation operates in a periodic motion. If Periodic is TRUE, periodic operation is performed.
  • Page 292: Sample Programming 2

    3 Axis Command Instructions Name Data type Default Comment Camout_Ex BOOL FALSE The CAMOUT instance of MC_CamOut is executed while this variable is TRUE. StartPg BOOL FALSE The Servo is turned ON if this variable is TRUE and EtherCAT process data com- munications are established.
  • Page 293 3 Axis Command Instructions If the Servo Drive for axis 1 is ready, the Servo is turned ON. PWR1 MC_Power Pwr1_S MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID If the Servo Drive for axis 2 is ready, the Servo is turned ON. PWR2 MC_Power Pwr2_S...
  • Page 294 3 Axis Command Instructions The MC_MoveVelocity (Velocity Control) instruction is executed after homing is completed for axis 1. MC_MoveVelocity Vel_InVel MC_Axis000 Axis Axis Hm1_D Execute InVelocity LREAL#1000.0 Velocity Busy Vel_Bsy LREAL#100000.0 Acceleration Active Vel_Act LREAL#100000.0 Deceleration CommandAborted Vel_Ca Jerk Error Vel_Err _eMC_DIRECTION#_mcPositiveDirection Direction...
  • Page 295 3 Axis Command Instructions IF MC_Axis001.Act.Pos>LREAL#1000.0 THEN Camout_Ex := TRUE; END_IF; 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 TRUE while there is a minor fault level error for axis 1.
  • Page 296 3 Axis Command Instructions Name Data type Default Comment Camin_Ex BOOL FALSE This variable is changed to TRUE when Vel_InVel changes to TRUE to change Execute for the CAMIN instance of MC_CamIn to TRUE. InitFlag BOOL FALSE This variable indicates if it is necessary to set the input parameters.
  • Page 297 3 Axis Command Instructions Camin_EM := TRUE; // Periodic Mode Camin_StMode :=_eMC_START_MODE#_mcRelativePosition; Camin_StPos := LREAL#20.0; // Master axis absolute position for start point Camin_MStDis := LREAL#40.0; // Master axis position to start cam operation Camin_MSc := LREAL#1.0; // Master axis scaling Camin_SSc := LREAL#1.0;...
  • Page 298 3 Axis Command Instructions // Program the FaultHandler according to the device. IF (MC_Axis000.MFaultLvl.Active=TRUE) OR (MC_Axis001.MFaultLvl.Active=TRUE)THEN FaultHandler(); END_IF; // If the Servo is ON for axis 1 and home is not defined, the Home instruction is e xecuted for axis 1. IF (Pwr1_S=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN Hm1_Ex:=TRUE;...
  • Page 299 3 Axis Command Instructions // 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 := MC_Axis000, Execute := Hm1_Ex, Done =>...
  • Page 300 3 Axis Command Instructions // MC_CamIn CAMIN( Master := MC_Axis000, Slave := MC_Axis001, CamTable := CamProfile0, Execute := Camin_Ex, Periodic := Camin_EM, 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,...
  • Page 301 3 Axis Command Instructions 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.  Setting Axis Parameters Axis Types Axis Axis Type...
  • Page 302 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 303 3 Axis Command Instructions Each axis periodically executes the specified cam operation. 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.
  • Page 304 3 Axis Command Instructions  Timing Chart Axis 1 MC_Axis000.Cmd.Pos Axis 2 MC_Axis001.Cmd.Pos Axis 3 MC_Axis002.Cmd.Pos Axis 4 MC_Axis003.Cmd.Pos Axis 5 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 305 3 Axis Command Instructions Lock3 StartPg MC_Axis002.DrvStatus.Ready Lock4 StartPg MC_Axis003.DrvStatus.Ready Lock5 StartPg MC_Axis004.DrvStatus.Ready If the Servo Drives are ready, the Servos are turned ON for each axis. PWR1 MC_Power Pwr1_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID PWR2...
  • Page 306 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 307 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 308 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 309 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 310 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 311 3 Axis Command Instructions // MC_MoveVelocity Input Parameter Vel_Vel := LREAL#1000.0; Vel_Acc := LREAL#0.0; Vel_Dec := LREAL#0.0; Vel_Dir :=_eMC_DIRECTION#_mcPositiveDirection; // MC_CamIn Input Parameter Camin1_Em := TRUE; Camin1_Sm :=_eMC_START_MODE#_mcAbsolutePosition; Camin1_Sp := LREAL#0.0; Camin1_Msd := LREAL#0.0; Camin1_Ms := LREAL#1.0; Camin1_Ss := LREAL#1.0; Camin1_Mo := LREAL#30.0;...
  • Page 312 3 Axis Command Instructions Camin4_So := LREAL#0.0; Camin4_Rt := _eMC_REFERENCE_TYPE#_mcCommand; Camin4_Dir := _eMC_DIRECTION#_mcNoDirection; // Change InitFlag to TRUE after setting the input parameters. InitFlag := TRUE; END_IF; // If StartPg is TRUE and the Servo Drive is ready, the Servo for axis 1 is turned // If the Servo Drive is not ready, the Servo is turned OFF.
  • Page 313 3 Axis Command Instructions END_IF; // If StartPg is TRUE and the Servo Drive is ready, the Servo for axis 5 is turned // If the Servo Drive is not ready, the Servo is turned OFF. IF (StartPg=TRUE) AND (MC_Axis004.DrvStatus.Ready=TRUE) THEN Pwr5_En:=TRUE;...
  • Page 314 3 Axis Command Instructions // If the Servo is ON for axis 5 and home is not defined, the Home instruction is e xecuted for axis 5. IF (Pwr5_Status=TRUE) AND (MC_Axis004.Details.Homed=FALSE) THEN Hm5_Ex:=TRUE; END_IF; // After homing is completed for axis 1, MC_MoveVelocity is executed. IF Hm1_D=TRUE THEN Vel_Ex:=TRUE;...
  • Page 315 3 Axis Command Instructions Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_Status, Busy => Pwr2_Bsy, Error => Pwr2_Err, ErrorID => Pwr2_ErrID // MC_Power for axis 3 PWR3( Axis := MC_Axis002, Enable := Pwr3_En, Status => Pwr3_Status, Busy => Pwr3_Bsy, Error =>...
  • Page 316 3 Axis Command Instructions // MC_Home for axis 2 HM2( Axis := MC_Axis001, Execute := Hm2_Ex, Done => Hm2_D, Busy => Hm2_Bsy, CommandAborted => Hm2_Ca, Error => Hm2_Err, ErrorID => Hm2_ErrID // MC_Home for axis 3 HM3( Axis := MC_Axis002, Execute := Hm3_Ex, Done =>...
  • Page 317 3 Axis Command Instructions 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 => Vel_ErrID // MC_CamIn CAMIN1( Master := MC_Axis000,...
  • Page 318 3 Axis Command Instructions Periodic := Camin2_Em, StartMode := Camin2_Sm, StartPosition := Camin2_Sp, MasterStartDistance := Camin2_Msd, MasterScaling := Camin2_Ms, SlaveScaling := Camin2_Ss, MasterOffset := Camin2_Mo, SlaveOffset := Camin2_So, ReferenceType := Camin2_Rt, Direction := Camin2_Dir, InCam => Camin2_InCam, InSync => Camin2_InSync, EndOfProfile =>...
  • Page 319 3 Axis Command Instructions CAMIN4( Master := MC_Axis000, Slave := MC_Axis004, CamTable := CamProfile0, Execute := Camin4_Ex, Periodic := Camin4_Em, StartMode := Camin4_Sm, StartPosition := Camin4_Sp, MasterStartDistance := Camin4_Msd, MasterScaling := Camin4_Ms, SlaveScaling := Camin4_Ss, MasterOffset := Camin4_Mo, SlaveOffset := Camin4_So, ReferenceType := Camin4_Rt, Direction := Camin4_Dir, InCam =>...
  • Page 320: Mc_Camout

    3 Axis Command Instructions MC_CamOut The MC_CamOut instruction ends cam operation for the axis specified with the input parameter. Instruction Name Graphic expression ST expression MC_CamOut End Cam Op- MC_CamOut_instance ( MC_CamOut_instance eration Slave :=parameter, MC_CamOut Execute :=parameter, Slave Slave Execute Done Deceleration :=parameter,...
  • Page 321: Function

    3 Axis Command Instructions Data Valid Name Meaning Description type range 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. The upper four digits of the event code give the error code for ErrorID.
  • Page 322 3 Axis Command Instructions Precautions for Correct Use • Cam data variables are global variables. You can therefore access or change the values of cam data variables from more than one task. If you change the values of cam data variables from more than one task, program the changes so that there is no competition in writing the value from more than one task.
  • Page 323 3 Axis Command Instructions Master axis position MasterStartDistance Error StartPosition occurs in slave axis. Slave axis position Error occurs in slave axis. Deceleration stopping Deceleration stopping MC_CamIn Execute InCam InSync Busy Active MC_CamOut Execute Done Busy CommandAborted Re-execution of Motion Control Instructions This instruction cannot be re-executed.
  • Page 324 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 325: Mc_Cammonitor

    3 Axis Command Instructions MC_CamMonitor The MC_CamMonitor instruction monitors information on the cam operation. Instruction Name Graphic expression ST expression MC_CamMonitor Cam Monitor MC_CamMonitor_instance( MC_CamMonitor_instance Axis :=parameter , MC_CamMonitor CamTable :=parameter, Axis Axis CamTable CamTable CamMonitorValue :=parameter, CamMonitorValue CamMonitorValue Enable :=parameter, Enable Enabled MasterScaling :=parameter,...
  • Page 326 3 Axis Command Instructions Output Variables Name Meaning Data type Valid range Description Enabled Enable BOOL TRUE or FALSE TRUE when control is in progress. Valid Cam Monitor Val- BOOL TRUE or FALSE TRUE when CamMonitorValue (Cam Monitor Values) is a ues Valid valid value.
  • Page 327 3 Axis Command Instructions  _sMC_CAM_MONITOR_DISTANCEDIFF (Cam Monitor Displacement Following Error) Name Meaning Data type Description CamProfileDa- Cam Profile Data _sMC_CAM_PRO- Contains basic information on the cam operation such FILE_DATA as the phase and displacement. DistanceDiff Displacement Fol- LREAL Contains the difference between the axis command lowing Error position and Distance (Slave Axis Displacement).
  • Page 328: Function

    3 Axis Command Instructions Cam table displacement Distance (Slave Axis Displacement) Phase (Master Axis Phase) Phase Function The MC_CamMonitor (Cam Monitor) instruction monitors information on the cam operation that is specified with CamTable (Cam Table) and CamMonitorMode (Cam Monitor Mode Selection). Based on the phase of the master axis in the MC_CamIn (Start Cam Operation) instruction that is exe- cuted immediately before this instruction, the cam operation information specified with CamTable (Cam Table) and CamMonitorMode (Cam Monitor Mode Selection) is output to CamMonitorValue...
  • Page 329 3 Axis Command Instructions Obtain a value by eliminating influence of scaling from the obtained phase, and output the value to CamMonitorValue (Cam Monitor Values) as the phase. Cam table currently in use Current phase Cam table displacement Phase Cam table specified with CamTable Cam table displacement Phase...
  • Page 330 3 Axis Command Instructions Cam motion Current interrupted value Master axis position Time Cam table displacement Distance (Slave Axis Displacement) Phase Phase (Master Axis Phase) Slave axis DistanceDiff command position (Displacement Following Error) Time The command current position of the slave axis can be moved onto the cam profile curve by using the monitored DistanceDiff (Displacement Following Error).
  • Page 331 3 Axis Command Instructions Cam motion interrupted Slave axis command position Time MC_CamIn instruction Execute InCam InSync Busy Active CommandAborted MC_CamMonitor instruction Enable Enabled Valid Busy Phase Disabled Enabled Distance Disabled Enabled DistanceDiff Disabled Enabled 3-243 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 332 3 Axis Command Instructions Precautions for Correct Use A displacement following error is calculated based on the MasterReferencePosition (Master Ax- is Reference Position) and SlaveReferencePosition (Slave Axis Reference Position), instead of the start position of the cam motion. The following shows an example with a feeding cam for which the displacement of the end point is not 0.
  • Page 333: Precautions For Correct Use

    3 Axis Command Instructions  Timing Chart When Error Occurs Enable Busy Error ErrorID 16#0000 Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. Precautions for Correct Use In any of the following cases, Valid (Cam Monitor Values Valid) changes to FALSE, and CamMonitorValue (Cam Monitor Values) is not updated.
  • Page 334: 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 Graphic expression ST expression MC_GearIn Start Gear MC_GearIn_instance ( MC_GearIn_instance Operation Master :=parameter, MC_GearIn Slave :=parameter, Master Master Slave Slave...
  • Page 335 3 Axis Command Instructions Name Meaning Data type Valid range Description fault Deceleration Decelera- LREAL Non-negative number Specify the deceleration rate. tion Rate The unit is command units/s Jerk Jerk LREAL (Reserved) (Reserved) BufferMode Buffer _eMC_BUF 0: _mcAborting Specify the behavior when executing Mode Se- FER_MOD 1: _mcBuffered...
  • Page 336: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to other motion control instruction was executed FALSE. with the Buffer Mode set to Aborting. •...
  • Page 337 3 Axis Command Instructions Specified with ReferenceType. Gear function Numerator Actual position Command position Denominator Remainder Command position Most recent command position • After operation starts, Slave (Slave Axis) uses the velocity of Master (Master Axis) multiplied by the gear ratio for its target velocity, and accelerates/decelerates accordingly. •...
  • Page 338 3 Axis Command Instructions Position Catching Phase InGear phase Master Travel distance of slave axis RatioNumerator = Travel distance of master axis × RatioDenominator Slave Execute Time • Electronic gear operation starts when Execute changes to TRUE.  ReferenceType (Position Type Selection) You can select one of the following position types.
  • Page 339 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 or _mcLatestCommand _mcFeedback Servo axis Encoder axis Virtual servo axis Virtual encoder...
  • Page 340 3 Axis Command Instructions Velocity Velocity MC_GearIn executed. InGear phase Acceleration Deceleration InGear phase MC_GearIn executed. Time Time When the Acceleration (Acceleration Rate) or Deceleration (Deceleration Rate) is 0 and you execute this instruction, the axis will reach the target velocity without accelerating or decelerating. Velocity Velocity The axis enters InGear phase state...
  • Page 341 3 Axis Command Instructions Execute InGear Busy Active CommandAborted Error ErrorID 16#0000 Velocity Master axis velocity MC_GearIn re-executed. Time 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 Denomina- tor).
  • Page 342 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 343: 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 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.
  • Page 344 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 345 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 estab- lished. Vel_InVel BOOL FALSE This variable is assigned to the InVelocity output var- iable from the VEL instance of the MC_MoveVelocity instruction.
  • Page 346 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  Sample Programming If StartPg is TRUE, check that the Servo Drives for each axis are ready.
  • Page 347 3 Axis Command Instructions If the Servo Drives are ready, the Servos are turned ON for each axis. PWR1 MC_Power Pwr1_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID PWR2 MC_Power Pwr2_Status MC_Axis001 Axis Axis Lock2 Enable Status Busy...
  • Page 348 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 349 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 350 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 ...
  • Page 351 3 Axis Command Instructions Vel_Dec := LREAL#2000.0; Vel_Dir :=_eMC_DIRECTION#_mcPositiveDirection; // MC_GearIn1 parameters Gearin1_Rn := UINT#1; Gearin1_Rd := UINT#2; Gearin1_Rt :=_eMC_REFERENCE_TYPE#_mcFeedback; Gearin1_Acc := LREAL#4000.0; Gearin1_Dec := LREAL#4000.0; // MC_GearIn2 parameters Gearin2_Rn := UINT#2; Gearin2_Rd := UINT#3; Gearin2_Rt :=_eMC_REFERENCE_TYPE#_mcFeedback; Gearin2_Acc := LREAL#4000.0; Gearin2_Dec := LREAL#4000.0;...
  • Page 352 3 Axis Command Instructions // If the Servo Drive is not ready, the Servo is turned OFF. IF (StartPg=TRUE) AND (MC_Axis002.DrvStatus.Ready=TRUE) THEN Pwr3_En:=TRUE; ELSE Pwr3_En:=FALSE; END_IF; // If a minor fault level error occurs for axis 1 to axis 3, the error handler for the device (FaultHandler) is executed.
  • Page 353 3 Axis Command Instructions ErrorID => Pwr1_ErrID // MC_Power for axis 2 PWR2( Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_Status, Busy => Pwr2_Bsy, Error => Pwr2_Err, ErrorID => Pwr2_ErrID // MC_Power for axis 3 PWR3( Axis := MC_Axis002, Enable := Pwr3_En, Status =>...
  • Page 354 3 Axis Command Instructions Acceleration := Gearin1_Acc, Deceleration := Gearin1_Dec, InGear => Gearin1_InGear, Busy => Gearin1_Bsy, Active => Gearin1_Act, CommandAborted => Gearin1_CA, Error => Gearin1_Err, ErrorID => Gearin1_ErrID // MC_GearIn with axis 1 as master axis and axis 3 as slave axis GEARIN2( Master := MC_Axis000, Slave := MC_Axis002,...
  • Page 355: 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 356 3 Axis Command Instructions Name Meaning Data type Valid range Description fault ReferenceType Position _eMC_REF- 0: _mcCommand Specify the position type. Type Selec- ERENCE_TYP 1: _mcFeedback 0: Command position (value calcu- tion 2: _mcLatestCommand lated in the previous task period 1: Actual position (value obtained in the same task period 2: Command position (value calcu-...
  • Page 357 3 Axis Command Instructions Data Valid Name Meaning Description type range CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted. Aborted FALSE Error Error BOOL TRUE or TRUE while there is an error. FALSE ErrorID Error Code WORD Contains the error code when an error occurs.
  • Page 358: Function

    3 Axis Command Instructions 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 • The MC_GearInPos instruction performs gear operation for the slave axis specified with Slave (Slave Axis).
  • Page 359 3 Axis Command Instructions Catching phase InGear phase MasterSyncPosition SlaveSyncPosition Time Instruction executed. StartSync InSync Busy Active • If the gear ratio is negative, the Slave (Slave Axis) and the Master (Master Axis) move in the oppo- site directions. Catching phase InGear phase MasterSyncPosition SlaveSyncPosition...
  • Page 360 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).
  • Page 361 3 Axis Command Instructions 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 calcu- late the command position of the slave axis in the current period.
  • Page 362 3 Axis Command Instructions • If another instruction aborts this instruction, CommandAborted changes to TRUE, and Busy (Execut- ing), Active (Controlling), StartSync (Following), and InSync change to FALSE. Execute StartSync InSync Busy Active CommandAborted Error ErrorID 16#0000 Velocity InSyncPhase CatchingPhase Time The operation when this instruction is aborted by another instruction is shown below.
  • Page 363 3 Axis Command Instructions Execute StartSync InSync Busy Active CommandAborted Error ErrorID 16#0000 Velocity InSyncPhase CatchingPhase Time 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...
  • Page 364 3 Axis Command Instructions Velocity Velocity Catching phase InSync phase Accel- Deceleration eration InSync phase Catching phase Time Time 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.
  • Page 365: Sample Programming

    3 Axis Command Instructions  Timing Chart When Error Occurs Execute StartSync InSync Busy Active CommandAborted Error ErrorID Error code 16#0000 The slave axis is not affected by the error status of the master axis during synchronized control. After the error status of the master axis is cleared, the slave axis continues electronic gear operation when the master axis operates.
  • Page 366 3 Axis Command Instructions Modulo Modulo Axis maximum minimum position position Axis 1 Axis 2 Units of Display Axis Unit of Display Axis 1 degree Axis 2 degree Operation Example Axis 1 1 : 2 Axis 2  Operation Pattern Axis 1 position Pos1 Time...
  • Page 367 3 Axis Command Instructions When the command velocity of the master axis reaches the target velocity, InVelocity (Target Ve- locity Reached) of the master axis changes to TRUE. Executing the Slave Axis When InVelocity (Target Velocity Reached) of the master axis changes to TRUE, the slave axis (axis 2) performs gear operation with a gear ratio of 1:2 against the actual position of the master axis.
  • Page 368 3 Axis Command Instructions  Timing Chart Pwr1_Status Pwr2_Status Hm1_D Hm1_Bsy Hm2_D Hm2_Bsy Vel_InVel Vel_Bsy Vel_Act 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 If StartPg is TRUE, check that the Servo Drives for each axis are ready. Lock1 StartPg MC_Axis000.DrvStatus.Ready...
  • Page 369 3 Axis Command Instructions If the Servo Drives are ready, the Servos are turned ON for each axis. PWR1 MC_Power Pwr1_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID PWR2 MC_Power Pwr2_Status MC_Axis001 Axis Axis Lock2 Enable Status Busy...
  • Page 370 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 371 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. Hm1_D BOOL FALSE...
  • Page 372 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 ...
  • Page 373 3 Axis Command Instructions Vel_Dir :=_eMC_DIRECTION#_mcPositiveDirection; // MC_GearInPos parameters Pos1 := LREAL#300.0; Pos2 := LREAL#200.0; Gearinpos_Rn := UINT#1; 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;...
  • Page 374 3 Axis Command Instructions xecuted. IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN Hm1_Ex:=TRUE; END_IF; // If the Servo is ON for axis 2 and home is not defined, the Home instruction is e xecuted. IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN Hm2_Ex:=TRUE; END_IF; // After homing is completed for axis 1, MC_MoveVelocity is executed. IF Hm1_D=TRUE THEN Vel_Ex := TRUE;...
  • Page 375 3 Axis Command Instructions Busy => Hm1_Bsy, CommandAborted => Hm1_Ca, Error => Hm1_Err, ErrorID => Hm1_ErrID // MC_Home for axis 2 HM2( Axis := MC_Axis001, Execute := Hm2_Ex, Done => Hm2_D, Busy => Hm2_Bsy, CommandAborted => Hm2_Ca, Error => Hm2_Err, ErrorID =>...
  • Page 376 3 Axis Command Instructions InSync => Gearinpos_InSync, Busy => Gearinpos_Bsy, Active => Gearinpos_Act, CommandAborted => Gearinpos_Ca, Error => Gearinpos_Err, ErrorID => Gearinpos_ErrID 3-288 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 377: 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 Graphic expression ST expression MC_GearOut End Gear MC_GearOut_instance ( MC_GearOut_instance Operation Slave :=parameter, MC_GearOut Execute :=parameter, Slave Slave Execute...
  • Page 378: Function

    3 Axis Command Instructions Data Valid Name Meaning Description type range CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted. Aborted FALSE Error Error BOOL TRUE or TRUE while there is an error. FALSE ErrorID Error Code WORD Contains the error code when an error occurs.
  • Page 379 3 Axis Command Instructions Timing Charts • Busy (Executing) changes to TRUE when Execute changes to TRUE. • Done changes to TRUE when the target velocity is reached. • If another instruction aborts this instruction, CommandAborted changes to TRUE and Busy (Execut- ing) changes to FALSE.
  • Page 380 3 Axis Command Instructions Velocity MC_GearOut executed. Time 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 NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 381 3 Axis Command Instructions  Timing Chart When Error Occurs Execute Done Busy CommandAborted Error ErrorID Error code 16#0000 Velocity Master axis velocity Time  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-293 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 382: 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 Synchronous MC_MoveLink_instance ( MC_MoveLink_instance Positioning Master :=parameter, MC_MoveLink Slave :=parameter, Master Master Slave Slave TriggerInput :=parameter, TriggerInput TriggerInput TriggerVariable :=parameter, TriggerVariable TriggerVariable...
  • Page 383 3 Axis Command Instructions Name Meaning Data type Valid range Default Description SlaveDis- Slave Axis LREAL Negative number, positive Specify the travel distance of tance Travel Dis- number, or 0 the slave axis. tance The unit is command units. MasterDis- Master Axis LREAL Non-negative number...
  • Page 384 3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range Done Done BOOL TRUE or TRUE when the instruction is completed. FALSE InSync In Sync BOOL TRUE or TRUE when synchronization is started. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged.
  • Page 385: Function

    3 Axis Command Instructions In-Out Variables Valid Name Meaning Data type Description range Master Master Axis _sAXIS_REF Specify the master axis. Slave Slave Axis _sAXIS_REF Specify the slave axis. TriggerInput Trigger Input Con- _sTRIG- Set the trigger condition. dition GER_REF TriggerVariable Trigger Variable BOOL...
  • Page 386 3 Axis Command Instructions • 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. For details on mapping data objects, refer to 2-3 PDO Mapping on page 2-37 and to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 387 3 Axis Command Instructions Precautions for Correct Use Here, the task period is the primary period. The periodic task is the primary periodic task. 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.
  • Page 388 3 Axis Command Instructions Master axis position MasterDistanceInDEC MasterDistance MasterDistanceInACC Master following distance Time Slave axis position SlaveDistance Time Slave axis velocity Time Master Axis Travel in Negative Direction Master axis position Master MasterDistanceInACC following distance MasterDistance MasterDistanceInDEC Time Slave axis position SlaveDistance Time Slave axis velocity...
  • Page 389 3 Axis Command Instructions Sec- Relationship between the master axis and slave axis travel distances tion Accel- Mas- Master Distance in Acceleration era- ter ax- tion Slave Master distance in acceleration Slave axis axis × travel Master distance (Master axis travel distance - Master distance in Master distance distance in acceleration...
  • Page 390 3 Axis Command Instructions Precautions for Correct Use You must map object data when LinkOption (Synchronization Start Condition) is set to _mcTriggerDetection and Mode is set to Drive Mode. Set the following objects. • Touch probe function (60B8 hex) • Touch probe status (60B9 hex) •...
  • Page 391 3 Axis Command Instructions Execute Done InSync Busy Active Master/slave axis position Master axis Slave axis Time Slave axis velocity Time LinkOption (Synchronization Start Condition) Set to 1: _mcTriggerDetection Execute TriggerInput Done InSync Busy Active Master/slave axis position Master axis Slave axis Time Slave axis...
  • Page 392 3 Axis Command Instructions LinkOption (Synchronization Start Condition) Set to 2: _mcMasterReach Execute Done InSync Busy Active Master/slave axis position Master axis Master following distance Slave axis Time Slave axis velocity Time  When an Instruction Is Executed with BufferMode Set to Aborting during Previ- ous Operation This section describes when this instruction is executed with LinkOption (Synchronization Start Condi- tion) set to 0: _mcCommandExecution (when instruction execution starts) while the previous opera-...
  • Page 393 3 Axis Command Instructions Previous Instruction: MC_MoveAbsolute (Absolute Positioning) Execute Done Busy Active CommandAborted Current Instruction Execute Done InSync Busy Active CommandAborted Slave axis velocity The velocity changes discontinuously when MC_MoveLink is started. Time  When an Instruction Is Executed with BufferMode (Buffer Mode Selection) Set to Buffered during Previous Operation This instruction is executed after the previous instruction is finished.
  • Page 394: Sample Programming

    3 Axis Command Instructions Execute Done InSync Busy Active CommandAborted Error ErrorID Error code 16#0000 Slave axis velocity Time Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). ...
  • Page 395 3 Axis Command 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 (master axis) Axis 2 Servo axis (slave axis) Count Modes Axis Count Mode Axis 1...
  • Page 396 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 Cutting with the Cutter...
  • Page 397 3 Axis Command Instructions Name Data type Default Comment Pwr1_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR1 instance of the MC_Power instruction. This variable changes to TRUE when the Servo is turned ON. Pwr2_Status BOOL FALSE...
  • Page 398 3 Axis Command Instructions If the Servo Drives are ready, the Servos are turned ON for each axis. PWR1 MC_Power Pwr1_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr1_Bsy Error Pwr1_Err ErrorID Pwr1_ErrID PWR2 MC_Power Pwr2_Status MC_Axis001 Axis Axis Lock2 Enable Status Busy...
  • Page 399 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 400 3 Axis Command Instructions Mv_Link_TrigRef.LatchID := _eMC_TRIGGER_LATCH_ID#_mcLatch1; Mv_Link_TrigRef.InputDrive := _eMC_TRIGGER_INPUT_DRIVE#_mcEXT; Mv_Link_TrigVar := FALSE; Mv_Link_SlvDis := LREAL#1000.0; Mv_Link_MasDis := LREAL#1000.0; Mv_Link_MasDisInAcc := LREAL#100.0; Mv_Link_MasDisInDec := LREAL#100.0; Mv_Link_LnkOpt := _eMC_LINKOPTION#_mcTriggerDetection; // Change InitFlag to TRUE after setting the input parameters. InitFlag := TRUE; Structured Text (ST) ...
  • Page 401 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  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;...
  • Page 402 3 Axis Command Instructions AND (MC_Axis000.DrvStatus.Ready=TRUE) 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 the Servo Drive is ready, the Servo for axis 2 is turned // If the Servo Drive is not ready, the Servo is turned OFF.
  • Page 403 3 Axis Command Instructions Actuator:=TRUE; ELSE Actuator:=FALSE; END_IF; // MC_Power1 PWR1( Axis := MC_Axis000, Enable := Pwr1_En, Status => Pwr1_Status, Busy => Pwr1_Bsy, Error => Pwr1_Err, ErrorID => Pwr1_ErrID // MC_Power2 PWR2( Axis := MC_Axis001, Enable := Pwr2_En, Status => Pwr2_Status, Busy =>...
  • Page 404 3 Axis Command Instructions // MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec, 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,...
  • Page 405: Mc_Combineaxes

    3 Axis Command Instructions MC_CombineAxes The MC_CombineAxes instruction outputs the sum or difference of the command positions of two ax- es as the command position. Instruction Name Graphic expression ST expression MC_CombineAx- Combine MC_CombineAxes_instance ( MC_CombineAxes_instance Axes Master :=parameter, MC_CombineAxes Auxiliary :=parameter, Master Master...
  • Page 406 3 Axis Command Instructions Name Meaning Data type Valid range Description fault RatioNumera- Auxiliary DINT Positive or negative 10000 (Reserved) torAuxiliary Axis Gear number (Reserved) Ratio Nu- merator RatioDenomi- Auxiliary UDINT Positive number 10000 (Reserved) natorAuxiliary Axis Gear (Reserved) Ratio De- nominator ReferenceTy- Master Axis...
  • Page 407: Function

    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 408 3 Axis Command Instructions Instruction Details From the starting point, the relative value of the Auxiliary (Auxiliary Axis) position is added to or sub- tracted from the relative value of the Master (Master Axis) position and is output as a relative value for the Slave (Slave Axis) command position.
  • Page 409 3 Axis Command Instructions Master Execute of Velocity MC_CombineAxes changes to TRUE Slave Execute of Time MC_CombineAxes Velocity changes to TRUE Position: 600 Position: 200 Auxiliary Execute of Time Velocity MC_CombineAxes Position: 0 Position: 390 changes to TRUE Time Position: 100 Position: 110 ...
  • Page 410 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 _mcFeedback _mcLatestCommand Servo axis Encoder axis Virtual servo axis Virtual encoder axis...
  • Page 411 3 Axis Command Instructions  CombineMode Set to 1: _mcSubAxes Execute InCombination Busy Active Command Aborted Error ErrorID 16#0000 Master axis position Auxiliary axis position Time Time Slave axis position Time 3-323 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 412 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 Control Instructions This instruction cannot be re-executed.
  • Page 413 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 InCombination Busy...
  • Page 414 3 Axis Command Instructions Execute InCombination Busy Active Command Aborted Error ErrorID 16#0000 Master axis position Time Auxiliary axis position Time Slave axis position Error occurs. Time If you clear the error for this instruction, the instruction will not start until Execute changes to TRUE again.
  • Page 415 3 Axis Command Instructions 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 Time  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-327 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 416: 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 Graphic expression ST expression MC_Phasing Shift Master MC_Phasing_instance ( MC_Phasing_instance Axis Phase Master :=parameter, MC_Phasing Slave :=parameter, Master Master Slave Slave Execute :=parameter,...
  • Page 417 3 Axis Command Instructions Name Meaning Data type Valid range Description fault BufferMode Buffer _eMC_BUF- 0: _mcAborting Specify the behavior when execut- Mode Se- FER_MODE ing more than one motion instruc- lection tion. 0: Aborting Refer to Unit Conversion Settings in the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 418: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because anoth- When Execute is TRUE and changes to er motion control instruction was executed with FALSE. the Buffer Mode set to Aborting.
  • Page 419 3 Axis Command Instructions • In the user program, place the MC_Phasing instruction after synchronized control instructions as shown below. GEARIN MC_GearIn MC_Axis000 Master Master MC_Axis001 Slave Slave StartGear Execute InGear G_Num RatioNumerator Busy G_Bsy G_Den RatioDenominator Active G_Act _eMC_REFERENCE_TYPE#_mcCommand ReferenceType CommandAborted G_Ca...
  • Page 420 3 Axis Command Instructions  Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Decel- eration Rate), and Jerk Set Velocity, Acceleration, Deceleration, and Jerk to specify the target velocity (shift velocity), acceler- ation rate, deceleration rate, and jerk for the phase shift amount. The target velocity (shift velocity) as viewed from the Slave (Slave Axis) is the velocity relative to the Master (Master Axis) velocity.
  • Page 421 3 Axis Command Instructions Additional Information Error detection for the results of the MC_Phasing instruction is performed for the operation of the synchronized Slave (Slave Axis). Therefore, error detection is not performed for the settings of the Velocity (Target Velocity), Acceleration (Acceleration Rate), and Deceleration (Deceleration Rate) variables when the MC_Phasing instruction is executed.
  • Page 422 3 Axis Command Instructions Error 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). 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 423: Mc_Torquecontrol

    3 Axis Command Instructions MC_TorqueControl The MC_TorqueControl instruction uses the Torque Control Mode of the Servo Drive to control the tor- que. Instruction Name Graphic expression ST expression MC_TorqueCon- Torque Con- MC_TorqueControl_instance ( MC_TorqueControl_instance trol trol Axis :=parameter, MC_TorqueControl Execute :=parameter, Axis Axis Execute...
  • Page 424 3 Axis Command Instructions Name Meaning Data type Valid range Description fault Direction Direction _eMC_DIREC- 0: _mcPositiveDirection Specify the direction of the target TION 2: _mcNegativeDirection torque. 0: Positive direction 2: Negative direction BufferMode Buffer _eMC_BUF- 0: _mcAborting Specify the behavior when execut- Mode Se- FER_MODE 1: _mcBuffered...
  • Page 425: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to other motion control instruction was executed FALSE. with the Buffer Mode set to Aborting. •...
  • Page 426 3 Axis Command Instructions If even one of the required objects is not set, a Process Data Object Setting Missing error (error code 3461 hex) occurs. For details on mapping data objects, refer to 2-3 PDO Mapping on page 2-37 and to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 427 • The axis velocity increases faster during torque control. Make sure that you set Velocity (ve- locity limit) for safety. • When you use an OMRON G5-series Servo Drive, set the Velocity Limit Selection (3317 hex) of the Servo Drive to 1 (velocity limit value via EtherCAT communications).
  • Page 428 Processing to change to CSP Mode is performed by the MC Function Module when the Status output 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 ac- knowledged from the MC Function Module when the Servo is OFF.
  • Page 429 3 Axis Command Instructions Timing Charts Starting and Stopping the Instruction Execute InTorque Busy Active Stopping with MC_Stop CommandAborted Current velocity Torque control Position control Velocity Axis current velocity Time Torque control Position control Torque Command torque Torque control for the velocity Torque limit of the Servo Drive Current torque...
  • Page 430 3 Axis Command Instructions Position Control Instruction (First Instruction) Execute Done Busy Active CommandAborted MC_TorqueControl Instruction (Second Instruction) Execute InTorque Busy Active CommandAborted Current velocity Position control Torque control Velocity Axis current When the axis is held velocity against the workpiece Time Position control Torque control...
  • Page 431 3 Axis Command Instructions Position Control Instruction (First Instruction) Execute Done Busy Active CommandAborted MC_TorqueControl Instruction (Second Instruction) Execute InTorque Busy Active CommandAborted Current velocity Torque control Position control Velocity Axis current velocity When the axis is held against the workpiece Time Position control Torque control...
  • Page 432 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 Func- tion 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 433 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 434 3 Axis Command Instructions When the motion control instruction is re-executed to change Torque (Target Torque), InTorque (Target Torque Reached) operates for the new target torque that was set at re-execution. For details on re-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 435 3 Axis Command Instructions  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-347 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 436: 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. Instruction Name Graphic expression ST expression MC_SetTorqueLi- Set Torque MC_SetTorqueLimit_instance ( MC_SetTorqueLimit_instance Limit Axis :=parameter, MC_SetTorqueLimit Enable :=parameter, Axis...
  • Page 437 3 Axis Command Instructions Name Meaning Data type Valid range Default Description NegativeValue Negative Tor- LREAL 0.1 to 1,000.0, 300.0 Set the torque limit in the negative direction que Limit or 0.0 in increments of 0.1%. If a value that exceeds the Maximum Negative Torque Limit axis parameter is input, the negative torque will be the Maximum Negative Torque Limit.
  • Page 438: Function

    3 Axis Command Instructions Function • The MC_SetTorqueLimit instruction sets the torque limits that are used by the Servo Drive. • When Enable is TRUE and PositiveEnable (Positive Direction Enable) changes to TRUE, control is performed with PositiveValue (Positive Torque Limit). When Enable is TRUE and NegativeEnable (Negative Direction Enable) changes to TRUE, control is performed with NegativeValue (Negative Torque Limit).
  • Page 439  Relation to Holding Operation of the MC_Home or MC_HomeWithParameter In- struction 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 Homing Operation Modes, 12: Proximity Reverse Turn/Holding Time and 13: No Home Proximity Input/Holding Home Input, to automatically start torque control in the holding direction.
  • Page 440 Communications User’s Manual (Cat. No. I586) or AC Servomotors/Servo Drives 1S-series with Built-in EtherCAT Communications and Safety Functionality User’s Manual (Cat. No. I621).  Settings for OMRON G5-series Servo Drives To use this instruction, you must use the Support Software of the servo drive to set Torque Limit Selection (3521 hex) in the Servo Drive.
  • Page 441 3 Axis Command Instructions The status of the Enabled output variable from this instruction, however, depends on the status of the Servo. Servo ON Servo OFF Status of Enabled TRUE FALSE If Enabled from this instruction is FALSE, the torque limits do not function on the Servo Drive. •...
  • Page 442 3 Axis Command Instructions Concretely, the torque limits of the instance that was executed last are valid. If Enable to the instance that was executed last changes to FALSE, the torque limits are disabled. 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).
  • Page 443: 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 444: Function

    3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range 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 445 3 Axis Command Instructions • You can set multiple zones for one axis, and these zones can overlap. You can also set zones out- side the software limits. Precautions for Correct Use If FirstPosition or LastPosition contains a non-terminating decimal number, e.g., resulting from division, error may cause unexpected processing results.
  • Page 446 3 Axis Command Instructions Set FirstPosition to a larger value than LastPosition. Modulo Maximum Position FirstPosition LastPosition Modulo Minimum Position InZone Zone Zone FirstPosition = 330° Zone : The positions indicated with open dots are not included. LastPosition = 210° ...
  • Page 447 3 Axis Command Instructions Timing Charts  When the Zone Is Entered during Operation or When Enable Changes to FALSE Within the Zone Enable Enabled InZone Enters zone. Exits zone. Enters zone. Enable changes to FALSE. Busy  When Inside the Zone before the Instruction Is Executed and Then the Zone Is Exited Enable Enabled...
  • Page 448 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. 3-360 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 449: 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 Exter- MC_TouchProbe_instance ( MC_TouchProbe_instance nal Latch Axis :=parameter, MC_TouchProbe TriggerInput :=parameter, Axis Axis TriggerInput TriggerInput TriggerVariable :=parameter,...
  • Page 450 3 Axis Command Instructions Name Meaning Data type Valid range Description fault ReferenceType Position _eMC_REFER- 1: _mcFeedback (Reserved) (Reserved) Type Selec- ENCE_TYPE tion StopMode Stopping _eMC_STOP_MOD 1: _mcImmediate- Specify the stopping method. Mode Se- Stop 1: Perform an immediate stop lection 4: _mcNonStop 4: Do not stop...
  • Page 451 3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to other motion control instruction was executed FALSE. with the Buffer Mode set to Aborting. •...
  • Page 452: Function

    3 Axis Command Instructions Function • Latching is used to control positioning based on the point where a trigger signal occurs, such as a signal from a sensor input. The position of the axis is recorded (i.e., latched) when the trigger signal occurs.
  • Page 453 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. • If you use an NX-series Pulse Output Unit, you can also perform latching with this instruction.
  • Page 454 • 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££ EtherCAT Encoder Input Slave. The OMRON GX-series GX-EC02££ EtherCAT Encoder Input Slaves cannot latch on the Z phase.
  • Page 455 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. Use the Sysmac Studio to make the setting.
  • Page 456 3 Axis Command Instructions TriggerInput Execute WindowOnly Done Busy RecordedPosition Position CommandAborted Error ErrorID 16#0000 Axis position LastPosition FirstPosition Position WindowOnly Set to TRUE Only trigger inputs within the window are detected to latch the axis position. Trigger enabled TriggerInput Execute WindowOnly Done...
  • Page 457 3 Axis Command Instructions 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 458 3 Axis Command Instructions FirstPosition > LastPosition − − Window only range FirstPosition FirstPosition LastPosition : The positions indicated with open dots are not included. LastPosition Window only range  StopMode • You can specify the StopMode for the specified Axis when a trigger occurs. •...
  • Page 459 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_AbortTrigger instruction and execute it to stop the axis. MC_TouchProbe Instruction TriggerInput Execute...
  • Page 460 3 Axis Command Instructions TriggerInput Execute WindowOnly Done Busy RecordedPosition CommandAborted Error ErrorID 16#0000 Error code Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). ...
  • Page 461 3 Axis Command Instructions MC_TouchProbe A TriggerInput Execute WindowOnly Done Busy RecordedPosition CommandAborted Error ErrorID 16#0000 MC_TouchProbe B Execute Done Busy CommandAborted Error ErrorID 16#0000 *1. Here, the trigger input signal of the Servo Drive or other device is used. Additional Information If _mcImmediateStop is specified for StopMode, CommandAborted for the second instruction changes to TRUE after the axis stops for the trigger.
  • Page 462: Sample Programming

    3 Axis 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. Sample Programming This section shows sample programming for position latching control by an external sensor. Parameter Settings The minimum settings required for this sample programming are given below.
  • Page 463 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.
  • Page 464 3 Axis Command Instructions Name Data type Default Comment Pwr_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR instance of the MC_Power instruction. This variable changes to TRUE when the Servo is turned ON. Pos1 LREAL This variable specifies the first position of the...
  • Page 465 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 466 3 Axis Command Instructions // 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 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.
  • Page 467 3 Axis Command Instructions // Change InitFlag to TRUE after setting the input parameters. InitFlag:=TRUE; END_IF; // If StartPg is TRUE and the Servo Drive is ready, the Servo is turned ON. // If the Servo Drive is not ready, the Servo is turned OFF. IF (StartPg=TRUE) AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN Pwr_En:=TRUE;...
  • Page 468 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, InVelocity =>...
  • Page 469: Mc_Aborttrigger

    3 Axis Command Instructions MC_AbortTrigger The MC_AbortTrigger instruction aborts a current latch operation. Instruction Name Graphic expression ST expression MC_AbortTrigger Disable Ex- MC_AbortTrigger_instance ( MC_AbortTrigger_instance ternal Latch Axis :=parameter, MC_AbortTrigger TriggerInput :=parameter, Axis Axis TriggerInput TriggerInput Execute :=parameter, Execute Done Done =>parameter, Busy Busy =>parameter,...
  • Page 470: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • •...
  • Page 471 3 Axis Command Instructions Precautions for Correct Use • If the MC_GroupEnable (Enable Axes Group) instruction was executed for the Axis that is specified for the MC_AbortTrigger (Disable External Latch) instruction, an error occurs for the MC_AbortTrigger instruction and it is not executed. •...
  • Page 472 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). MC_AbortTrigger Execute Done Busy CommandAborted Error ErrorID...
  • Page 473: Mc_Axesobserve

    3 Axis Command Instructions MC_AxesObserve The MC_AxesObserve instruction monitors the deviation between the command positions or the ac- tual positions for the specified axes 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 Er-...
  • Page 474 3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range Enabled Enable BOOL TRUE or TRUE when the axis is being controlled. FALSE Invalid Excessive Fol- BOOL TRUE or TRUE when the permitted following error between axes lowing Error be- FALSE is exceeded.
  • Page 475: Function

    3 Axis Command Instructions If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axis variable name for AT specifi- cation of a user-defined variable. This will allow you to specify the user-defined variable. If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Precautions for Correct Use Assign the master axis and slave axis to the same task.
  • Page 476 3 Axis Command Instructions Instruction Details This section describes the instruction in detail.  ReferenceType (Position Type Selection) Any of the following position types can be selected for the master axis to which the slave axis is synchronized. • _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 477 3 Axis Command Instructions The DeviatedValue (Following Error between Axes) is the shorter distance between the command current position of the Master (Master Axis) and the command current position of the Slave (Slave Axis) in the range of the ring counter. The sign of the DeviatedValue (Following Error between Axes) is the sign for the shorter direction, as given below.
  • Page 478 3 Axis Command Instructions Enable Enabled Invalid Busy Error Error ID Deviated Value 0 0 0 10 12 -2 3 5 21 20 0 0 0 0 0 0 0 Master axis 20 22 24 28 30 32 34 36 38 40 42 44 46 48 50 52 command position Slave axis 21 20 24 16 16 32 29 29 15 18 40 42 23 25 28 30 31...
  • Page 479: 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. Instruction Name Graphic expression ST expression MC_SyncMove- Cyclic Syn- MC_SyncMoveVelocity_instance ( MC_SyncMoveVelocity_instance Velocity chronous Ve- Axis :=parameter,...
  • Page 480 3 Axis Command Instructions Name Meaning Data type Valid range Description fault BufferMode Buffer _eMC_BUF- 0: _mcAborting Specify the behavior when execut- Mode Se- FER_MODE 1: _mcBuffered ing more than one motion instruc- lection tion. 0: Aborting 1: Buffered Refer to Unit Conversion Settings in the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 481: Function

    3 Axis Command Instructions In-Out Variables Valid Name Meaning Data type Description range Axis Axis _sAXIS_REF Specifies the axis. Specify a user-defined Axis Variable that was created in the Axis Basic Settings of the Sysmac Studio (default: MC_Ax- is*) or a system-defined axis variable name (_MC_AX[*]). If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axis variable name for AT specifi- cation of a user-defined variable.
  • Page 482 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 current position.
  • Page 483 User’s Manual (Cat. No. I576) for details. 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-...
  • Page 484 3 Axis Command Instructions  When Using NX-series Position Interface Units You cannot use this instruction for NX-series Position Interface Units.  Stop Processing The Control Mode and command velocities that are used to stop axis motion are described below. For a deceleration stop, the target velocity of this instruction is used as the initial velocity and the axis is decelerated to a stop with the deceleration rate for the specified Stop Mode.
  • Page 485 3 Axis Command Instructions Therefore, processing to change to CSP Mode is performed when the Status output variable from the MC_Power (Power Servo) instruction changes to FALSE.  Operation for Failure to Switch Control Mode If the Servo Drive does not complete switching the Control Mode within 1 second after a Control Mode switch command is sent to the Servo Drive, a Error in Changing Servo Drive Control Mode (error code: 7439 hex) occurs.
  • Page 486 3 Axis Command Instructions They are enabled even for the following axis parameter settings. • Enabled for command position. Deceleration stop. • Enabled for command position. Stop using remaining pulses. Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Control- ling) changes to TRUE in the next period.
  • Page 487 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 488 3 Axis Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the 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 this instruction with BufferMode (Buffer Mode Selection) set to Aborting or Buffered during execution of other instructions in the same as for the MC_MoveVelocity (Velocity Control) in- struction.
  • Page 489: 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_SyncMoveAbso- Cyclic MC_SyncMoveAbsolute_instance MC_SyncMoveAbsolute_instance lute Synchro- MC_SyncMoveAbsolute nous Ab- Axis :=parameter, Axis Axis Execute InPosition solute Po- Execute :=parameter, Position Busy...
  • Page 490 3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range InPosition In Position BOOL TRUE or TRUE when the actual current position is within the in- FALSE position range of the target position. Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged.
  • Page 491: Function

    3 Axis Command Instructions If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axis variable name for AT specifi- cation of a user-defined variable. This will allow you to specify the user-defined variable. If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Function •...
  • Page 492 3 Axis Command 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 493 3 Axis Command Instructions If InPosition is TRUE before the actual position is changed, it will change to FALSE the next period after it is changed. Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Control- ling) changes to TRUE in the next period.
  • Page 494 3 Axis Command Instructions Additional Information The MC Function Module sends a command to the Servo Drive to change the Control Mode as shown in the above timing chart. The timing of implementing the change in the Servo Drive depends on Servo Drive specifications. Re-execution of Motion Control Instructions This instruction cannot be re-executed.
  • Page 495 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. 3-407 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 496: Mc_Reset

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

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When Failure changes to TRUE. • •...
  • Page 498 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 499 3 Axis Command Instructions Execute Done Busy Failure Error Output parameters during errors Error Error code ErrorID Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-411 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 500: Mc_Changeaxisuse

    3 Axis Command Instructions MC_ChangeAxisUse The MC_ChangeAxisUse instruction temporarily changes the Axis Use axis parameter. Instruction Name Graphic expression ST expression MC_ChangeAxi- Change Axis MC_ChangeAxisUse_instance ( MC_ChangeAxisUse_instance sUse Axis :=parameter, MC_ChangeAxisUse Execute :=parameter, Axis Axis Execute Done AxisUse :=parameter, AxisUse Busy Done =>parameter, CommandAborted...
  • Page 501: Function

    3 Axis Command Instructions Output Variables Data Valid Name Meaning Description type range 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 502 3 Axis Command Instructions • You can change the setting only for axes that have the Axis Use axis parameter set to Unused axis (changeable to used axis) or Used axis. You cannot change the setting of the Axis Use axis pa- rameter to Used axis if that axis is set to Unused axis (unchangeable to used axis).
  • Page 503 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 NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 504: Mc_Digitalcamswitch

    An axis that is assigned to an NX-series Position Interface Unit. The applicable NX Units are as follows: NX-EC0£££ and NX-ECS£££. b) An OMRON 1S-series Servo Drive with built-in EtherCAT communications. • Always use this instruction together with the NX_AryDOutTimeStamp instruction and with a Digital Output Unit that supports time stamp refreshing.
  • Page 505 3 Axis Command Instructions Data Name Meaning Valid range Default Description type EnableMask Enable Tracks WORD 16#0000 to 16#0000 Specify whether to enable or disable each FFFF track. There are a maximum of 16 tracks. Specify enable or disable for track 0 with bit 00 and track 15 with bit 15.
  • Page 506: Function

    3 Axis Command Instructions Valid Name Meaning Data type Description range Switches Switches ARRAY[0..255] OF Specify an array variable of _sCAMS- _sCAMS- WITCH_REF switch structures for use as switch ON/OFF pattern data. WITCH_REF The array element numbers indicate the switch numbers.
  • Page 507 PDO. c) The Enable Distributed Clock in the EtherCAT Coupler Unit is Disabled (FreeRun). • If you use an OMRON 1S-series Servo Drive with built-in EtherCAT communications, this in- struction is not possible in the following cases. a) Object 3211-83 hex (Present Position Time Stamp) in the OMRON 1S-series Servo Drive with built-in EtherCAT communications is not assigned to a PDO.
  • Page 508 3 Axis Command Instructions Additional Information For details on the NX_AryDOutTimeStamp instruction, refer to the 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 509 3 Axis Command Instructions For SetDOut (Output Pulses), specify the elements of the array variable that is specified for the param- eter for Outputs (Output Signals) in the MC_DigitalCamSwitch instruction. For DOut (DOut Unit Output Bit), specify as the actual digital output, the device variable that is as- signed to the output bit of the Digital Output Unit that supports time stamp refreshing.
  • Page 510 3 Axis Command Instructions Name Meaning Data type Valid range Default Description FirstOnPosition ON Start Po- LREAL Negative number, posi- Specify the position for the output to sition tive number, or 0 turn ON. LastOnPosition ON End Posi- LREAL Negative number, posi- Specify the position for the output to tion tive number, or 0...
  • Page 511 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 5000 in the axis parameters.
  • Page 512 3 Axis Command Instructions Name Meaning Data type Valid range Description OffTime OFF Time ARRAY Non-negative number The time stamps at which to turn OFF the [0..15] OF digital output are given. The time stamps ULINT are based on the time in the NX-series En- coder Input Unit.
  • Page 513 3 Axis Command Instructions Precautions for Safe Use Always use the axis at a constant velocity for the MC_DigitalCamSwitch instruction. If you set the Count Mode to Rotary Mode, the following operation will occur if you use OnCompensation or OffCompensation and the axis velocity changes abruptly. •...
  • Page 514 3 Axis Command Instructions With compensation (solid line) Without compensation (dotted line) Switch 0 5 ms 10 ms Position 2,000 2,500 3,000 Calculated positions based on actual velocities The axis continuously rotates in the positive direction. Timing Charts A timing chart for execution of the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction is shown below.
  • Page 515: Sample Programming

    3 Axis Command Instructions Re-execution of Motion Control Instructions You cannot re-execute motion instructions with enable-type inputs. Multi-execution of Motion Control 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 NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 516 3 Axis Command Instructions Device Model number Digital Output Unit NX-OD2154 The node address is 1 and the device name is E001. The NX Unit number is 1 and the device name is N1. It is assigned to axis 1. The NX Unit number is 2 and the device name is N2.
  • Page 517 3 Axis Command Instructions Name Data type Default Comment Switches ARRAY[0..3] OF Input parameter for Switches in- _sCAMSWITCH_REF out variable. The element numbers corre- spond to the switch numbers. Outputs ARRAY[0..1] OF Input parameter for Outputs in- _sOUTPUT_REF out variable. The element numbers corre- spond to the track numbers.
  • Page 518 3 Axis Command Instructions The parameters are set for the MC_MoveVelocity (Velocity Control) instruction and for the Switches variables for the MC_DigitalCamSwitch (Enable Digital Cam Switch) instruction. 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 519 3 Axis Command Instructions 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; //MC_DigitalCamSwitch parameters Switches[0].TrackNumber := UINT#0; Switches[0].FirstOnPosition := LREAL#2000.0; Switches[0].LastOnPosition := LREAL#3000.0; Switches[0].AxisDirection := _eMC_DIRECTION#_mcPositiveDirection; Switches[0].CamSwitchMode := _eMC_SWITCH_MODE#_mcPositionBased; Switches[1].TrackNumber := UINT#0;...
  • Page 520 3 Axis Command Instructions Name Data type Default Comment Pwr_En BOOL This variable is assigned to the Enable input variable from the PWR instance of the MC_Power instruction. Switches ARRAY[0..3] OF Input parameter for Switches _sCAMSWITCH_REF in-out variable. The element numbers corre- spond to the switch numbers.
  • Page 521 3 Axis Command Instructions 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; //InitFlag is changed to TRUE after input parameters are set. InitFlag:=TRUE;...
  • Page 522 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 => Hm_ErrID //MC_MoveVelocity VEL( Axis := MC_Axis000,...
  • Page 523 3 Axis Command Instructions inst_NX_AryDOutTimeStamp1( Enable := Vel_Act, SetDOut := Outputs[0], SyncOutTime :=E001_Time_Stamp_of_Synchronous_Output, DOut := N3_Output_Bit_00, TimeStamp := N3_Output_Bit_00_Time_Stamp); inst_NX_AryDOutTimeStamp2( Enable := Vel_Act, SetDOut := Outputs[1], SyncOutTime :=E001_Time_Stamp_of_Synchronous_Output, DOut := N3_Output_Bit_01, TimeStamp := N3_Output_Bit_01_Time_Stamp); 3-435 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 524: Mc_Timestamptopos

    The applicable NX Units are as follows: NX-EC0£££ and NX-ECS£££. b) An OMRON 1S-series Servo Drive with built-in EtherCAT communications. • When you use this instruction for an OMRON 1S-series Servo Drive with built-in EtherCAT communications, you must assign the Object 3211-83 hex (Present Position Time Stamp) to a PDO.
  • Page 525: Function

    If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Specify the encoder axis that is assigned to the NX-series Encoder Input Unit or the axis for the OMRON 1S-series Servo Drive with built-in EtherCAT communications.
  • Page 526 PDO. c) The Enable Distributed Clock in the EtherCAT Coupler Unit is Disabled (FreeRun). • If you use an OMRON 1S-series Servo Drive with built-in EtherCAT communications, this in- struction is not possible in the following cases. a) Object 3211-83 hex (Present Position Time Stamp) in the OMRON 1S-series Servo Drive with built-in EtherCAT communications is not assigned to a PDO.
  • Page 527 3 Axis Command Instructions Enable Enabled Busy CalcPosition Undefined. Error ErrorID 16#0000 Re-execution of Motion Control Instructions You cannot re-execute motion instructions with enable-type inputs. Multi-execution of Motion Control Instructions This instruction is executed independently from other instructions. The restrictions for multi-execution of motion instructions do not apply.
  • Page 528: 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 529 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 530 3 Axis Command Instructions If the Servo Drive for axis 1 is ready, the Servo is turned ON. MC_Power MC_Axis000 Pwr_Status MC_Axis000 Axis Axis Lock1 Enable Status Busy Pwr_Bsy Error Pwr_Err ErrorID Pwr_ErrID If a minor fault level error occurs for the axis composition, the error handler for the device (FaultHandler) is executed.
  • Page 531 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 532 3 Axis Command Instructions IF Index >= UINT#2 THEN Finish := BOOL#TRUE; Index := UINT#0; END_IF; Contents of Inline ST 4 //First comparison: Workpiece 1=Position[0] and workpiece 2=Position[1] //Second comparison: Workpiece 2=Position[1] and workpiece 3=Position[0] //Third comparison: Workpiece 3=Position[0] and workpiece 4=Position[1] FirstPoint := (Index+UINT#1) MOD UINT#2;...
  • Page 533 3 Axis Command Instructions //MC_MoveVelocity parameters Vel_Vel := LREAL#1000.0; Vel_Acc := LREAL#0.0; Vel_Dec := LREAL#0.0; Vel_Jrk := LREAL#1000.0; //InitFlag is changed to TRUE after input parameters are set. InitFlag:=TRUE; END_IF; //If StartPg is TRUE and the Servo Drive is ready, the Servo for axis 1 is turned O //If the Servo Drive is not ready, the Servo is turned OFF.
  • Page 534 3 Axis Command Instructions instMC_TimeStampToPos( Axis := MC_Axis001, Enable := Vel_Ex, TimeStamp := TimeStamp, Enabled => inst_Enabled, Busy => TSTP_Busy, CalcPosition => CalcPosition, Error => TSTP_Error, ErrorID => TSTP_ErrorID ); //CalcPosition (calculated position) is obtained when the sensor output turns ON. //(The position is saved alternately in Position[0] and Position[1].
  • Page 535 3 Axis Command Instructions 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 => Hm_ErrID //MC_MoveVelocity VEL( Axis := MC_Axis000, Execute := Vel_Ex, Velocity := Vel_Vel, Acceleration := Vel_Acc, Deceleration := Vel_Dec,...
  • Page 536: Mc_Syncoffsetposition

    3 Axis Command Instructions MC_SyncOffsetPosition The MC_SyncOffsetPosition cyclically adds the specified position offset to the command current posi- tion of the slave axis in synchronized control, and outputs the result. Instruction Name Graphic expression ST expression MC_SyncOffset- Cyclic Syn- MC_SyncOffsetPosition_instance MC_SyncOffsetPosition_instance Position chronous Po-...
  • Page 537 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, command current position. Value or 0 The value is updated when Active is TRUE. Updating is stopped and the value is retained when CommandAborted or Error is TRUE.
  • Page 538: Function

    3 Axis Command Instructions Specify the encoder axis that is assigned to the NX-series Encoder Input Unit or the axis for the OMRON 1S-series Servo Drive with built-in EtherCAT communications. 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.
  • Page 539 3 Axis Command Instructions MC_GearIn Instruction Execute Active CommandAborted MC_GearOut Instruction Execute Done MC_SyncOffsetPosition Instruction Execute OffsetPosition Active CommandAborted OutputtedOffsetPosition Offset 0 10 Solid line: After position offset is added Command position Primary period Dotted line: Before position offset is added Time ...
  • Page 540 3 Axis Command Instructions MC_SyncOffsetPosition Instruction Execution started the second time Execute OffsetPosition Active CommandAborted OutputtedOffsetPosition Offset 0 20 Command position (increased or decreased by offset) Time If you want to use the same starting point when you re-execute a previously aborted instruction, use OutputtedOffsetPosition (Position Offset Output Value).
  • Page 541 3 Axis Command Instructions OutputtedOffsetPos PreviousOffsetPos PreviousOffsetPos Error 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 542 3 Axis Command Instructions b) Following Error Over Value c) Following Error Warning Value • Command Position Overflow • Command Position Underflow Timing Charts The following timing charts show when the position offset is applied when this instruction is executed. ...
  • Page 543 3 Axis Command Instructions MC_SyncOffsetPosition Instruction Execute Active OffsetPosition Solid line: After position offset is added Command position Primary period Task period Dotted line: Before position offset is added Time 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.
  • Page 544 3 Axis Command Instructions MC_GearIn Instruction 1 Execute Active CommandAborted MC_GearIn Instruction 2 Execute Done MC_SyncOffsetPosition Instruction Execute Active CommandAborted OffsetPosition Command position The position offset is added to the initial velocity for multi-execution of instructions. Solid line: When this instruction is executed Dotted line: When this instruction is not executed After multi-execution of instructions Time...
  • Page 545 3 Axis Command Instructions MC_SyncOffsetPosition Instruction 1 Execute OffsetPosition Active CommandAborted MC_SyncOffsetPosition Instruction 2 Execute OffsetPosition Active Command position Solid line: After position offset is added Dash-dot line: Starting point for Primary period multi-execution of instructions Dotted line: Before position offset is added After multi-execution of instructions Time...
  • Page 546: Mc_Offsetposition

    3 Axis Command Instructions MC_OffsetPosition The MC_OffsetPosition instruction adds the specified position offset to the command current position of the slave axis in synchronized control with an acceleration/deceleration curve applied, and outputs the result. Instruction Name Graphic expression ST expression MC_OffsetPosi- Position Off- MC_OffsetPosition_instance(...
  • Page 547 3 Axis Command Instructions Name Meaning Data type Valid range Default Description Deceleration Deceleration LREAL Non-negative num- Specifies the deceleration rate. Rate The unit is command units/s Jerk Jerk LREAL Specifies the jerk. (Reserved) The unit is command units/s BufferMode Buffer Mode _eMC_BUF- 0: _mcAborting...
  • Page 548: Function

    3 Axis Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • • CommandAborted When execution of the synchronized control When Execute is TRUE and changes to instruction is stopped. FALSE. • • When this instruction is aborted because an- After one period when Execute is FALSE.
  • Page 549 3 Axis Command Instructions Command velocity Time MC_OffsetPosition instruction Execute Done Busy Active MC_GearIn instruction Execute Active *1. When the MC_OffsetPosition instruction is executed *2. When the MC_OffsetPosition instruction is not executed Done (Done) changes to TRUE when OffsetPosition (Position Offset) is reached. An in-position check is not performed for this instruction.
  • Page 550 3 Axis Command Instructions 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. An error will occur if the instruction is executed for an axis in any other status.
  • Page 551 3 Axis Command Instructions  Timing Chart When Error Occurs MC_GearIn instruction Execute Busy Active CommandAborted Error ErrorID 16#0000 MC_OffsetPosition instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 3-463 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 552 3 Axis Command Instructions 3-464 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 553: 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 ....................4-6 MC_MoveLinear ...................... 4-11 MC_MoveLinearAbsolute..................4-40 MC_MoveLinearRelative ..................4-43 MC_MoveCircular2D ....................4-46 MC_GroupStop ....................... 4-74 MC_GroupImmediateStop ..................4-82 MC_GroupSetOverride...................
  • Page 554: 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 Execute Done Done =>parameter, Busy Busy =>parameter, CommandAborted CommandAborted =>parameter, Error Error =>parameter,...
  • Page 555: Function

    4 Axes Group Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • CommandAborted When this instruction is canceled.
  • Page 556 4 Axes Group Instructions Basic Function • The MC_GroupEnable (Enable Axes Group) instruction places the axes group specified by AxesGroup into the GroupEnable state. • When an axes group is in the GroupEnable state, you can execute any multi-axes coordinated con- trol instructions for the axes group.
  • Page 557 4 Axes Group Instructions Execute Done Busy CommandAborted Error Error code ErrorID Additional Information Errors do not occur for individual axes in an axes group even if an error occurs for the axes group.  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561)
  • Page 558: Mc_Groupdisable

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

    4 Axes Group Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • CommandAborted Never changes to TRUE.
  • Page 560 4 Axes Group Instructions Timing Charts Execute Done Busy CommandAborted Error ErrorID 16#0000 GroupEnable GroupDisable Axes group state 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. CommandAborted of any buffered multi-axes coordinated control instruction will also change to TRUE.
  • Page 561 4 Axes Group Instructions Multi-axes Coordinated Control 1 (Example: MC_MoveLinearAbsolute) Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Multi-axes Coordinated Control 2 (Example: MC_MoveLinearAbsolute with Buffered) Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_GroupDisable Execute Done Busy CommandAborted Error ErrorID 16#0000 Axes group state...
  • Page 562 4 Axes Group Instructions Execute Done Busy Error ErrorID Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 4-10 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 563: Mc_Movelinear

    4 Axes Group Instructions MC_MoveLinear The MC_MoveLinear instruction performs linear interpolation. Instruction Name Graphic expression ST expression MC_MoveLinear Linear Inter- MC_MoveLinear_instance ( MC_MoveLinear_instance polation AxesGroup :=parameter, MC_MoveLinear Execute :=parameter, AxesGroup AxesGroup Execute Done Position :=parameter, Position Busy Velocity :=parameter, Velocity Active Acceleration :=parameter, Acceleration...
  • Page 564 4 Axes Group Instructions Name Meaning Data type Valid range Description fault Jerk Jerk LREAL Non-negative number Specify the jerk. The unit is command units/s CoordSystem Coordinate _eMC_CO- 0: _mcACS Specify the coordinate system. System ORD_SYS- 0: Axis coordinate system (ACS) BufferMode Buffer Mode...
  • Page 565: 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. •...
  • Page 566 4 Axes Group Instructions  Linear Interpolation Procedure Use the following procedure to perform linear interpolation. Registering Axes Groups for Interpolation • Select the axes group to perform interpolation. An axes group is represented by _MC_GRP[*]. • Specify the axis composition with Composition of the Axes Group Variable. You can specify two to four axes.
  • Page 567 4 Axes Group Instructions Enabling the Axes Group • Turn ON the Servo for the composition axes of the axes group, and then define home for each of the composition axes. • Execute the MC_GroupEnable instruction to enable the registered axes group. Using the Linear Interpolation instruction is now enabled.
  • Page 568 4 Axes Group Instructions  Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Decel- eration 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 interpolated motion into motion on each axis. As an example, the following figure shows linear interpolation of 2 axes from point A to point B.
  • Page 569 4 Axes Group Instructions × Fa0 = F × Fa1 = F × Fa2 = F × Fa3 = F + La1 + La2 + La3 Velocity (Target Velocity) • An interpolation velocity specification error will occur if Velocity (Target Velocity) is set to 0. All axes will stop if an axis in the specified axes group is in operation.
  • Page 570 4 Axes Group Instructions Interpolation velocity Time Acceleration rate Time Deceleration rate Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate. • 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.
  • Page 571 4 Axes Group Instructions 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 • If 0 is specified for Acceleration (Acceleration Rate), the specified Velocity (Target Velocity) is used immediately.
  • Page 572 4 Axes Group Instructions Buffer Mode Selec- Description tion Blending Starts the buffered instruction at the velocity (transit velocity) at which the current in- struction reaches the target position. The operation of the current instruction is changed so that the axes reach the target position at the transit velocity. There are four methods to specify the transit velocity.
  • Page 573 4 Axes Group Instructions Interpolation velocity F The velocity is discontinuous. The velocity is discontinuous. Velocity of axis A1 Velocity of axis A0 Superimpose Corners Use the superimpose corners specification when you want make the axes command velocities contin- uous. Operation Example Velocity (Target Velocity), BufferMode, and TransitionMode when transitioning from P1 to P2, and from P2 to P3 are shown below.
  • Page 574 4 Axes Group Instructions The velocity is continuous. The path goes The velocity command is near P2. made continuous by combining the deceleration range of the previous motion and the acceleration range of the current motion. Velocity of axis A1 Velocity of axis A0 The combined path passes near P2.
  • Page 575 4 Axes Group Instructions Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Error code Interpolation velocity Time Multi-execution of Motion Control Instructions A restriction applies to the instructions that can be used while this instruction is in execution. For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 576: Sample Programming

    4 Axes Group Instructions Sample Programming This section shows sample programming for linear interpolation with periodic multi-execution of in- structions. 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 577 4 Axes Group Instructions  Operation Pattern Axis 2 (mm) Positive direction 25.00 20.00 15.00 10.00 5.00 Positive direction 0.00 50.00 Axis 1 (mm) Positioning is performed using linear interpolations in the order (Axis1, Axis2) = (50.00 mm, 5.00 mm) →...
  • Page 578 4 Axes Group Instructions Name Data type Default Comment StartPg BOOL FALSE The Servos for the axes in the axes group are turned ON if this variable is TRUE and Ether- CAT process data communications are estab- lished. InitFlag BOOL FALSE This variable indicates if it is necessary to set the input parameters.
  • Page 579 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 580 4 Axes Group Instructions If the axes group is enabled, linear interpolation (1) is executed. MV_LIN1 MC_MoveLinear Mv_Lin1_D MC_Group000 AxesGroup AxesGroup Grp_En_D Execute Done Mv_Lin1_Pos Position Busy Mv_Lin1_Bsy Mv_Lin1_Vel Velocity Active Mv_Lin1_Act Mv_Lin1_Acc Acceleration CommandAborted Mv_Lin1_Ca Mv_Lin1_Dec Deceleration Error Mv_Lin1_Err Jerk ErrorID Mv_Lin1_ErrID...
  • Page 581 4 Axes Group Instructions Linear interpolation (4) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_LIN4 MC_MoveLinear Mv_Lin4_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Execute Done Mv_Lin4_Pos Position Busy Mv_Lin4_Bsy Mv_Lin4_Vel Velocity Active Mv_Lin4_Act Mv_Lin4_Acc Acceleration CommandAborted Mv_Lin4_Ca Mv_Lin4_Dec Deceleration Error...
  • Page 582 4 Axes Group Instructions Linear interpolation (7) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_LIN7 MC_MoveLinear Mv_Lin7_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Execute Done Mv_Lin7_Pos Position Busy Mv_Lin7_Bsy Mv_Lin7_Vel Velocity Active Mv_Lin7_Act Mv_Lin7_Acc Acceleration CommandAborted Mv_Lin7_Ca Mv_Lin7_Dec Deceleration Error...
  • Page 583 4 Axes Group Instructions Mv_Lin4_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN5 parameters Mv_Lin5_Pos[0] := LREAL#50.0; Mv_Lin5_Pos[1] := LREAL#25.0; Mv_Lin5_Vel := LREAL#100.0; Mv_Lin5_Acc := LREAL#100.0; Mv_Lin5_Dec := LREAL#100.0; Mv_Lin5_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin5_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN6 parameters Mv_Lin6_Pos[0] := LREAL#50.0; Mv_Lin6_Pos[1] := LREAL#0.0; Mv_Lin6_Vel := LREAL#100.0;...
  • Page 584 4 Axes Group Instructions Name Data type Default Comment MC_Axis001 _sAXIS_REF This is the Axis Variable for axis 2. MC_Axis001.Details.Homed BOOL FALSE TRUE when home is defined for axis 2. MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axis 2.
  • Page 585 4 Axes Group Instructions 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; Mv_Lin4_Pos[1] := LREAL#20.0; Mv_Lin4_Vel := LREAL#100.0; Mv_Lin4_Acc := LREAL#100.0; Mv_Lin4_Dec := LREAL#100.0; Mv_Lin4_Bm := _eMC_BUFFER_MODE#_mcBuffered; Mv_Lin4_Mm := _eMC_MOVE_MODE#_mcAbsolute; // MV_LIN5 parameters Mv_Lin5_Pos[0] := LREAL#50.0;...
  • Page 586 4 Axes Group Instructions // If the Servo Drive is not ready, the Servo is turned OFF. IF (StartPg=TRUE) AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN Pwr1_En:=TRUE; // Turn ON the Servo for axis 1. ELSE Pwr1_En:=FALSE; // Turn OFF the Servo for axis 1. END_IF;...
  • Page 587 4 Axes Group Instructions END_IF; // Linear interpolations (2) to (7) are executed with multi-execution of instructio ns while the Active output variable for linear interpolation (1) is TRUE. IF Mv_Lin1_Act=TRUE THEN Mv_Lin2_Ex:=TRUE; Mv_Lin3_Ex:=TRUE; Mv_Lin4_Ex:=TRUE; Mv_Lin5_Ex:=TRUE; Mv_Lin6_Ex:=TRUE; Mv_Lin7_Ex:=TRUE; END_IF; // MC_Power for axis 1 PWR1( Axis := MC_Axis000, Enable := Pwr1_En,...
  • Page 588 4 Axes Group Instructions Execute := Hm2_Ex, Done => Hm2_D, Busy => Hm2_Bsy, CommandAborted => Hm2_Ca, Error => Hm2_Err, ErrorID => Hm2_ErrID // Axes group 0 is enabled. GRP_EN( AxesGroup := MC_Group000, Execute := Grp_En_Ex, Done => Grp_En_D, Busy => Grp_En_Bsy, CommandAborted =>...
  • Page 589 4 Axes Group Instructions 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, Execute := Mv_Lin3_Ex, Position := Mv_Lin3_Pos, Velocity := Mv_Lin3_Vel, Acceleration := Mv_Lin3_Acc, Deceleration := Mv_Lin3_Dec, BufferMode := Mv_Lin3_Bm, MoveMode := Mv_Lin3_Mm, Done =>...
  • Page 590 4 Axes Group Instructions Position := Mv_Lin5_Pos, Velocity := Mv_Lin5_Vel, Acceleration := Mv_Lin5_Acc, Deceleration := Mv_Lin5_Dec, BufferMode := Mv_Lin5_Bm, MoveMode := Mv_Lin5_Mm, Done => Mv_Lin5_D, Busy => Mv_Lin5_Bsy, Active => Mv_Lin5_Act, CommandAborted => Mv_Lin5_Ca, Error => Mv_Lin5_Err, ErrorID => Mv_Lin5_ErrID // Linear interpolation (6) MV_LIN6( AxesGroup := MC_Group000,...
  • Page 591 4 Axes Group Instructions ErrorID => Mv_Lin7_ErrID 4-39 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 592: 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_MoveLinearAbso- Abso- MC_MoveLinearAbsolute_in- MC_MoveLinearAbsolute_instance lute lute stance ( MC_MoveLinearAbsolute Linear AxesGroup :=parameter, AxesGroup AxesGroup Interpo- Execute Done Execute :=parameter, Position Busy lation...
  • Page 593 4 Axes Group Instructions Name Meaning Data type Valid range Default Description CoordSystem Coordinate _eMC_CO- 0: _mcACS Specify the coordinate sys- System ORD_SYSTEM tem. 0: Axis coordinate system (ACS) BufferMode Buffer Mode _eMC_BUF- 0: _mcAborting Specify the behavior when Selection FER_MODE 1: _mcBuffered executing more than one mo-...
  • Page 594: Function

    4 Axes Group Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Active When the axes move. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • • CommandAborted When this instruction is aborted because an- When Execute is TRUE and changes to...
  • Page 595: 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_MoveLinear- Relative Line- MC_MoveLinearRelative_instance MC_MoveLinearRelative_instance Relative ar Interpola- MC_MoveLinearRelative tion AxesGroup :=parameter, AxesGroup AxesGroup Execute Done Execute :=parameter, Distance Busy Distance :=parameter,...
  • Page 596 4 Axes Group Instructions Name Meaning Data type Valid range Description fault Deceleration Deceleration LREAL Non-negative number Specify the deceleration Rate rate. The unit is command units/s Jerk Jerk LREAL Non-negative number Specify the jerk. The unit is command units/s CoordSystem Coordinate _eMC_CO-...
  • Page 597: 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. •...
  • Page 598: 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_MoveCircu- Circular 2D MC_MoveCircular2D_instance ( MC_MoveCircular2D_instance lar2D Interpolation AxesGroup :=parameter, MC_MoveCircular2D Execute :=parameter, AxesGroup AxesGroup Execute Done CircAxes :=parameter, CircAxes Busy CircMode :=parameter, CircMode...
  • Page 599 4 Axes Group Instructions Name Meaning Data type Valid range Description fault AuxPoint Auxiliary ARRAY [0,1] OF Negative number, positive Specify the border point, cen- Point LREAL number, or 0 ter, or radius. The unit is command units. EndPoint End Point ARRAY [0,1] OF Negative number, positive Specify the target position.
  • Page 600 4 Axes Group Instructions Output Variables Data Valid Name Meaning Description type range 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 axis is being controlled.
  • Page 601: Function

    4 Axes Group Instructions If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axes group variable name for AT specification of a user-defined variable. This will allow you to specify the user-defined variable. If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Function •...
  • Page 602 4 Axes Group Instructions Additional Information For the details of the axis numbers, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Enabling the Axes Group • Turn ON the Servo for the composition axes of the axes group, and then define home for each of the composition axes.
  • Page 603 4 Axes Group Instructions MoveMode Description Absolute positioning The border point and end point for a border point specification or the center point and end point for a center point specification are specified as absolute positions from home in the axis coordinate system. Relative positioning The border point and end point for a border point specification or the center point and end point for a center point specification are specified as relative positions from the...
  • Page 604 4 Axes Group Instructions EndPoint(X, Y) AuxPoint(X, Y) Start point Precautions for Correct Use • The points are considered to be on a straight line if the distance between the border point and the line that connects the start and end point is less than one pulse for both the X and Y coordinates.
  • Page 605 4 Axes Group Instructions AuxPoint(X, Y) EndPoint(X, Y) Start point Precautions for Correct Use If the Correction Allowance Ratio axes group parameter is set to any value other than 0 and the specified center point exceeds the circle that is calculated with the following formula, a Cir- cular Interpolation Center Specification Position Out of Range error (error code: 5449 hex) will occur.
  • Page 606 4 Axes Group Instructions  Velocity (Target Velocity), Acceleration (Acceleration Rate), Deceleration (Decel- eration 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 circular interpolation to 0, a velocity specification error will oc- cur and operation will stop for all axes in the group.
  • Page 607 4 Axes Group Instructions Interpolation velocity Time Acceleration rate Time Deceleration rate Vt: Specified interpolation velocity, At: Specified acceleration rate, Dt: Specified deceleration rate. • 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.
  • Page 608 4 Axes Group Instructions 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 • If 0 is specified for Acceleration (Acceleration Rate), the specified interpolation velocity is used immediately.
  • Page 609 4 Axes Group Instructions Buffer Mode Selec- Description tion Blending Starts the buffered instruction at the velocity (transit velocity) at which the current in- struction reaches the target position. The operation of the current instruction is changed so that the axes reach the target position at the transit velocity. There are four methods to specify the transit velocity.
  • Page 610 4 Axes Group Instructions Interpolation velocity F The velocity is discontinuous. The velocity is discontinuous. Velocity of axis A1 Velocity of axis A0 Superimpose Corners Use the superimpose corners specification when you want make the axes command velocities contin- uous. Operation Example Velocity (Target Velocity), BufferMode, and TransitionMode when transitioning from P1 to P2, and from P2 to P3 are shown below.
  • Page 611 4 Axes Group Instructions The velocity is continuous. The path goes The velocity command is near P2. made continuous by combining the deceleration range of the previous motion and the acceleration range of the current motion. Velocity of axis A1 Velocity of axis A0 The combined path passes near P2.
  • Page 612 4 Axes Group Instructions Execute Done Busy Active CommandAborted Error ErrorID 16#0000 Error code Interpolation velocity Time Multi-execution of Motion Control Instructions A restriction applies to the instructions that can be used while this instruction is in execution. For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat.
  • Page 613: 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...
  • Page 614 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.
  • Page 615 4 Axes Group Instructions Name Data type Default Comment MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axis 2. Pwr1_Status BOOL FALSE This variable is assigned to the Status output variable from the PWR1 instance of the MC_Power instruction.
  • Page 616 4 Axes Group Instructions 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 MC_Axis001.MFaultLvl.Active MC_Group000.MFaultLvl.Active If the Servo is ON for axis 1 and home is not defined, the Home instruction is executed. MC_Home Hm1_D MC_Axis000...
  • Page 617 4 Axes Group Instructions If the axes group is enabled, linear interpolation (1) is executed. MV_LIN1 MC_MoveLinear Mv_Lin1_D MC_Group000 AxesGroup AxesGroup Grp_En_D Execute Done Mv_Lin1_Pos Position Busy Mv_Lin1_Bsy Mv_Lin1_Vel Velocity Active Mv_Lin1_Act Mv_Lin1_Acc Acceleration CommandAborted Mv_Lin1_Ca Mv_Lin1_Dec Deceleration Error Mv_Lin1_Err Jerk ErrorID Mv_Lin1_ErrID...
  • Page 618 4 Axes Group Instructions Circular interpolation (4) is executed with multi-execution of instructions after linear interpolation (1) is started. MV_CIRC2 MC_MoveCircular2D Mv_Circ2_D MC_Group000 AxesGroup AxesGroup Mv_Lin1_Act Execute Done Mv_Circ2_CircAxes CircAxes Busy Mv_Circ2_Bsy Mv_Circ2_CircMode CircMode Active Mv_Circ2_Act Mv_Circ2_AuxPoint AuxPoint CommandAborted Mv_Circ2_Ca Mv_Circ2_EndPoint EndPoint Error...
  • Page 619 4 Axes Group Instructions // 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; Mv_Lin2_Vel := LREAL#100.0; Mv_Lin2_Acc := LREAL#20.0; Mv_Lin2_Dec := LREAL#20.0;...
  • Page 620 4 Axes Group Instructions Name Data type Default Comment StartPg BOOL FALSE The Servos for the axes in the axes group are turned ON if this variable is TRUE and Ether- CAT process data communications are estab- lished. InitFlag BOOL FALSE This variable indicates if it is necessary to set the input parameters.
  • Page 621 4 Axes Group Instructions Mv_Circ2_CircMode :=_eMC_CIRC_MODE#_mcCenter; Mv_Circ2_AuxPoint[0] := LREAL#15.0; Mv_Circ2_AuxPoint[1] := LREAL#20.0; Mv_Circ2_EndPoint[0] := LREAL#20.0; Mv_Circ2_EndPoint[1] := LREAL#20.0; Mv_Circ2_Pc := _eMC_CIRC_PATHCHOICE#_mcCW; Mv_Circ2_Vel := LREAL#100.0; Mv_Circ2_Acc := LREAL#20.0; 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;...
  • Page 622 4 Axes Group Instructions IF (StartPg=TRUE) AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN Pwr2_En:=TRUE; // Turn ON the Servo for axis 2. ELSE Pwr2_En:=FALSE; // Turn OFF the Servo for axis 2. END_IF; // Processing for a minor fault level error // Program the FaultHandler according to the device. IF (MC_Axis000.MFaultLvl.Active=TRUE) OR (MC_Axis001.MFaultLvl.Active=TRUE) OR (MC_Group000.MFaultLvl.Active=TRUE) THEN FaultHandler();...
  • Page 623 4 Axes Group 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 624 4 Axes Group Instructions Error => Grp_En_Err, ErrorID => Grp_En_ErrID // Linear interpolation (1) MV_LIN1( 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 =>...
  • Page 625 4 Axes Group Instructions Position := Mv_Lin2_Pos, 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 // Circular interpolation (4) MV_CIRC2( AxesGroup := MC_Group000,...
  • Page 626: 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 Execute Done Deceleration :=parameter, Deceleration...
  • Page 627 4 Axes Group Instructions Data Valid Name Meaning Description type range Active Controlling BOOL TRUE or TRUE when the axis is being controlled. FALSE CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted. Aborted FALSE Error Error BOOL TRUE or TRUE while there is an error.
  • Page 628: 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 instruction.
  • Page 629 4 Axes Group Instructions Interpolation velocity Time Time Deceleration rate Vt: Velocity when deceleration starts, Dt: Specified deceleration rate • 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.
  • Page 630 4 Axes Group Instructions  In-position Check An in-position check is not performed when stopping for this instruction. Timing Charts • Busy (Executing) changes to TRUE at the same time as Execute changes to TRUE. Active (Control- ling) changes to TRUE in the next period. •...
  • Page 631 4 Axes Group Instructions  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. Interpolation velocity Execute Re-execute...
  • Page 632 4 Axes Group Instructions When the Status.ErrorStop (Error Deceleration Stopping) in the Axes Group Variable Is TRUE Status.ErrorStop (Error Deceleration Stopping) in the axes group status is TRUE while there is an er- ror for the axes group. If the MC_GroupStop instruction is executed when Status.ErrorStop (Error Deceleration Stopping) is TRUE, CommandAborted changes to TRUE.
  • Page 633 4 Axes Group Instructions Additional Information Operation in Error Reset is shown below. Note that you must reset errors only after the axis has stopped. Do not reset errors during axis motion. • If you clear the error for this instruction, the instruction will not start until Execute changes to TRUE again.
  • Page 634: 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 the Immediate Stop Input Stop Method axis parameter regardless of the current status of the axes.
  • Page 635: 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. •...
  • Page 636 4 Axes Group Instructions MC_MoveLiner Instruction Execute Done Busy Active CommandAborted Error ErrorID 16#0000 MC_GroupImmediateStop Instruction Execute Done Busy CommandAborted Error ErrorID 16#0000 Interpolation velocity Time 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.
  • Page 637 4 Axes Group Instructions When the Status.Stopping (Deceleration Stopping) in the Axes Group Variable Is TRUE Status.Stopping (Deceleration Stopping) in the Axes Group Variable changes to TRUE in the following cases. • While the axis is decelerating for the MC_GroupStop Instruction •...
  • Page 638: 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_GroupSetOverr- Set Group MC_GroupSetOverride_in- MC_GroupSetOverride_instance Overrides stance ( MC_GroupSetOverride AxesGroup :=parameter, AxesGroup AxesGroup Enable Enabled Enable :=parameter, VelFactor Busy VelFactor :=parameter,...
  • Page 639: Function

    4 Axes Group Instructions Output Variables Data Valid Name Meaning Description type range Enabled Enabled BOOL TRUE or TRUE when the axis is being controlled. FALSE Busy Executing BOOL TRUE or TRUE when the instruction is acknowledged. FALSE Error Error BOOL TRUE or TRUE while there is an error.
  • Page 640 4 Axes Group Instructions Target velocity after the change = Interpolation velocity of the current instruction × Override factor • The unit for override factors is %. A setting of 100 indicates 100%. • If the interpolation velocity that results from the override exceeds the maximum interpolation velocity set in the Axes Group Variables, the maximum interpolation velocity is used.
  • Page 641 4 Axes Group Instructions Timing Charts  Using this Instruction for the MC_MoveLinear (Linear Interpolation) Instruction Previous Instruction: MC_MoveLinear Execute Done Busy Active CommandAborted Current Instruction Enable VelFactor Enabled Busy Interpolation velocity When overrides are disabled with MC_GroupSetOverride, the target Override factor: 200% velocity returns to 100%.
  • Page 642 4 Axes Group 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). Enable VelFactor Enabled Busy Error ErrorID Error code...
  • Page 643: 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 Graphic expression ST expression MC_GroupRead- Read Axes MC_GroupReadPosition_instance MC_GroupReadPosition_instance Position Group Posi- MC_GroupReadPosition tion AxesGroup :=parameter, AxesGroup AxesGroup Enable...
  • Page 644: Function

    4 Axes Group Instructions Name Meaning Data type Valid range Description ActualPosition Actual Current ARRAY [0..3] Negative num- Contains the actual current position. Position OF LREAL ber, positive The unit is command units. number, or 0 The upper four digits of the event code give the error code for ErrorID. Refer to the NY-series Troubleshooting Manual (Cat.
  • Page 645 4 Axes Group Instructions However, there is sometimes calculation error because processing is performed with long reals in the MC Function Module. • You can execute this instruction even if home is not defined. • You can execute this instruction regardless of whether the axes group is enabled or disabled. Precautions for Correct Use Before you use this instruction in a task to which the axes group is not assigned, declare Axis Variables as external variables for the configuration axes that are specified in Axes (Axes...
  • Page 646 4 Axes Group Instructions MC_GroupReadPosition Enable Valid Busy Error ErrorID 16#0000 Error Code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 4-94 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 647: Mc_Changeaxesingroup

    4 Axes Group Instructions MC_ChangeAxesInGroup The MC_ChangeAxesInGroup instruction temporarily changes the Composition Axes axes group pa- rameter. Instruction Name Graphic expression ST expression MC_ChangeAx- Change Ax- MC_ChangeAxesInGroup_instance ( MC_ChangeAxesInGroup_instance esInGroup es in Group AxesGroup :=parameter, MC_ChangeAxesInGroup Axes :=parameter, AxesGroup AxesGroup Axes Axes Execute :=parameter,...
  • Page 648: Function

    4 Axes Group Instructions Data Valid Name Meaning Description type range 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. The upper four digits of the event code give the error code for ErrorID.
  • Page 649 4 Axes Group Instructions • The operation for changing the axes numbers of the composition axes from 0, 1, 2, and 3 to 7, 6, 5, and 4 is illustrated below. Execute Axes[0] UINT#7 Axes[1] UINT#6 Axes[2] UINT#5 Axes[3] UINT#4 Done Kinematics.Axes[0] UINT#0...
  • Page 650 4 Axes Group Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). Errors If an error occurs during instruction execution, Error will change to TRUE and parameters are not writ- ten.
  • Page 651: Mc_Groupsyncmoveabsolute

    4 Axes Group Instructions MC_GroupSyncMoveAbsolute The MC_GroupSyncMoveAbsolute instruction cyclically outputs the specified target positions for the axes. Instruction Name Graphic expression ST expression MC_GroupSync- Axes Group MC_GroupSyncMoveAbsolute_in- MC_GroupSyncMoveAbsolute_instance MoveAbsolute Cyclic Syn- stance ( MC_GroupSyncMoveAbsolute chronous Ab- AxesGroup :=parameter, AxesGroup AxesGroup solute Posi- Execute InPosition...
  • Page 652 4 Axes Group Instructions Output Variables Data Valid Name Meaning Description type range 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 653: Function

    4 Axes Group Instructions If you use Sysmac Studio version 1.29 or higher, you can specify the system-defined axes group variable name for AT specification of a user-defined variable. This will allow you to specify the user-defined variable. If you use Sysmac Studio version 1.28 or lower, do not specify any user-defined variable created in the variable table. Function •...
  • Page 654 4 Axes Group Instructions 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. • Specify the target positions so that the travel distances to the target positions do not cause the velocity to exceed the value that is specified in the Maximum Velocity axis parameter.
  • Page 655 4 Axes Group Instructions  Start Condition • Set the Count Mode axis parameters to Linear Mode. • Define home for all of the composition axes. • Execute the MC_GroupEnable instruction to enable the axes group.  Axis Variable Status Status.Moving in the Axes Group Variable is TRUE during axes group motion.
  • Page 656 4 Axes Group Instructions MC_GroupSyncMoveAbsolute Instruction Execute Position 20 30 40 50 60 InPosition Busy Active CommandAborted Error ErrorID 16#0000 MC_GroupStop Instruction Execute Done Busy Active Command position Time Additional Information The MC Function Module sends a command to the Servo Drive to change the Control Mode as shown in the above timing chart.
  • Page 657 4 Axes Group Instructions  Execution during Execution of Other Instructions BufferMode can be set only to Aborting for this instruction.  Execution of Other Instructions during Instruction Execution If you execute another instruction during execution of this instruction, you can specify only Aborting. Errors If an error occurs during instruction execution, Error will change to TRUE.
  • Page 658: Mc_Groupreset

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

    4 Axes Group Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When Failure changes to TRUE. • •...
  • Page 660 • 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 661 4 Axes Group Instructions Execute Done Busy Failure Re-execution of Motion Control Instructions If the instruction is re-executed by changing Execute to TRUE again, the re-executed instruction is ig- nored and error clear processing is continued. Execute Done Busy Failure The command from re-executing the instruction is not acknowledged and the current processing is continued.
  • Page 662 4 Axes Group Instructions Reset A MC_GroupReset AxesGroup1 AxesGroup AxesGroup Execute Done Busy Failure Error Executes multiple ErrorID MC_GroupReset instructions for the same axes group. Reset B MC_GroupReset AxesGroup1 AxesGroup AxesGroup Execute Done Busy Failure Error ErrorID Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 4-110 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 663: 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....................5-8 MC_Write ......................... 5-13 MC_GenerateCamTable ..................5-18 MC_WriteAxisParameter..................5-47 MC_ReadAxisParameter ..................5-61 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 664: 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_SetCamTableProp- Set Cam MC_SetCamTableProperty_in- MC_SetCamTableProperty_instance erty Table Prop- stance ( MC_SetCamTableProperty erties CamTable :=parameter,...
  • Page 665: Function

    5 Common Command Instructions Data Name Meaning Valid range Description type ErrorID Error Code WORD Contains the error code when an error occurs. A value of 16#0000 indicates normal execution. The upper four digits of the event code give the error code for ErrorID. Refer to the NY-series Troubleshooting Manual (Cat.
  • Page 666 5 Common Command Instructions 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 667 5 Common Command Instructions Phase Phase Displacement Cam data structure array Displacement MyCam1 [0] MyCam1 [995] 359.6 359.6 End point MyCam1 [996] 359.7 360.0 MyCam1 [997] 359.8 MyCam1 [998] 359.9 359.9 MyCam1 [999] 360.0 360.0 End point MyCam1 [1000] Invalid data MyCam1 [4999] If this instruction is executed for a cam table after the phases for MyCam1[1000] to MyCam1[4997] are changed to anything other than 0, EndPointIndex will be 4997.
  • Page 668 5 Common Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 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 ...
  • Page 669 5 Common Command Instructions  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. NY-series Motion Control Instructions Reference Manual (W561)
  • Page 670: Mc_Savecamtable

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

    5 Common Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • CommandAborted When there is a reason to abort this instruction.
  • Page 672 5 Common Command Instructions Precautions for Correct Use • Use this instruction to save the cam data after it is overwritten before you turn OFF the Con- troller. If you turn OFF the Controller without saving the cam data, the overwritten data will be lost.
  • Page 673 5 Common Command Instructions The second time, the value of Execute is held. Execute Done Busy CommandAborted Error ErrorID 16#0000 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.
  • Page 674 5 Common Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 Error code  Error Codes Refer to the NY-series Troubleshooting Manual (Cat. No. W564) for instruction errors. 5-12 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 675: 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 Graphic expression ST expression MC_Write Write MC MC_Write_instance ( MC_Write_instance Setting Target :=parameter, MC_Write SettingValue :=parameter, Target Target SettingValue SettingValue Execute :=parameter,...
  • Page 676 5 Common Command Instructions Name Meaning Data type Valid range Default Description Parameter- Parameter _eMC_PA- 0: _mcChkVel Specify the parameter to write. Number Number RAME- 1: _mcChkAcc 0: Velocity Warning Value/Interpolation TER_NUM- 2: _mcChkDec Velocity Warning Value 1: Acceleration Warning Value/Interpola- 3: _mcPosiChkTrq tion Acceleration Warning Value 4: _mcNegaChkTrq...
  • Page 677 5 Common Command Instructions Parameter Data type Valid range Comments Positive Software Limit LREAL Negative number, positive The unit is command units. number, or 0 Negative Software Limit LREAL Negative number, positive The unit is command units. number, or 0 In-position Check Time UINT 0 to 10000...
  • Page 678: Function

    5 Common Command Instructions In-Out Variables Valid Name Meaning Data type Description range Target Write Target _sAXIS_REF Specify the axis or axes group for which to write a parameter. _sGROUP_R SettingValue Setting Value Depends on Specify the value to write. the data type The valid range follows the motion control param- of the speci-...
  • Page 679 5 Common Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 Value of _mcChkDec Re-execution of Motion Control Instructions If Execute for the same instance of this instruction changes to TRUE while Busy is TRUE, the instruc- tion is re-executed. When that happens, the instruction overwrites the previous values of the Target (Write Target), ParameterNumber, and SettingValue with the values that are specified when Execute changes to TRUE.
  • Page 680: Mc_Generatecamtable

    5 Common Command Instructions MC_GenerateCamTable The MC_GenerateCamTable instruction creates a cam table for the CamProperty (Cam Properties) and CamNodes (Cam Nodes) specified in the I/O variables. Instruction Name Graphic expression ST expression MC_Generate- Generate MC_GenerateCamTable_instance MC_GenerateCamTable_instance CamTable Cam Table MC_GenerateCamTable CamTable :=parameter, CamTable CamTable...
  • Page 681 5 Common Command Instructions Data Name Meaning Valid range Description type CommandAborted Command BOOL TRUE or TRUE when the instruction is aborted. Aborted FALSE Error Error BOOL TRUE or TRUE while there is an error. FALSE ErrorID Error Code WORD Contains the error code when an error occurs.
  • Page 682: Function

    5 Common Command Instructions If you use a user-defined variable, create an array variable with a starting element number of 0 and a maximum of 358 array elements N. 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.
  • Page 683 5 Common Command Instructions 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 684 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 Elements) instruction in the user program.
  • Page 685 5 Common Command Instructions  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 Stu- dio.
  • Page 686 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 ele- ment numbers.
  • Page 687 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 688 5 Common Command Instructions Element No. Phase (Phase) Distance (Displacement) 1800 (Undefined) (Undefined) 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 689 5 Common Command Instructions 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. Element No. Phase (Phase) Distance (Displacement) 1799 179.9 179.9 1800 180.0 180.0 1801 180.1 179.9...
  • Page 690 5 Common Command Instructions 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. In this example, 3600 would be output. This completes execution of the instruction.
  • Page 691 5 Common Command Instructions = 3 - (2 · V ) · init final init = (V ) · init final init final init T = CycleTime · pitch: PhasePitch of element m in CamNodes CycleTime: CycleTime (Cycle Time) in CamProperty (Cam Properties) : Largest value of Phase (Master Axis Phase) in valid nodes of CamNodes : Initial velocity of cam profile curve [command units/s] init...
  • Page 692 5 Common Command Instructions  Displacement Calculation Method for Polynomic 5 The element number in the array variable specified for CamNodes is “m.” When polynomic 5 is specified for Curve (Curve Shape) of element m, Phase of element m-1 is set as the initial value P of the master axis phase.
  • Page 693 5 Common Command Instructions final init T = CycleTime · pitch: PhasePitch of element m in CamNodes CycleTime: CycleTime (Cycle Time) in CamProperty (Cam Properties) : Largest value of Phase (Master Axis Phase) in valid nodes of CamNodes : Initial acceleration of cam profile curve [command units/s init However, when m = 0, = InitAcc (Initial Acceleration) in CamProperty (Cam Properties)
  • Page 694 5 Common Command Instructions Execute Done Busy CommandAborted Error ErrorID 16#0000 _MC_COM.Status.GenerateCamBusy 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. However, creation of the cam table will continue. Multi-execution of Motion Control Instructions ...
  • Page 695: Sample Programming

    5 Common Command Instructions Depending on ErrorID (Error Code), attached information is output to ErrorParameterCode (Parameter Detail Code) and ErrorNodePointIndex (Node Point Element Number). Execute Done Busy CommandAborted Error ErrorID Error code ErrorParameterCode Parameter detail code ErrorNodePointIndex Node point element number Even if an error occurs during execution of the instruction, the cam data variable specified for CamTable retains the same values as before the execution.
  • Page 696 5 Common Command Instructions Parameter Settings The minimum settings required for this sample programming are given below.  Axis Parameters Axis Type Axis Axis type Axis 1 Servo axis Axis 2 Servo axis Count Modes Axis Count mode Axis 1 Rotary Mode Axis 2 Rotary Mode...
  • Page 697 5 Common Command Instructions  Cam Nodes The initial values of the cam node variable are given in the following table. Connec- Distance Connecting- Connec- tingAc- Ele- Phase Connectin- Phase- (Slave VelEnable tingVel cEnable (Master Curve gAcc Pitch Axis Dis- (Connecting (Connect- (Connect-...
  • Page 698 5 Common Command Instructions Name Data type Default Comment Pwr2_Status BOOL 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 The Servo is turned ON if this variable is TRUE and EtherCAT...
  • Page 699 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  Sample Programming If StartPg is TRUE, check that the Servo Drives for each axis are ready.
  • Page 700 5 Common 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 in the MC Common Error Status variable or for any of the axes, the error handler for the device (FaultHandler) is executed.
  • Page 701 5 Common Command Instructions If WriteCamDefinition is TRUE and the MC_GenerateCamTable (Generate Cam Table) instruction is not yet executed, the cam properties and cam nodes are written. After the data is written, WriteCamDefinitionDone is changed to TRUE. WriteCamDefinition Note: The contents of the inline ST are given below.
  • Page 702 5 Common Command Instructions CamNode0[1].Curve := _eMC_CAM_CURVE#_mcStraightLine; CamNode0[1].ConnectingVelEnable := FALSE; CamNode0[1].ConnectingVel := REAL#0.000; CamNode0[1].ConnectingAccEnable := FALSE; CamNode0[1].ConnectingAcc := REAL#0.000; CamNode0[2].Phase := REAL#360.000; CamNode0[2].Distance := REAL#0.000; CamNode0[2].Curve := _eMC_CAM_CURVE#_mcPolynomic5; CamNode0[2].ConnectingVelEnable := FALSE; CamNode0[2].ConnectingVel := REAL#0.000; CamNode0[2].ConnectingAccEnable := FALSE; CamNode0[2].ConnectingAcc := REAL#0.000; CamNode0[2].PhasePitch := REAL#0.010;...
  • Page 703 5 Common Command Instructions Name Data type Default Comment CamProperty0 _sMC_CAM_PROP- This is the cam property variable. ERTY CamNode0 ARRAY[0..3] OF This is the cam node variable. _sMC_CAM_NODE _MC_COM.Status.GenerateCamBusy BOOL This is a system-defined variable for motion control. It is TRUE while the cam table creation is in progress.
  • Page 704 5 Common Command Instructions ELSE Pwr1_En:=FALSE; END_IF; //If StartPg is TRUE and the Servo Drive is ready, the Servo for axis 2 is turned O //If the Servo Drive is not ready, the Servo is turned OFF. IF (StartPg=TRUE) AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN Pwr2_En:=TRUE;...
  • Page 705 5 Common Command Instructions //The cam nodes are written. 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; CamNode0[1].ConnectingAcc := REAL#0.000;...
  • Page 706 5 Common Command Instructions CamProperty := CamProperty0, CamNodes := CamNode0, execute := Gene_Exe, Done => Gene_D, EndPointIndex => Gene_EPI, Busy => Gene_Bsy, CommandAborted => Gene_CA, Error => Gene_Err, ErrorID => Gene_ErrID, ErrorParameterCode => Gene_ErrPC, ErrorNodePointIndex => Gene_ErrNPI // MC_Power for master axis (axis 1) PWR1( Axis := MC_Axis000, Enable := Pwr1_En,...
  • Page 707 5 Common Command Instructions Execute := Hm2_Ex, Done => Hm2_D, Busy => Hm2_Bsy, 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 =>...
  • Page 708 5 Common Command Instructions Error => Camin_Err, ErrorID => Camin_ErrID 5-46 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 709: 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 MC_WriteAxisParameter Axis :=parameter, Axis Axis AxisParameter AxisParameter AxisParameter :=parameter, Execute Done Execute :=parameter, Busy Done =>parameter,...
  • Page 710: 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. •...
  • Page 711 5 Common Command Instructions 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 712 5 Common Command Instructions • Do not set the reserved parameters in the axis parameters to any value other than 0. Instruction Details This section describes the instruction in detail.  _sAXIS_PARAM The _sAXIS_PARAM data type is used to specify the values of axis parameter. The axis parameters are configured in members with a structure data type for each type of axis parameters.
  • Page 713 5 Common Command Instructions Parameter Member Data type Valid range Description name CmdPlsCountPer- Command UDINT 1 to 4,294,967,295 Set the number of pulses per motor ro- MotorRotation Pulse Count tation for command positions according Per Motor Ro- to the encoder resolution. tation The command value is converted to the equivalent number of pulses based on...
  • Page 714 5 Common Command Instructions Parameter Member Data type Valid range Description name MaxDec Maximum De- LREAL Non-negative long reals Set the maximum deceleration rate celeration for an axis operation command. There will be no limit to the decelera- tion rate if 0 is set. AccDecOver Acceleration/ _eMC_AC-...
  • Page 715 5 Common Command Instructions Parameter Member Data type Valid range Description name InPosCheckTime In-position UINT 0 or 1 to 10,000 Set the in-position check time in milli- Check Time seconds. Set 0 to check for the end of position- ing only when you define the home position during homing.
  • Page 716 5 Common Command Instructions Parameter Member Data type Valid range Description name MaxPosiTrqLimit Maximum Posi- LREAL 0.0 to 1,000.0 Set the maximum value of the positive tive Torque Limit torque limit. MaxNegaTrqLimit Maximum Neg- LREAL 0.0 to 1,000.0 Set the maximum value of the negative ative Torque torque limit.
  • Page 717 5 Common Command Instructions Parameter Member Data type Valid range Description name FollowingError- Following Error LREAL Non-negative long reals Set the following error warning check WarningVal Warning Value value. Set 0 to disable the following error warning check. (Reserved) (Reserved area) RAY[0..31] OF BYTE...
  • Page 718 5 Common Command Instructions Parameter Member Data type Valid range Description name HomeInputSignal Home Input _eMC_HO 0: _mcZPhase Select the input to use for the home in- Signal ME_INPUT 1: _mcExternalSignal put signal. 0: Use Z-phase input as home 1: Use external home input StartDirection Homing Start _eMC_DI-...
  • Page 719 5 Common Command Instructions Parameter Member Data type Valid range Description name HoldingTime Homing Hold- UINT 0 to 10,000 Set the holding time in milliseconds ing Time when you set the Homing Operation Mode to the proximity reverse turn/ holding time. CompensationVal Homing Com- LREAL...
  • Page 720 5 Common Command Instructions OK: Can be read and written. Axis parameter type Axis parameter name ---: Cannot be read and written. In-position Range In-position Check Time Actual Velocity Filter Time Constant Zero Position Range Other Operation Settings Immediate Stop Input Stop Method Limit Input Stop Method Drive Error Reset Monitoring Time Maximum Positive Torque Limit...
  • Page 721 5 Common Command Instructions OK: Can be read and written. Axis parameter type Axis parameter name ---: Cannot be read and written. Homing Compensation Velocity If Reducer Use of an axis for which to write a parameter is set to TRUE and the Count Mode of the axis is Rotary Mode, the value of Work Travel Distance Per Rotation is not written.
  • Page 722 5 Common Command Instructions You can find out the cause of the error by referring to the value output by ErrorID (Error Code). De- pending on ErrorID (Error Code), attached information is output to ErrorParameterCode (Parameter Detail Code). Execute Done Busy CommandAborted Error...
  • Page 723: 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_ReadAxis- Read Axis MC_ReadAxisParameter ( MC_ReadAxisParameter_instance Parameter Parameters Axis :=parameter, MC_ReadAxisParameter AxisParameter :=parameter, Axis Axis AxisParameter AxisParameter Execute :=parameter, Execute Done Done =>parameter,...
  • Page 724 5 Common Command Instructions Name Timing for changing to TRUE Timing for changing to FALSE • Busy When Execute changes to TRUE. When Done changes to TRUE. • When Error changes to TRUE. • When CommandAborted changes to TRUE. • CommandAborted When this instruction is canceled due to an error.
  • Page 725: Function

    5 Common Command Instructions Function • When Execute changes to TRUE, the MC_ReadAxisParameter instruction reads the axis parame- ters 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 726 5 Common Command Instructions Multi-execution of Motion Control Instructions For details on multi-execution of motion control instructions, refer to the NY-series Industrial Panel PC / Industrial Box PC Motion Control User’s Manual (Cat. No. W559). 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).
  • Page 727: Appendices

    Appendices The appendices describe instructions for which multi-execution is supported and ver- sion information. Instructions for Which Multi-execution Is Supported........ A-2 A-1-1 Axis and Axes Group Status................A-2 A-1-2 State Transitions and Instructions for which Multi-execution Is Supported..A-4 Connecting to NX Units ................A-10 Version Information ..................A-11 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 728: Instructions For Which Multi-Execution Is Supported

    Appendices A-1 Instructions for Which Multi-execu- tion Is Supported Whether multi-execution of motion control instructions is supported depends on the current axis sta- tus, the current axes group status, and the instruction to execute. This section describes the relation- ships 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 729 Appendices Name Data type Meaning Function Continuous BOOL Continuous TRUE during continuous motion without a target Motion position. This state exists during velocity control or torque control. This includes when the velocity is 0 because the target velocity is set to 0 and when the velocity is 0 due to an override factor set to 0 during continuous motion.
  • Page 730: A-1-2 State Transitions And Instructions For Which Multi-Execution Is Supported

    Appendices Name Data type Meaning Function Stopping BOOL Deceleration TRUE until the axes group stops for an MC_Group- Stopping Stop instruction. This includes when Execute is TRUE after the axes group stops for an MC_GroupStop instruction. Axis motion instructions are not executed in this state (CommandAborted = TRUE).
  • Page 731 Appendices a : Disabled b : Standby c : Moving d : Stopping e : ErrorStop  Axis Command Instructions Axes group status be- Axis status before instruction execution fore instruction execu- tion Instruction MC_Power with Enable = TRUE MC_Power with Enable = FALSE MC_MoveJog MC_Home...
  • Page 732 Appendices Axes group status be- Axis status before instruction execution fore instruction execu- tion Instruction MC_SetTorqueLimit MC_ZoneSwitch MC_TouchProbe MC_AbortTrigger MC_AxesObserve MC_SyncMoveVelocity MC_SyncMoveAbsolute MC_Reset MC_ChangeAxisUse (Change unused axis to used axis) MC_ChangeAxisUse (Change used axis to un- used axis) MC_DigitalCamSwitch MC_TimeStampToPos MC_SyncOffsetPosition MC_OffsetPosition If Execute for the MC_Stop instruction is FALSE, the status will change to Standstill (B).
  • Page 733 Appendices • If the error is reset successfully when the servo is OFF or if Execute of the MC_Stop instruction is TRUE, the status will change to Axis Disabled (A). • If the error is reset successfully when the servo is ON, the status will change to Standstill (B). •...
  • Page 734 Appendices An error will occur if the servo is ON. The status changes as follows for the given conditions: • If the error is reset successfully when the servo is OFF, the status will change to Axes Group Disabled (a). •...
  • Page 735 Appendices Axis status before instruction execution Instruction Axis Disabled Error Deceleration Stopping MC_SetOverride MC_ResetFollowingError MC_CamIn MC_CamOut MC_CamMonitor MC_GearIn MC_GearInPos MC_GearOut MC_MoveLink MC_CombineAxes MC_Phasing MC_TorqueControl MC_SetTorqueLimit MC_ZoneSwitch MC_TouchProbe MC_AbortTrigger MC_AxesObserve MC_SyncMoveVelocity MC_SyncMoveAbsolute MC_Reset MC_ChangeAxisUse (Change unused axis to used axis) MC_ChangeAxisUse (Change used axis to unused axis) MC_DigitalCamSwitch MC_TimeStampToPos...
  • Page 736: A-2 Connecting To Nx Units

    Appendices A-2 Connecting to NX Units Observe the following precautions when you use the NX-series Position Interface Units. NX-series Position Interface Units With the NX-series Position Interface Units, some motion control instructions are subject to functional restrictions and others cannot be used. Refer to the NX-series Position Interface Units User’s Manual (Cat.
  • Page 737: A-3 Version Information

    Appendices A-3 Version Information This appendix provides information related to the different unit versions of the NY-series Controllers and for different versions of the Sysmac Studio. Instructions with Specifications Changes and New Instructions for Version Upgrades The instructions that are supported and their specifications depend on the unit version of the Control- ler and the version of the Sysmac Studio.
  • Page 738 Appendices A-12 NY-series Motion Control Instructions Reference Manual (W561)
  • Page 739: Index

    Index NY-series Motion Control Instructions Reference Manual (W561)
  • Page 740 Index Index Absolute Linear Interpolation...........4-40 Linear Interpolation........4-11, 4-40, 4-43 Absolute Positioning............3-53 Axes Group Cyclic Synchronous Absolute Positioning... 4-99 Axes Group Immediate Stop........... 4-82 MC_AbortTrigger (Disable External Latch)....3-381 MC_AxesObserve (Monitor Axis Following Error)..3-385 MC_CamIn (Start Cam Operation)........ 3-174 Cam Monitor..............3-237 MC_CamMonitor (Cam Monitor)........
  • Page 741 Index MC_SetPosition (Set Position)........3-154 MC_SetTorqueLimit (Set Torque Limit)......3-348 MC_Stop (Stop).............3-140 Write Axis Parameters............. 5-47 MC_SyncMoveAbsolute (Cyclic Synchronous Absolute Po- Write MC Setting..............5-13 sitioning)..............3-401 MC_SyncMoveVelocity (Cyclic Synchronous Velocity Con- trol)................3-391 Zone Monitor..............3-355 MC_SyncOffsetPosition (Cyclic Synchronous Position Offset Compensation)............3-448 MC_TimeStampToPos (Time Stamp to Axis Position Calcu- lation).................
  • Page 742 Index NY-series Motion Control Instructions Reference Manual (W561)
  • Page 744 The Netherlands Hoffman Estates, IL 60169 U.S.A. Tel: (31)2356-81-300/Fax: (31)2356-81-388 Tel: (1) 847-843-7900/Fax: (1) 847-843-7787 © OMRON Corporation 2016-2019 All Rights Reserved. OMRON (CHINA) CO., LTD. OMRON ASIA PACIFIC PTE. LTD. In the interest of product improvement, Room 2211, Bank of China Tower, No.

Table of Contents