Mitsubishi Electric Q173HCPU Programming Manual

Mitsubishi Electric Q173HCPU Programming Manual

Q series motion controller
Hide thumbs Also See for Q173HCPU:
Table of Contents

Advertisement

Quick Links

MOTION CONTROLLERS
SV13/SV22(Motion SFC)
Q173HCPU
Q172HCPU
Programming Manual

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric Q173HCPU

  • Page 1 MOTION CONTROLLERS SV13/SV22(Motion SFC) Q173HCPU Q172HCPU Programming Manual...
  • Page 2: Safety Precautions

    When using this equipment, thoroughly read this manual and the associated manuals introduced in this manual. Also pay careful attention to safety and handle the module properly. These precautions apply only to this equipment. Refer to the Q173HCPU/Q172HCPU Users manual for a description of the Motion controller safety precautions.
  • Page 3 For Safe Operations 1. Prevention of electric shocks DANGER Never open the front case or terminal covers while the power is ON or the unit is running, as this may lead to electric shocks. Never run the unit with the front case or terminal cover removed. The high voltage terminal and charged sections will be exposed and may lead to electric shocks.
  • Page 4 3. For injury prevention CAUTION Do not apply a voltage other than that specified in the instruction manual on any terminal. Doing so may lead to destruction or damage. Do not mistake the terminal connections, as this may lead to destruction or damage. Do not mistake the polarity ( + / - ), as this may lead to destruction or damage.
  • Page 5 CAUTION The brakes (electromagnetic brakes) assembled into the servomotor are for holding applications, and must not be used for normal braking. The system must have a mechanical allowance so that the machine itself can stop even if the stroke limits switch is passed through at the max. speed. Use wires and cables that have a wire diameter, heat resistance and bending resistance compatible with the system.
  • Page 6 CAUTION Set the sequence function program capacity setting, device capacity, latch validity range, I/O assignment setting, and validity of continuous operation during error detection to values that are compatible with the system application. The protective functions may not function if the settings are incorrect.
  • Page 7 CAUTION Securely fix the Motion controller and servo amplifier to the machine according to the instruction manual. If the fixing is insufficient, these may come off during operation. Always install the servomotor with reduction gears in the designated direction. Failing to do so may lead to oil leaks.
  • Page 8 (4) Wiring CAUTION Correctly and securely wire the wires. Reconfirm the connections for mistakes and the terminal screws for tightness after wiring. Failing to do so may lead to run away of the servomotor. After wiring, install the protective covers such as the terminal covers to the original positions. Do not install a phase advancing capacitor, surge absorber or radio noise filter (option FR-BIF) on the output side of the servo amplifier.
  • Page 9 (6) Usage methods CAUTION Immediately turn OFF the power if smoke, abnormal sounds or odors are emitted from the Motion controller, servo amplifier or servomotor. Always execute a test operation before starting actual operations after the program or parameters have been changed or after maintenance and inspection. The units must be disassembled and repaired by a qualified technician.
  • Page 10 CAUTION If an error occurs, remove the cause, secure the safety and then resume operation after alarm release. The unit may suddenly resume operation after a power failure is restored, so do not go near the machine. (Design the machine so that personal safety can be ensured even if the machine restarts suddenly.) (8) Maintenance, inspection and part replacement CAUTION...
  • Page 11 (9) About processing of waste When you discard Motion controller, servo amplifier, a battery (primary battery) and other option articles, please follow the law of each country (area). CAUTION This product is not designed or manufactured to be used in equipment or systems in situations that can affect or endanger human life.
  • Page 12: Revisions

    This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
  • Page 13: Table Of Contents

    INTRODUCTION Thank you for choosing the Q173HCPU/Q172HCPU Motion Controller. Please read this manual carefully so that equipment is used to its optimum. CONTENTS Safety Precautions ............................A- 1 Revisions ................................A-11 Contents .................................A-12 About Manuals ...............................A-17 1. OVERVIEW 1- 1 to 1-50 1.1 Overview..............................
  • Page 14 4.3 Branch and Coupling Chart List....................... 4- 5 4.4 Motion SFC Program Name ........................4- 9 4.5 Steps................................. 4-10 4.5.1 Motion control step ..........................4-10 4.5.2 Operation control step........................4-11 4.5.3 Subroutine call/start step........................4-12 4.5.4 Clear step ............................4-14 4.6 Transitions ..............................
  • Page 15 5.6.12 Round-down : FIX ........................... 5-35 5.6.13 Round-up : FUP ..........................5-36 5.6.14 BCD BIN conversion : BIN ......................5-37 5.6.15 BIN BCD conversion : BCD......................5-38 5.7 Type Conversions ............................ 5-39 5.7.1 Signed 16-bit integer value conversion : SHORT ................5-39 5.7.2 Unsigned 16-bit integer value conversion : USHORT ..............
  • Page 16 6. TRANSITION PROGRAMS 6- 1 to 6- 2 6.1 Transition Programs..........................6- 1 7. MOTION CONTROL PROGRAMS 7- 1 to 7-22 7.1 Servo Instruction List..........................7- 1 7.2 Servomotor/Virtual Servomotor Shaft Current Value Change..............7-14 7.3 Synchronous Encoder Shaft Current Value Change Control (SV22 only)..........7-17 7.4 Cam Shaft Within-One-Revolution Current Value Change Control (SV22 only) ........
  • Page 17 11. ERROR CODE LISTS 11- 1 to 11-12 11.1 Reading Procedure for Error Codes....................11- 1 11.2 Motion SFC Error Code List ........................ 11- 2 11.3 Motion SFC Parameter Errors ......................11-11 APPENDICES APP- 1 to APP-31 APPENDIX 1 Processing Times.......................APP- 1 APPENDIX 1.1 Processing time of operation control/Transition instruction ........APP- 1 APPENDIX 2 Sample Program ........................APP- 9 APPENDIX 2.1 Program example to execute the Multiple CPU dedicated instruction continuously.APP- 9...
  • Page 18: About Manuals

    This manual explains the Multiple CPU system configuration, performance specifications, common IB-0300111 (1XB911) parameters, auxiliary/applied functions and others. (Optional) Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE) IB-0300113 This manual explains the servo parameters, positioning instructions, device list, error list and others. (1XB913) (Optional)
  • Page 19 (2) PLC Manual Number Manual Name (Model Code) QCPU User's Manual (Hardware Design, Maintenance and Inspection) This manual explains the specifications of the QCPU modules, power supply modules, base modules, SH-080483ENG (13JR73) extension cables, memory card battery and others. (Optional) QCPU User's Manual (Function Explanation, Program Fundamentals) This manual explains the functions, programming methods and devices and others to create programs SH-080484ENG...
  • Page 20: Overview

    1.1 Overview This programming manual describes the Motion SFC program and Multiple CPU system of the operating system software packages "SW6RN-SV13Q ", "SW6RN- SV22Q " for Motion CPU module(Q173HCPU/Q172HCPU). In this manual, the following abbreviations are used. Generic term/Abbreviation Description...
  • Page 21 Programming Manual (COMMON) • Auxiliary and applied functions (common) SV13/SV22 • Design method for positioning control program in the real mode Q173HCPU/Q172HCPU Motion controller (SV13/SV22) • Design method for positioning control Programming Manual (REAL MODE) parameter SV22 • Design method for mechanical system...
  • Page 22: Features

    1 OVERVIEW 1.2 Features The Motion CPU and Motion SFC program have the following features. 1.2.1 Features of Motion SFC programs (1) Since a program intelligible for anyone can be created in flow chart form by macking a sequence of machine operation correspond to each operation step, maintenance nature improves.
  • Page 23: Performance Specifications

    1 OVERVIEW 1.2.2 Performance specifications (1) Basic specifications of Q173HCPU/Q172HCPU (a) Motion control specifications Item Q173HCPU Q173HCPU-T Q172HCPU Q172HCPU-T Number of control axes Up to 32 axes Up to 8 axes 0.44ms/ 1 to 3 axes 0.88ms/ 4 to 10 axes 0.44ms/ 1 to 3 axes...
  • Page 24 1 OVERVIEW Motion control specifications (continued) Item Q173HCPU Q173HCPU-T Q172HCPU Q172HCPU-T Number of SSCNET 2 systems 1 system (Note-1) systems Q172LX : 4 modules usable Q172LX : 1 module usable Motion related interface Q172EX : 6 modules usable Q172EX : 4 modules usable...
  • Page 25: Operation Control/Transition Control Specifications

    1 OVERVIEW 1.2.3 Operation control/transition control specifications (1) Table of the operation control/transition control specifications Item Specifications Remark Returns a numeric result. Calculation expression Expressions for calculating indirectly specified data using constants D100+1,SIN(D100), etc. and word devices. Bit conditional Returns a true or false result. M0, !M0, M1*M0, Expression expression...
  • Page 26 1 OVERVIEW Table of the operation control/transition control specification (continued) Item Specifications Remark Accessibility Usable tasks Description Devices Symbol example Read Write Normal Event Data register Link register W1F : F Special register D9000 Motion register Word devices Coasting timer : usable : unusable CAUTION...
  • Page 27 1 OVERVIEW (2) Table of the operation control/transition instruction Usable step transition's Section of Classification Symbol Function Format Basic steps conditional reference F/FS expression Substitution (D)=(S) — 5.4.1 Addition (S1)+(S2) — 5.4.2 Subtraction (S1)-(S2) — 5.4.3 Binary operation Multiplication (S1)*(S2) —...
  • Page 28 1 OVERVIEW Table of the operation control/transition instruction (continued) Usable step transition's Section of Classification Symbol Function Format Basic steps conditional reference F/FS expression (None) Logical acknowledgment (Conditional expression) 5.10.1 Logical negation !(Conditional expression) 5.10.2 (Conditional expression) * Logical operation Logical AND 5.10.3 (conditional expression)
  • Page 29: Differences Between Q173Hcpu/Q172Hcpu And Q173Cpu(N)/Q172Cpu(N)

    (Note-2) : When selecting the each servo amplifier input, the speed/position switching control cannot be executed. And, the external stop input cannot be used. (Note-3) : When adding the external battery (Q6BAT), use the Q170HBATC. (Note-4) : When adding the external battery (A6BAT/MR-BAT), use the Q173DV (Q173HCPU use) or Q170BAT (Q172HCPU use). 1 - 10...
  • Page 30: Restrictions By The Version

    The combination of each version and a function is shown below. Operating system CPU module version Programming Section of Function software version software version reference Q173HCPU(-T) Q172HCPU(-T) (Note-1) Bit device setting by Motion SFC instruction Section (BMOV, FMOV, MULTW, MULTR, TO, — — 5.13.4 to 5.13.9 FROM) Fully closed loop control servo amplifer —...
  • Page 31: Positioning Dedicated Devices/Special Relays/Special Registers

    (1) Positioning dedicated devices The following section describes the positioning dedicated devices. A range of up to 32 axes is valid in Q173HCPU, and a range of up to 8 axes is valid in Q172HCPU. Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)", "Q173HCPU/Q172HCPU Motion...
  • Page 32 1 OVERVIEW Overall configuration (Continued) SV13 SV22 Device No. Purpose Device No. Purpose M4800 M4800 Virtual servomotor axis command signal (Note-1,2) (20 points 32 axes) (Mechanical system setting axis only) M5440 Synchronous encoder axis command signal (Note-2) (4 points 12 axes) Cam axis command signal M5488 (Note-1,2)
  • Page 33 1 OVERVIEW 1) Table of the axis statuses (SV13/SV22) Device No. Signal name Device No. Signal name M2400 M2720 Axis 1 status Axis 17 status M2419 M2739 M2420 M2740 Axis 2 status Axis 18 status M2439 M2759 M2440 M2760 Axis 3 status Axis 19 status M2459 M2779...
  • Page 34 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : Device area of 9 axes or more is unusable in the Q172HCPU.
  • Page 35 1 OVERVIEW 2) Table of the axis command signals (SV13/SV22) Device No. Signal name Device No. Signal name M3200 M3520 Axis 1 command signal Axis 17 command signal M3219 M3539 M3220 M3540 Axis 2 command signal Axis 18 command signal M3239 M3559 M3240...
  • Page 36 FIN signal (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : Device area of 9 axes or more is unusable in the Q172HCPU.
  • Page 37 1 OVERVIEW 3) Table of the virtual servomotor axis statuses (SV22 only) Device No. Signal name Device No. Signal name M4000 M4320 Axis 1 status Axis 17 status M4019 M4339 M4020 M4340 Axis 2 status Axis 18 status M4039 M4359 M4040 M4360 Axis 3 status...
  • Page 38 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : The unused axis areas in the mechanical system program can be used as an user device.
  • Page 39 1 OVERVIEW 4) Table of the virtual servomotor axis command signals (SV22 only) Device No. Signal name Device No. Signal name M4800 M5120 Axis 1 command signal Axis 17 command signal M4819 M5139 M4820 M5140 Axis 2 command signal Axis 18 command signal M4839 M5159 M4840...
  • Page 40 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : The unused axis areas in the mechanical system program can be used as an user device.
  • Page 41 1 OVERVIEW 5) Table of the synchronous encoder axis statuses (SV22 only) Device No. Signal name M4640 Error detection M4641 External signal TREN Axis 1 M4642 Virtual mode continuation operation disable warning M4643 Unusable M4644 Error detection M4645 External signal TREN Axis 2 M4646 Virtual mode continuation operation disable warning...
  • Page 42 1 OVERVIEW 6) Table of the syncronous encoder axis command signals (SV22 only) Device No. Signal name M5440 Error reset M5441 Unusable Axis 1 M5442 Unusable M5443 Unusable M5444 Error reset M5445 Unusable Axis 2 M5446 Unusable M5447 Unusable M5448 Error reset M5449 Unusable...
  • Page 43 1 OVERVIEW 7) Table of the cam axis command signals (SV22 only) Device No. Signal name M5488 Axis 1 cam/ballscrew switching M5489 Axis 2 cam/ballscrew switching M5490 Axis 3 cam/ballscrew switching M5491 Axis 4 cam/ballscrew switching M5492 Axis 5 cam/ballscrew switching M5493 Axis 6 cam/ballscrew switching M5494...
  • Page 44 1 OVERVIEW 8) Table of the smoothing clutch complete signals (SV22 only) Device No. Signal name Refresh cycle Fetch cycle Signal direction Remark M5520 Main shaft side Output axis 1 M5521 Auxiliary input side M5522 Main shaft side Output axis 2 M5523 Auxiliary input side M5524...
  • Page 45 1 OVERVIEW 9) Table of the common devices (SV13/SV22) SV13 SV22 Refresh Fetch Signal Remark cycle cycle direction (Note-4) Device No. Signal name Device No. Signal name Command Main signal M3072 M2000 PLC ready flag M2000 PLC ready flag cycle (Note-1) M2001 Axis1...
  • Page 46 1 OVERVIEW Table of the common devices (SV13/SV22) (continued) SV13 SV22 Refresh Fetch Signal Remark (Note-4) cycle cycle direction Device No. Signal name Device No. Signal name Operation Status M2054 Operation cycle over flag M2054 Operation cycle over flag cycle signal M2055 M2055...
  • Page 47 1 OVERVIEW Explanation of the request register Function Bit device Request register PLC ready flag M2000 D704 Speed switching point specified flag M2040 D705 All axes servo ON command M2042 D706 Real/virtual mode switching request (SV22) M2043 D707 JOG operation simultaneous start command M2048 D708 Manual pulse generator 1 enable flag...
  • Page 48 1 OVERVIEW 10) Table of the special relay allocated devices (Status) (SV13/SV22) (Note) Device No. Signal name Refresh cycle Fetch cycle Signal direction Remark M2320 Fuse blown detection M9000 M2321 AC/DC DOWN detection M9005 M2322 Battery low M9006 Error occurrence M2323 Battery low latch M9007...
  • Page 49 1 OVERVIEW 11) Table of the common devices (Command signal) (SV13/SV22) Remark Device No. Signal name Refresh cycle Fetch cycle Signal direction (Note-1) , (Note-2) Main cycle M3072 PLC ready flag M2000 M3073 Speed switching point specified flag At start M2040 Operation M3074...
  • Page 50 1 OVERVIEW (b) Table of the data registers Overall configuration SV13 SV22 Device No. Application Device No. Application Axis monitor device Axis monitor device (20 points 32 axes) (20 points 32 axes) Real mode……Each axis Virtual mode….Output module D640 D640 Control change register Control change register (2 points 32 axes)
  • Page 51 1 OVERVIEW 1) Table of the each axis monitor devices (SV13/SV22) Device No. Signal name Device No. Signal name D320 Axis 1 monitor device Axis 17 monitor device D339 D340 Axis 2 monitor device Axis 18 monitor device D359 D360 Axis 3 monitor device Axis 19 monitor device D379...
  • Page 52 D19 + 20n (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : Device area of 9 axes or more is unusable in the Q172HCPU.
  • Page 53 1 OVERVIEW MEMO 1 - 34...
  • Page 54 1 OVERVIEW 2) Table of the control change registers (SV13/SV22) Device No. Signal name Device No. Signal name D640 Axis 1 JOG speed D672 Axis 17 JOG speed D641 setting register D673 setting register D642 Axis 2 JOG speed D674 Axis 18 JOG speed D643 setting register...
  • Page 55 1 OVERVIEW 3) Table of the virtual servomotor axis monitor devices (SV22 only) Device No. Signal name Device No. Signal name D800 D960 Axis 1 monitor device Axis 17 monitor device D809 D969 D810 D970 Axis 2 monitor device Axis 18 monitor device D819 D979 D820...
  • Page 56 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : The unused axis areas in the mechanical system program can be used as an user device.
  • Page 57 1 OVERVIEW 4) Table of the synchronous encoder axis monitor devices (SV22 only) Device No. Signal name D1120 Axis 1 monitor device D1129 D1130 Axis 2 monitor device D1139 D1140 Axis 3 monitor device D1149 D1150 Axis 4 monitor device D1159 D1160 Axis 5 monitor device...
  • Page 58 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.12 (n=0 to 11) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : Device area of 9 axes or more is unusable in the Q172HCPU.
  • Page 59 1 OVERVIEW 5) Table of the cam axis monitor devices (SV22 only) Device No. Signal name Device No. Signal name D1240 D1400 Axis 1 monitor device Axis 17 monitor device D1249 D1409 D1250 D1410 Axis 2 monitor device Axis 18 monitor device D1259 D1419 D1260...
  • Page 60 (Note-1) : "n" in the above device No. shows the numerical value which correspond to axis No. Q173HCPU : Axis No.1 to No.32 (n=0 to 31) Q172HCPU : Axis No.1 to No.8 (n=0 to 7) (Note-2) : The unused aixs areas in the mechanical system program can be used as an user device.
  • Page 61 1 OVERVIEW 6) Table of the common devices (SV13/SV22) Signal Signal Device No. Signal name Device No. Signal name derecrtion derecrtion D704 PLC ready flag request D740 Axis 21 Speed switching point specified flag D705 D741 Axis 22 request D706 All axes servo ON command request D742 Axis 23...
  • Page 62 1 OVERVIEW (2) Special relays Special relays are internal relays whose applications are fixed in the Motion CPU. For this reason, they cannot be used in the same way as the normal internal relays by the Motion SFC programs. However, they can be turned ON/OFF as needed in order to control the Motion CPU.
  • Page 63 1 OVERVIEW Table 2.1 Special relay list Set by Name Meaning Details Remark (When set) OFF : Normal • Turn on when there is one or more output modules control M9000 Fuse blown detection : Fuse blown module of self CPU which fuse has been blown. detected Remains on if normal status is restored.
  • Page 64 1 OVERVIEW Table 2.1 Special relay list (continued) Set by Name Meaning Details Remark (When set) • This flag indicates whether the setting designated at the : At least one D714 to manual pulse generator axis setting register (D714 to D719) D719 setting is Manual pulse generator is normal or abnormal.
  • Page 65 1 OVERVIEW (3) Special registers Special registers are internal registers whose applications are fixed in the Motion CPU. For this reason, it is not possible to use these registers in Motion SFC programs in the same way that normal registers are used. However, data can be written as needed in order to control the Motion CPU.
  • Page 66 • When error is found as a result of self-diagnosis, error No. is stored in BIN code. Dignostic error D9008 Diagnostic error • Refer to "2.4 Multiple CPU Error Codes" of the "Q173HCPU/Q172HCPU number Motion controller Programming Manual (COMMON)" for details of the error code.
  • Page 67 1 OVERVIEW Table 2.2 Special register list (continued) Set by Name Meaning Details Remark (When set) • Stores the day and hour in BCD. Example : 31st, 10 a.m. Clock data H3110 D9026 (Day, hour) Hour • Stores the minute and second in BCD. Example : 35 min., 48 sec.
  • Page 68 1 OVERVIEW Table 2.2 Special register list (continued) Set by Name Meaning Details Remark (When set) Motion operation Motion operation • The time when the motion operation cycle is stored in the [ µ s] unit. D9188 S(Operation cycle) cycle cycle Error program Error program No.
  • Page 69 1 OVERVIEW MEMO 1 - 50...
  • Page 70: Structure Of The Motion Cpu Program

    Section 4 in this manual Motion control in SV13/SV22 real mode Q173HCPU/Q172HCPU Motion controller (Servo program) (SV13/SV22) Programming Manual (REAL MODE) Motion control in SV22 virtual mode Q173HCPU/Q172HCPU Motion controller (SV22) (Mechanical system program) Programming Manual (VIRTUAL MODE) 2 - 1...
  • Page 71: Motion Control In Sv13/Sv22 Real Mode

    2 STRUCTURE OF THE MOTION CPU PROGRAM 2.1 Motion Control in SV13/SV22 Real Mode (1) System with servomotor is controlled directly using the servo program in (SV13/SV22) real mode. (2) Setting of the positioning parameter and creation of the servo program/ Motion SFC program are required.
  • Page 72: Motion Control In Sv22 Virtual Mode

    2 STRUCTURE OF THE MOTION CPU PROGRAM 2.2 Motion Control in SV22 Virtual Mode (1) Software-based synchronous control is performed using the mechanical system program constructed by virtual main shaft and mechanical module in (SV22) virtual mode. (2) Mechanical system programs is required in addition to the positioning parameter, servo program/Motion SFC program used in real mode.
  • Page 73 2 STRUCTURE OF THE MOTION CPU PROGRAM MEMO 2 - 4...
  • Page 74: Motion Dedicated Plc Instruction

    3 MOTION DEDICATED PLC INSTRUCTION 3. MOTION DEDICATED PLC INSTRUCTION 3.1 Motion Dedicated PLC Instruction (1) The Motion dedicated PLC instruction which can be executed toward the Motion CPU which installed a SV13/SV22 operating system software for the Motion SFC is shown below.
  • Page 75 3 MOTION DEDICATED PLC INSTRUCTION Shared CPU memory address Example of the reading Description ( ) is decimal (When target is the CPU No.2) address The lowest rank bit (30H(48)) toward executing instruction 30H(48) U3E1/G48.0 from CPU No.1. The lowest rank bit (31H(49)) toward executing instruction 31H(49) U3E1/G49.0 from CPU No.2.
  • Page 76 3 MOTION DEDICATED PLC INSTRUCTION (d) Use a flag in the shared CPU memory which correspond with each instruction not to execute multiple instructions to the same shaft of the Motion CPU of same CPU No. for the interlock condition. (Program example 1) (e) S(P).SFCS/S(P).SVST/S(P).CHGA/S(P).CHGVS(P).CHGT/S(P).DDWR/ S(P).DDRD instructions cannot be executed simultaneously.
  • Page 77 3 MOTION DEDICATED PLC INSTRUCTION <Program example 2> Program which executes directly multiple Motion dedicated PLC instructions because one contact-point turns on. M1001 M1001 To self CPU high Start accept speed interrupt flag of the Axis 1 accept flag from (CPU No.2) CPU1 U3E1\G516.0...
  • Page 78 3 MOTION DEDICATED PLC INSTRUCTION <Program example 3> Program which executes the Motion dedicated function of the operation control step (Fn/FSn) and the motion control program (Kn). PLC CPU side To self CPU high speed interrupt accept flag from CPU1 U3E1\G48.0 D301 (Note)
  • Page 79 3 MOTION DEDICATED PLC INSTRUCTION (3) Complete status The error code is stored in the complete status at abnormal completion of the Multiple CPU dedicated instruction. The error code which is stored is shown below. (The error code marked " * " is dedicated with the Motion CPU.) Complete status Corrective Error factor...
  • Page 80 The start accept flag is stored by the 1 to 32 axis, each bit. (As for a bit's actually being set Q173HCPU : J1 to J32/ 204H(516) Start accept flag (Axis1 to 16) Q172HCPU : J1 to J8.)
  • Page 81: Motion Sfc Start Request From The Plc Cpu To The Motion Cpu: S(P).Sfcs (Plc Instruction: S(P).Sfcs )

    3 MOTION DEDICATED PLC INSTRUCTION 3.2 Motion SFC Start Request from The PLC CPU to The Motion CPU: S(P).SFCS (PLC instruction: S(P).SFCS ) Usable devices Internal devices MELSECNET/10 Special Indirectly Index File Constant (System, User) direct J \ function digit specified register Other...
  • Page 82 3 MOTION DEDICATED PLC INSTRUCTION (2) Request to start the Motion SFC program of the program No. specified with (n2). The Motion SFC program can start any task setting of the normal task, event task and NMI task. (3) This instruction is always effective regardless of the state of real mode/virtual mode/mode switching when the operating system software of Motion CPU is SV22.
  • Page 83 3 MOTION DEDICATED PLC INSTRUCTION [Errors] The abnormal completion in the case shown below, and the error code is stored in the device specified with the complete status storing device (D2). Complete status (Note) Corrective Error factor (Error code)(H) action The specified device cannot be used in the Motion CPU.
  • Page 84: Servo Program Start Request From The Plc Cpu To The Motion Cpu: S(P).Svst (Plc Instruction: S(P).Svst )

    (Note-1) : Motion CPU cannot used CPU No.1 in the Multiple CPU configuration. (Note-2) : "n" shows the numerical value correspond to axis No.. Q173HCPU : Axis No.1 to No.32 (n=1 to 32) / Q172HCPU : Axis No.1 to No.8 (n=1 to 8) 3 - 11...
  • Page 85 3 MOTION DEDICATED PLC INSTRUCTION [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU. (2) Request to start the servo program specified with (S2). (3) This instruction is always effective regardless of the state of real mode/virtual mode/mode switching when the operating system software of Motion CPU is SV22.
  • Page 86 The axis No. set in the system setting is used as the axis No. to start. Refer to the "Q173HCPU/Q172HCPU Motion controller Programming Manual (COMMON)" for system settings. And, the axis No. to start does not need to be a order.
  • Page 87 ( ) is decimal address The start accept flag is stored by the 1 to 32 axis, each bit. (As for a bit's actually being set Q173HCPU : J1 to J32/ Q172HCPU : J1 to J8.) OFF : Start accept flag usable...
  • Page 88 3 MOTION DEDICATED PLC INSTRUCTION The error flag (SM0) is turned on an operation error in the case shown below, and an error code is stored in SD0. (Note) Error code Error factor Corrective action The CPU No. to be set by "(First I/O No. of the target 2110 CPU)/16"...
  • Page 89: Current Value Change Instruction From The Plc Cpu To The Motion Cpu: S(P).Chga (Plc Instruction: S(P).Chga )

    (Note-1) : Motion CPU cannot used CPU No.1 in the Multiple CPU configuration. (Note-2) : "n" shows the numerical value which correspond to axis No.. Q173HCPU : Axis No.1 to No.32 (n=1 to 32) / Q172HCPU : Axis No.1 to No.8 (n=1 to 8) 3 - 16...
  • Page 90 3 MOTION DEDICATED PLC INSTRUCTION When an axis No."Jn" was specified with (S1) [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU.
  • Page 91 [Setting range] (1) Setting of axis to execute the current value change. The starting axis set as (S1) sets J + Axis No. in a character sequence " ". (S1) usable range Q173HCPU 1 to 32 Q172HCPU 1 to 8...
  • Page 92 ( ) is decimal address The start accept flag is stored by the 1 to 32 axis, each bit. (As for a bit's actually being set Q173HCPU : J1 to J32/ Q172HCPU : J1 to J8.) OFF : Start accept flag usable...
  • Page 93 3 MOTION DEDICATED PLC INSTRUCTION The error flag (SM0) is turned on an operation error in the case shown below, and an error code is stored in SD0. (Note) Error code Error factor Corrective action The CPU No. to be set by "(First I/O No. of the target 2110 CPU)/16"...
  • Page 94 3 MOTION DEDICATED PLC INSTRUCTION When an axis No."En" was specified with (S1) [Controls] (1) This instruction is dedicated instruction toward the Motion CPU at the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU.
  • Page 95 (1) Setting of the synchronous encoder axis to execute the current value change. The synchronous encoder axis to execute the current value change set as (S1) sets E + synchronous encoder axis No. in a character sequence " ". (S1) usable range Q173HCPU 1 to 12 Q172HCPU 1 to 8...
  • Page 96 ( ) is decimal address The synchronous encoder current value changing flag is stored by the 1 to 16 axis, each bit. (As for a bit's actually being set Q173HCPU : E1 to E12/ Q172HCPU : E1 to E8.) OFF : Start accept usable...
  • Page 97 3 MOTION DEDICATED PLC INSTRUCTION The error flag (SM0) is turned on an operation error in the case shown below, and an error code is stored in SD0. (Note) Error code Error factor Corrective action The CPU No. to be set by "(First I/O No. of the target 2110 CPU)/16"...
  • Page 98 3 MOTION DEDICATED PLC INSTRUCTION When an axis No."Cn" was specified with (S1) [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU.
  • Page 99 3 MOTION DEDICATED PLC INSTRUCTION [Operation] PLC program S(P).CHGA execution S(P).CHGA instruction To self CPU high speed interrupt accept flag from CPUn Start accept flag (Cam axis) Current value change Current value change Instruction start accept complete device (D1+0) ON : Abnormal completion only State display device (D1+1) at the instruction start accept completion...
  • Page 100 The cam axis within-one-revolution current value changing flag is stored by the 1 to 32 axis, each bit. (As for a bit's actually being set Q173HCPU : C1 to C32/ Q172HCPU : C1 to C8.) 20CH(524) OFF : Start accept usable...
  • Page 101 3 MOTION DEDICATED PLC INSTRUCTION [Errors] The abnormal completion in the case shown below, and the error code is stored in the device specified with the complete status storing device (D2). Complete status (Note) Error factor Corrective action (Error code)(H) The specified device cannot be used in the Motion 4C00 CPU.
  • Page 102 3 MOTION DEDICATED PLC INSTRUCTION [Program example] Program which changes the current value of the axis No.1 of the Motion CPU (CPU No.4) from PLC CPU (CPU No.1) to 10. To self CPU Cam axis within-one-revolution high speed current value changing flag of the axis interrupt accept No.1 (CPU No.4) flag from CPU...
  • Page 103: Speed Change Instruction From The Plc Cpu To The Motion Cpu: S(P).Chgv (Plc Instruction: S(P).Chgv )

    (Note-1) : Motion CPU cannot used CPU No.1 in the Multiple CPU configuration. (Note-2) : "n" shows the numerical value which correspond to axis No.. Q173HCPU : Axis No.1 to No.32 (n=1 to 32) / Q172HCPU : Axis No.1 to No.8 (n=1 to 8) 3 - 30...
  • Page 104 3 MOTION DEDICATED PLC INSTRUCTION [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU. (2) The speed change is executed of the axis specified with (S1) during positioning or JOG operating.
  • Page 105 ( ) is decimal address The start accept flag is stored by the 1 to 32 axis, each bit. (As for a bit's actually being set Q173HCPU : J1 to J32/ Q172HCPU : J1 to J8.) OFF : Start accept usable...
  • Page 106 3 MOTION DEDICATED PLC INSTRUCTION [Errors] The abnormal completion in the case shown below, and the error code is stored in the device specified with the complete status storing device (D2). Complete status (Note) Error factor Corrective action (Error code)(H) The specified device cannot be used in the Motion 4C00 CPU.
  • Page 107: Torque Limit Value Change Request Instruction From The Plc Cpu To The Motion Cpu: S(P).Chgt (Plc Instruction: S(P).Chgt )

    (Note-1) : Motion CPU cannot used CPU No.1 in the Multiple CPU configuration. (Note-2) : "n" shows the numerical value which correspond to axis No.. Q173HCPU : Axis No.1 to No.32 (n=1 to 32) / Q172HCPU : Axis No.1 to No.8 (n=1 to 8) 3 - 34...
  • Page 108 The number of axes which can set are only 1 axis. The axis No. set in the system setting is used as the axis No. to start. Refer to the "Q173HCPU/Q172HCPU Motion controller Programming Manual (COMMON)" for system settings. 3 - 35...
  • Page 109 3 MOTION DEDICATED PLC INSTRUCTION (2) Setting of the torque limit value to change. (S2) usable range 1 to 1000 [Errors] The abnormal completion in the case shown below, and the error code is stored in the device specified with the complete status storing device (D2). (Note) Complete status Error factor...
  • Page 110 3 MOTION DEDICATED PLC INSTRUCTION [Program example] Program which changes the torque limit value of the axis No.1 of the Motion CPU (CPU No.4) from PLC CPU (CPU No.1) to 10[%]. To self CPU high speed interrupt accept flag from CPU U3E3 \ G48.0 M100...
  • Page 111: Write From The Plc Cpu To The Motion Cpu: S(P).Ddwr (Plc Instruction: S(P).Ddwr )

    3 MOTION DEDICATED PLC INSTRUCTION 3.7 Write from The PLC CPU to The Motion CPU: S(P).DDWR (PLC instruction: S(P).DDWR ) Usable devices Internal devices MELSECNET/10 Special Indirectly Index File Constant (System, User) direct J \ function digit specified register Other register K, H module...
  • Page 112 3 MOTION DEDICATED PLC INSTRUCTION [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU. A part for the number of writing data of the control data specified with (S1) of data since the device specified with (S2) of the self CPU are stored to since the word device specified with (D1) of the target CPU (n1) in the Multiple CPU system.
  • Page 113 3 MOTION DEDICATED PLC INSTRUCTION [Operation] First S(P).DDWR Second S(P).DDWR instruction accept instruction accept To self CPU high speed interrupt accept flag from CPUn (Instruction accept destination buffer memory) S(P).DDWR instruction (First) First S(P).DDWR instruction complete device ON : Abnormal completion State display device at the first S(P).DDWR instruction completion...
  • Page 114 3 MOTION DEDICATED PLC INSTRUCTION The error flag (SM0) is turned on an operation error in the case shown below, and an error code is stored in SD0. (Note) Error code Error factor Corrective action The CPU No. to be set by "(First I/O No. of the target 2110 CPU)/16"...
  • Page 115: Read From The Devices Of The Motion Cpu: S(P).Ddrd (Plc Instruction: S(P).Ddrd )

    3 MOTION DEDICATED PLC INSTRUCTION 3.8 Read from The Devices of The Motion CPU: S(P).DDRD (PLC instruction: S(P).DDRD ) Usable devices Internal devices MELSECNET/10 Special Indirectly Index File Constant (System, User) direct J \ function digit specified register Other register K, H module specified...
  • Page 116 3 MOTION DEDICATED PLC INSTRUCTION [Controls] (1) This instruction is dedicated instruction toward the Motion CPU in the Multiple CPU system. Errors occurs when it was executed toward the CPU except the Motion CPU. A part for the number of reading data of the control data specified with (S1) of data since the device specified with (S2) in the target CPU (n1) is stored to since the word device specified with (D1) of the self CPU in the Multiple CPU system.
  • Page 117 3 MOTION DEDICATED PLC INSTRUCTION [Operation] First S(P).DDRD Second S(P).DDRD instruction accept instruction accept To self CPU high speed interrupt accept flag from CPUn (Instruction accept destination buffer memory) S(P).DDRD instruction (First) First S(P).DDRD instruction complete device ON : Abnormal completion State display device at the first S(P).DDRD instruction completion...
  • Page 118 3 MOTION DEDICATED PLC INSTRUCTION The error flag (SM0) is turned on an operation error in the case shown below, and an error code is stored in SD0. (Note) Error code Error factor Corrective action The CPU No. to be set by "(First I/O No. of the target 2110 CPU)/16"...
  • Page 119: Interrupt Instruction To The Other Cpu: S(P).Gint (Plc Instruction: S(P).Gint )

    3 MOTION DEDICATED PLC INSTRUCTION 3.9 Interrupt Instruction to The Other CPU: S(P).GINT (PLC instruction: S(P).GINT ) Usable devices Internal devices MELSECNET/10 Special Indirectly Index File Constant (System, User) direct J \ function Digit specified register Other register K, H module specified device...
  • Page 120 3 MOTION DEDICATED PLC INSTRUCTION (4) SM390 turn off when the transmission of the instruction toward the target CPU was not completed. SM391 (S(P).GINT instruction execution completion flag) turned off when the instruction toward the target CPU cannot be transmitted. (5) Number of instruction execution does not have restriction, if to self CPU high speed interrupt accept flag from CPUn in the target shared CPU memory of S(P).GINT instruction.
  • Page 121 3 MOTION DEDICATED PLC INSTRUCTION [Program example] Program which generates the interrupt toward the Motion CPU No.4. SP.GINT H3E3 SM391 Normal complete program SM391 The program which generates interruption again. 3 - 48...
  • Page 122: Motion Sfc Programs

    4 MOTION SFC PROGRAMS 4. MOTION SFC PROGRAMS Refer to Chapter "11 ERROR CODE LISTS" for details of Motion SFC program error. 4.1 Motion SFC Program Configuration The Motion SFC Program is constituted by the combination of start, steps, transitions, end and others are shows below.
  • Page 123: Motion Sfc Chart Symbol List

    4 MOTION SFC PROGRAMS 4.2 Motion SFC Chart Symbol List Parts as Motion SFC program components are shown below. The operation sequence or transition control is expressed with connecting these parts by directed lines in the Motion SFC program. Symbol Classification Name List Representation...
  • Page 124 4 MOTION SFC PROGRAMS Symbol Classification Name List representation Function (Code size (byte)) • When just before is the motion control step, transits to the next step by formation of transition condition Gn (G0 to G4095) without waiting for the motion operating completion.
  • Page 125 4 MOTION SFC PROGRAMS Symbol Classification Name List representation Function (Code size (byte)) • When just before is the motion control step, waits for the motion operating completion and then transits to the next step by formation of transition condition Gn IFBm (G0 to G4095).
  • Page 126: Branch And Coupling Chart List

    4 MOTION SFC PROGRAMS 4.3 Branch and Coupling Chart List Branch and coupling patterns which specify step and transition sequences in the Motion SFC charts are shown below. Name List Motion SFC chart symbol Function (Code size (byte)) representation • Steps and transitions connected in series are List processed in order from top to bottom.
  • Page 127 4 MOTION SFC PROGRAMS Combining the basic type branches/couplings provides the following application types, which are defined as in the basic types. List Name Motion SFC chart symbol Function representation • After a selective branch, a parallel branch can be CALL Kn performed.
  • Page 128 4 MOTION SFC PROGRAMS List Name SFC chart symbol Function representation • After a selective branch, a selective branch can be CALL Kn performed. IFBm IFT1 SFT Gn IFBm+1 IFBm IFT1 Selective branch IFT1 IFT2 SFT Gn’ IFBm+1 Selective branch IFT1 IFT2 JMP IFEm+1...
  • Page 129 4 MOTION SFC PROGRAMS List Name SFC chart symbol Function representation • The selective coupling point and parallel branch (JMP IFEm) point can be the same. IFEm Note that in the Motion SFC chart, this type is PABm displayed in order of a selective coupling PAT1 parallel branch, as shown on the left.
  • Page 130: Motion Sfc Program Name

    4 MOTION SFC PROGRAMS 4.4 Motion SFC Program Name Set the "Motion SFC program name" to the Motion SFC program No.0 to No.255 individually. (Make this setting in the "Motion SFC program management window" on the Motion SFC program edit screen.) Set the Motion SFC program name within 16 characters.
  • Page 131: Steps

    4 MOTION SFC PROGRAMS 4.5 Steps 4.5.1 Motion control step Name Symbol Function Starts the servo program Kn. Motion control step Specified range: K0 to K4095 [Operations] (1) Turns on the start accept flag of the axis specified with the specified servo program Kn (n = 0 to 4095) runnnig.
  • Page 132: Operation Control Step

    4 MOTION SFC PROGRAMS 4.5.2 Operation control step Name Symbol Function Executes the operation control program Fn/FSn. Operation Fn/FSn Specified range: F0 to F4095/FS0 to FS4095 control step [Operations] (1) Once execution type operation control step Fn In the case of Fn, executes the specified operation control program Fn (n = 0 to 4095) once.
  • Page 133: Subroutine Call/Start Step

    4 MOTION SFC PROGRAMS 4.5.3 Subroutine call/start step Name Symbol Function Calls/starts the Motion SFC program of the specified Subroutine Program name program name. call/start step [Operations] (1) Calls/starts the Motion SFC program of the specified program name. (2) Control varies with the type of the transition coupled next to the subroutine call/start step.
  • Page 134 4 MOTION SFC PROGRAMS [Instructions] (1) There are no restrictions on the depth of subroutine call/start nesting. (2) For a subroutine start, the start source Motion SFC program continues processing if the start destination Motion SFC program stops due to an error. (3) For a subroutine call, the call source Motion SFC program stops running as soon as the call destination Motion SFC program stops due to an error.
  • Page 135: Clear Step

    4 MOTION SFC PROGRAMS 4.5.4 Clear step Name Symbol Function Stops the Motion SFC program of the specified Clear step Program name program name. [Operations] (1) Stops the specified Motion SFC program running. (2) The clear-specified Motion SFC program will not start automatically after stopped if it has been set to start automatically.
  • Page 136: Transitions

    4 MOTION SFC PROGRAMS 4.6 Transitions You can describe conditional and operation expressions at transitions. The operation expression described here is repeated until the transition condition enables, as at the scan execution type operation step. Refer to Chapter "6 TRANSITION PROGRAMS" for the conditional/operation expressions that can be described in transition conditions.
  • Page 137 4 MOTION SFC PROGRAMS [Instructions] • Always pair a transition with a motion control step one-for-one. If the step following WAITON/WAITOFF is not a motion control step, the Motion SFC program error [16102] will occur and the Motion SFC program running will stop at the error detection.
  • Page 138: Jump, Pointer

    4 MOTION SFC PROGRAMS 4.7 Jump, Pointer Pointer Jump [Operations] • Setting a jump will cause a jump to the specified pointer Pn of the self program. • You can set pointers at steps, transitions, branch points and coupling points. •...
  • Page 139: Branches, Couplings

    4 MOTION SFC PROGRAMS 4.9 Branches, Couplings 4.9.1 Series transition Transits execution to the subsequent step or transition connected in series. (1) To start a servo program or subroutine and shift execution to the next without waiting for operation completion Set Shift at a transition.
  • Page 140: Selective Branch, Selective Coupling

    4 MOTION SFC PROGRAMS 4.9.2 Selective branch, selective coupling (1) Selective branch Executes only the route which condition was judged to have enabled first among the conditions of multiple transitions connected in parallel. Transitions must be all Shifts or WAITs. (Example) WAIT After start axis in the servo Starts the servo program K1.
  • Page 141: Parallel Branch, Parallel Coupling

    4 MOTION SFC PROGRAMS 4.9.3 Parallel branch, parallel coupling (1) Parallel branch Multiple routes connected in parallel are executed simultaneously. Each parallel branch destination may be started by either a step or a transition. After operation completion of preceding step, steps K2 to F10 connected in parallel are executed when the completion of condition set at transition...
  • Page 142 4 MOTION SFC PROGRAMS POINT The number of parallel branches need not match that of couplings at a parallel coupling point. (In the example of the diagram in Section 4.9.3 (2), the number of parallel branches is 3 and that of couplings is 2.) When a WAIT transition is set right after a parallel coupling, the stop completions of the axes are not included in the waiting conditions if the parallel coupling is preceded by motion control steps.
  • Page 143: Y/N Transitions

    4 MOTION SFC PROGRAMS 4.10 Y/N Transitions When routes are branch at a transition condition enables and disable, "Shift Y/N transition" or "WAIT Y/N transition" will be useful. Name Symbol Function (Not • When a transition condition set at Gn completion enables, execution shifts to the lower of condition)
  • Page 144 4 MOTION SFC PROGRAMS (1) Automatic free G number search feature (a) When not set to automatic numbering Searches for a free number forward, starting with the "set G number + 1" at the "Shift Y/N" or "WAIT Y/N" symbol. When no free numbers are found after a search up to 4095, a search is made from 0 to the "set G number - 1".
  • Page 145 4 MOTION SFC PROGRAMS (3) Instructions for the Motion SFC charts Any Motion SFC chart that will be meaningless to or conflict with the definition of Y/N transitions will result in an error at the time of editing (or Motion SFC chart conversion).
  • Page 146 4 MOTION SFC PROGRAMS (c) The following patterns may be set. • End (END) from "Shift Y/N" or "WAIT Y/N" • Jump from "Shift Y/N" or "WAIT Y/N" • Continuation from "Shift Y/N" or "WAIT Y/N" to "Shift Y/N" or "WAIT Y/N" (selective branch-selective branch) •...
  • Page 147: Motion Sfc Comments

    4 MOTION SFC PROGRAMS 4.11 Motion SFC Comments A comment can be set to each symbol of the step/transition in the motion SFC chart. Comments are shown in the Motion SFC chart by changing the display mode to "Comment display" on the Motion SFC program edit screen. Since the Motion SFC comments are stored into the CPU code area, performing read from PC displays the Motion SFC chart with comments.
  • Page 148 4 MOTION SFC PROGRAMS POINT (1) Motion SFC comments are stored into the CPU code area. The CPU code area stores the Motion SFC chart codes, operation control (F/FS) program codes, transition (G) program codes and Motion SFC comments. Be careful not to set too many comments to avoid code area overflow. (Refer to Section "1.2.2 (1) (b) Motion SFC Performance Specifications"...
  • Page 149 4 MOTION SFC PROGRAMS MEMO 4 - 28...
  • Page 150: Operation Control Programs

    Refer to Section "11.2 Motion SFC Error Code List" for error codes of the operation error. (Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)" and "Q173HCPU/Q172HCPU Motion controller (SV22) Programming Manual (VIRTUAL MODE)" for minor errors of the operation error.) 5.1 Operation Control Programs...
  • Page 151 5 OPERATION CONTROL PROGRAMS (2) Priorities of operators and functions Operators and functions have the following priorities. Using parentheses allows an operation sequence to be specified freely. Priority Item (Operator, Function) High Calculation within parentheses ((...)) Standard function (SIN, COS, etc.), Type conversion (USHORT, LONG, etc.) Bit inversion (~), logical negation (!), sign inversion ( ) Multiplication ( ), division (/), remainder (%)
  • Page 152 5 OPERATION CONTROL PROGRAMS (3) Structure of instruction Many of the instructions usable in operation control programs can be divided into instruction and data parts. The instruction and data parts are used for the following purposes. • Instruction part..Indicates the function of that instruction. •...
  • Page 153 5 OPERATION CONTROL PROGRAMS (4) How to specify data There are the following six different data usable in each instruction. Data usable in each instruction Numerical data Integer data 16-bit integer type data 32-bit integer type data 64-bit floating-point type data Bit data Batch bit data Logical data...
  • Page 154 5 OPERATION CONTROL PROGRAMS 3) Data ranges are shown below. Decimal representation Hexadecimal representation H0000000000000000, K-1.79E+308 to K-2.23E-308, H0010000000000000 to H7FE1CCF385EBC89F, Data range K0.0, H8000000000000000, K2.23E-308 to K1.79E+308 H8010000000000000 to HFFE1CCF385EBC89F 4) A round-off error may be produced in a 64-bit floating-point type data operation.
  • Page 155 5 OPERATION CONTROL PROGRAMS (f) Logical data The logical data is a value returned by a bit or comparison conditional expression and indicates whether the result is true or false. Normally, it is used in the conditional expression of a transition program. In an operation control program, the logical data is used in a bit conditional expression set to device set (SET=) or device reset (RST=).
  • Page 156: Device Descriptions

    5 OPERATION CONTROL PROGRAMS 5.2 Device Descriptions Word and bit device descriptions are shown below. (1) Word device descriptions Device descriptions 32-bit 64-bit Device No. (n) specifying ranges 16-bit integer type floating-point type integer type ("n" is even No.) ("n" is even No.) Data register 0 to 8191 Link register...
  • Page 157 5 OPERATION CONTROL PROGRAMS (3) Indirect specification of device No. In the above word/bit device descriptions, device No. (n) can be specified indirectly. (a) Indirect specification of device No. (n) using word device • The word device which the device No. was specified indirectly cannot be used.
  • Page 158: Constant Descriptions

    5 OPERATION CONTROL PROGRAMS 5.3 Constant Descriptions The constant descriptions of the 16-bit integer type, 32-bit integer type and 64-bit floating-point type are shown below. 16-Bit integer type 32-Bit integer type 64-Bit floating-point type K-1.79E+308 to K-2.23E-308, Decimal K-32768 to K32767 K-2147483648L to K2147483647L K0.0, representation...
  • Page 159: Binary Operations

    5 OPERATION CONTROL PROGRAMS F/FS 5.4 Binary Operations 5.4.1 Substitution : = Format (D)=(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating expression...
  • Page 160 5 OPERATION CONTROL PROGRAMS (2) Program which substitutes K123456.789 to D0L D0L = K123456.789 123456.789 123456 The 64-bit floating-point type is converted into the 32-bit integer type and the result is substituted. (3) Program which substitutes the result of adding K123 and #0 to W0 W0 = K123 + #0 5 - 11...
  • Page 161: Addition

    5 OPERATION CONTROL PROGRAMS F/FS 5.4.2 Addition : + Format (S1)+(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 162: Subtraction

    5 OPERATION CONTROL PROGRAMS F/FS 5.4.3 Subtraction : Format (S1) (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 163: Multiplication

    5 OPERATION CONTROL PROGRAMS F/FS 5.4.4 Multiplication : Format (S1) (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 164: Division

    5 OPERATION CONTROL PROGRAMS F/FS 5.4.5 Division : / Format (S1)/(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 165: Remainder

    5 OPERATION CONTROL PROGRAMS F/FS 5.4.6 Remainder : % Format (S1)%(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 166: Bit Operations

    5 OPERATION CONTROL PROGRAMS F/FS 5.5 Bit Operations 5.5.1 Bit inversion (Complement) : ˜ ˜ Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting...
  • Page 167: Bit Logical And

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.2 Bit logical AND : & Format (S1)&(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 168: Bit Logical Or

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.3 Bit logical OR : Format (S1) l (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 169: Bit Exclusive Logical Or

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.4 Bit exclusive logical OR : ^ Format (S1)^(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 170: Bit Right Shift

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.5 Bit right shift : >> Format (S1) >> (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 171: Bit Left Shift

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.6 Bit left shift : << Format (S1) << (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 172: Sign Inversion(Complement Of 2)

    5 OPERATION CONTROL PROGRAMS F/FS 5.5.7 Sign inversion (Complement of 2) : Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 173: Standard Functions

    5 OPERATION CONTROL PROGRAMS F/FS 5.6 Standard Functions 5.6.1 Sine : SIN Format SIN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating expression...
  • Page 174: Cosine : Cos

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.2 Cosine : COS Format COS(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 175: Tangent : Tan

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.3 Tangent : TAN Format TAN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 176: Arcsine : Asin

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.4 Arcsine : ASIN Format ASIN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 177: Arccosine : Acos

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.5 Arccosine : ACOS Format ACOS(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 178: Arctangent : Atan

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.6 Arctangent : ATAN Format ATAN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 179: Square Root : Sqrt

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.7 Square root : SQRT Format SQRT(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 180: Natural Logarithm : Ln

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.8 Natural logarithm : LN Format LN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 181: Exponential Operation : Exp

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.9 Exponential operation : EXP Format EXP(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 182: Absolute Value : Abs

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.10 Absolute value : ABS Format ABS(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 183: Round-Off : Rnd

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.11 Round-off : RND Format RND(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 184: Round-Down : Fix

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.12 Round-down : FIX Format FIX(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 185: Round-Up : Fup

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.13 Round-up : FUP Format FUP(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 186: Bcd

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.14 BCD BIN conversion : BIN Format BIN(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 187: Bin

    5 OPERATION CONTROL PROGRAMS F/FS 5.6.15 BIN BCD conversion : BCD Format BCD(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 188: Type Conversions

    5 OPERATION CONTROL PROGRAMS F/FS 5.7 Type Conversions 5.7.1 Signed 16-bit integer value conversion : SHORT Format SHORT(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating...
  • Page 189: Unsigned 16-Bit Integer Value Conversion : Ushort

    5 OPERATION CONTROL PROGRAMS F/FS 5.7.2 Unsigned 16-bit integer value conversion : USHORT Format USHORT(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 190: Signed 32-Bit Integer Value Conversion : Long

    5 OPERATION CONTROL PROGRAMS F/FS 5.7.3 Signed 32-bit integer value conversion : LONG Format LONG(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 191: Unsigned 32-Bit Integer Value Conversion : Ulong

    5 OPERATION CONTROL PROGRAMS F/FS 5.7.4 Unsigned 32-bit integer value conversion : ULONG Format ULONG(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 192: Signed 64-Bit Floating-Point Value Conversion : Float

    5 OPERATION CONTROL PROGRAMS F/FS 5.7.5 Signed 64-bit floating-point value conversion : FLOAT Format FLOAT(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 193: Unsigned 64-Bit Floating-Point Value Conversion : Ufloat

    5 OPERATION CONTROL PROGRAMS F/FS 5.7.6 Unsigned 64-bit floating-point value conversion : UFLOAT Format UFLOAT(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating...
  • Page 194: Bit Device Statuses

    5 OPERATION CONTROL PROGRAMS F/FS 5.8 Bit Device Statuses 5.8.1 ON (Normally open contact) : (None) Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating...
  • Page 195: Off (Normally Closed Contact)

    5 OPERATION CONTROL PROGRAMS F/FS 5.8.2 OFF (Normally closed contact) : ! Format !(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 196: Bit Device Controls

    5 OPERATION CONTROL PROGRAMS F/FS 5.9 Bit Device Controls 5.9.1 Device set : SET Format SET(D)=(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting...
  • Page 197 5 OPERATION CONTROL PROGRAMS [Program examples] (1) Program which sets M100 when either of M0 and X0 is 1 SET M100 = M0 + X0 (True) M100 (2) Program which sets M100 when #0 is equal to D0 SET M100 = #0 = = D0 (True) M100 (3) Program which sets Y0 unconditionally...
  • Page 198: Device Reset : Rst

    5 OPERATION CONTROL PROGRAMS F/FS 5.9.2 Device reset : RST Format RST(D)=(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 199 5 OPERATION CONTROL PROGRAMS [Program examples] (1) Program which resets M100 when either of M0 and X0 is 1 RST M100 = M0 + X0 (True) M100 (2) Program which resets M100 when #0 is equal to D0 RST M100 = #0 != D0 (True) M100 (3) Program which resets Y0 unconditionally...
  • Page 200: Device Output : Dout

    5 OPERATION CONTROL PROGRAMS F/FS 5.9.3 Device output : DOUT Format DOUT(D), (S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 201: Device Input : Din

    5 OPERATION CONTROL PROGRAMS F/FS 5.9.4 Device input : DIN Format DIN(D), (S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 202: Bit Device Output : Out

    5 OPERATION CONTROL PROGRAMS F/FS 5.9.5 Bit device output : OUT Format OUT(D)=(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 203: Logical Operations

    5 OPERATION CONTROL PROGRAMS F/FS 5.10 Logical Operations 5.10.1 Logical acknowledgement : (None) Format Number of basic steps — [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating...
  • Page 204: Logical Negation

    5 OPERATION CONTROL PROGRAMS F/FS 5.10.2 Logical negation : ! Format ! (S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 205: Logical And

    5 OPERATION CONTROL PROGRAMS F/FS 5.10.3 Logical AND : Format (S1) (S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 206: Logical Or

    5 OPERATION CONTROL PROGRAMS F/FS 5.10.4 Logical OR : + Format (S1)+(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 207: Comparison Operations

    5 OPERATION CONTROL PROGRAMS F/FS 5.11 Comparison Operations 5.11.1 Equal to : == Format (S1)==(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating...
  • Page 208: Not Equal To

    5 OPERATION CONTROL PROGRAMS F/FS 5.11.2 Not equal to : != Format (S1)!=(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer...
  • Page 209: Less Than

    5 OPERATION CONTROL PROGRAMS F/FS 5.11.3 Less than : < Format (S1)<(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 210: Less Than Or Equal To

    5 OPERATION CONTROL PROGRAMS F/FS 5.11.4 Less than or equal to: <= Format (S1)<=(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 211: More Than

    5 OPERATION CONTROL PROGRAMS F/FS 5.11.5 More than : > Format (S1)>(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 212: More Than Or Equal To

    5 OPERATION CONTROL PROGRAMS F/FS 5.11.6 More than or equal to: >= Format (S1)>=(S2) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 213: Motion-Dedicated Functions(Chgv, Chgt)

    (c) The speed changing flag is turned OFF. (2) The axis No. that may be set at (S1) is within the following range. Q172HCPU Q173HCPU 1 to 8 1 to 32 For interpolation control, set any one of the interpolation axes. When linear interpolation control is exercised, a speed change varies as described below with the positioning speed designation method set in the servo program.
  • Page 214 5 OPERATION CONTROL PROGRAMS (3) Operation varies with the sign of the specified speed set at (S2). Sign of specified speed Operation Positive Speed change Temporary stop Negative Return (4) The specified speed that may be set at (S2) is within the following range. (a) Real mode inch degree...
  • Page 215 5 OPERATION CONTROL PROGRAMS (7) By specifying a negative speed and making a speed change request during the start, allows the axis to start deceleration at that point and return in the opposite direction upon completion of deceleration. The following operations by the servo instruction are shown below. Control mode Servo instruction Operation...
  • Page 216 5 OPERATION CONTROL PROGRAMS 2) Make a speed change to a positive speed for a restart. 3) Turn on the stop command to end the positioning. 4) A negative speed change made again will be ignored. (d) While the axis is reversion in the speed control mode 1) Make a speed change to a positive speed to change the travel direction again.
  • Page 217 5 OPERATION CONTROL PROGRAMS [Program examples] (1) Program which changes the positioning speed of axis 2 CHGV(K2,K10) (2) Return program which changes the positioning speed of axis 1 to a negative value CHGV(K1,K 1000) The following operation will be performed when a return request is made in constant-speed control.
  • Page 218 5 OPERATION CONTROL PROGRAMS POINT (1) A speed change may be invalid if it is made from when a servo program start request is made until the "positioning start completion signal" status changes to ON. When making a speed change at almost the same timing as a start, always create a program which will execute the speed change after the "positioning start completion signal"...
  • Page 219: Torque Limit Value Change Request : Chgt

    ON or servo OFF. (3) The axis No. that may be set at (S1) is within the following range. Q172HCPU Q173HCPU 1 to 8 1 to 32 (4) The torque limit value that may be set at (S2) is within the range 1 to 1000[%].
  • Page 220 5 OPERATION CONTROL PROGRAMS During start (a) If the following torque limit value has been set, it will not be changed to higher than the torque limit value specified in the CHGT instruction. • Torque limit value at a midway point in constant-speed control or speed switching control •...
  • Page 221: Other Instructions

    5 OPERATION CONTROL PROGRAMS F/FS 5.13 Other Instructions 5.13.1 Event task enable : EI Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating...
  • Page 222: Event Task Disable : Di

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.2 Event task disable : DI Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 223: No Operation : Nop

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.3 No operation : NOP Format Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer integer...
  • Page 224: Block Transfer : Bmov

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.4 Block transfer : BMOV Format BMOV(D), (S), (n) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression...
  • Page 225 5 OPERATION CONTROL PROGRAMS (4) The word devices that may be set at (D), (S) and (n) are shown below. Cam No. (Note-2) (Note-2), (Note-3) Word devices Bit devices specification Setting data (Note-1) (Note-5) (Note-4) (Note-4) (Note-4) (Note-4) — — —...
  • Page 226 5 OPERATION CONTROL PROGRAMS [Program examples] (1) Program which batch-transfers a contents for 5 words from D0 to all data for 5 words from #10 BMOV #10,D0,K5 Batch transfer (2) Program which batch-transfers a contents for 2048 words from #0 to the data area of cam No.2 (resolution 2048) BMOV N2,#0,K2048 Cam data of cam No.2...
  • Page 227: Same Data Block Transfer : Fmov

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.5 Same data block transfer : FMOV Format FMOV(D), (S), (n) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating...
  • Page 228 5 OPERATION CONTROL PROGRAMS (2) When conversion is made in program editing of the SW6RN-GSV P, an error will occur if: • (D) to (D)+(n-1) is outside the device range • (S) is outside the device range When (n) specified is a •...
  • Page 229 5 OPERATION CONTROL PROGRAMS F/FS 5.13.6 Write device data to shared CPU memory of the self CPU: MULTW Format MULTW(D), (S), (n), (D1) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit...
  • Page 230 5 OPERATION CONTROL PROGRAMS (3) Another MULTW instruction cannot be processed until MULTW instruction is executed and a complete bit device is turned on. When MULTW instruction was executed again before MULTW instruction is executed and complete bit device is turned on, the MULTW instruction executed later becomes an error.
  • Page 231 5 OPERATION CONTROL PROGRAMS [Program examples] (1) 2 words from D0 is written in the shared CPU memory to since A00H, and transits to next step after confirmation of writing completion. RST M0 MULTW HA00, D0, K2, M0 Shared CPU memory Device memory A00H 2 words transfer...
  • Page 232: Read Device Data From Shared Cpu Memory Of The Other Cpu: Multr

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.7 Read device data from shared CPU memory of the other CPU: MULTR Format MULTR(D), (S1), (S2), (n) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit...
  • Page 233 5 OPERATION CONTROL PROGRAMS (2) The word devices that may be set at (D), (S), (n) and (D1) are shown below. (Note-1) (Note-1), (Note-2) Word devices Bit devices Setting data (Note-3) (Note-4) (Note-4) — — — — — — — —...
  • Page 234 5 OPERATION CONTROL PROGRAMS [Program examples] (1) It checks that a CPU No.1 is not resetting, 2 words is read to since #0 from the shared CPU memory C00H of CPU No.1, and transits to next step after reading completion. !M9240 RST M9216 MULTR #0, H3E0, HC00, K2...
  • Page 235: Write Device Data To Intelligent Function Module/Special Function Module : To

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.8 Write device data to intelligent function module/special function module : TO Format TO(D1), (D2), (S), (n) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data...
  • Page 236 5 OPERATION CONTROL PROGRAMS (3) The word devices that may be set at (D1), (D2), (S) and (n) are shown below. (Note-1) (Note-1), (Note-2) Word devices Bit devices Setting data (D1) — — — — — (D2) — — — —...
  • Page 237 5 OPERATION CONTROL PROGRAMS [Program examples] (1) 2 words from #0 is written to since buffer memory address of the Intelligent function module/special function module (First I/O No. : 010H). TO H010, H0, #0, K2 Intelligent function module/ special function module (First I/O No.
  • Page 238: Read Device Data From Intelligent Function Module/Special Function Module : From

    5 OPERATION CONTROL PROGRAMS F/FS 5.13.9 Read device data from intelligent function module/special function module : FROM Format FROM(D), (S1), (S2), (n) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data...
  • Page 239 5 OPERATION CONTROL PROGRAMS (3) The word devices that may be set at (D), (S1), (S2) and (n) are shown below. (Note-1) (Note-1), (Note-2) Word devices Bit devices Setting data (Note-3) (Note-4) (Note-4) (S1) — — — — — (S2) —...
  • Page 240 5 OPERATION CONTROL PROGRAMS [Program examples] (1) 1 word is read from the buffer memory address 10H of the intelligent function module/special function module (First I/O No. : 020H), and is stored in W0. FROM W0, H020, H10, K1 Intelligent function module/special function module (First I/O No.
  • Page 241: Time To Wait : Time

    5 OPERATION CONTROL PROGRAMS F/FS — 5.13.10 Time to wait : TIME Format TIME(S) Number of basic steps [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional floating Coasting floating expression...
  • Page 242 5 OPERATION CONTROL PROGRAMS POINT (1) When the waiting time setting is indirectly specified with a word device, the value imported first is used as the device value for exercising control. The set time cannot be changed if the device value is changed during a wait state. (2) The TIME instruction is equivalent to a conditional expression, and therefore may be set on only the last line of a transition (G) program.
  • Page 243: Comment Statement

    5 OPERATION CONTROL PROGRAMS F/FS 5.14 Comment Statement : // Format Number of basic steps — [Usable data] Usable Data Word device Constant Setting Comparison 64-bit 64-bit Calculation 16-bit 32-bit 16-bit 32-bit data Bit device conditional conditional Coasting floating floating expression integer integer...
  • Page 244: Transition Programs

    6 TRANSITION PROGRAMS 6. TRANSITION PROGRAMS 6.1 Transition Programs (1) Transition programs (a) Substitution operation expressions, motion-dedicated functions, bit device control commands and transition conditions can be set in transition programs. (b) Multiple blocks can be set in one transition program. (c) There are no restrictions on the number of blocks that may be set in a single transition program.
  • Page 245 6 TRANSITION PROGRAMS What can be set as a transition condition in the last block are bit conditional expressions, comparison conditional expressions and device set (SET=)/device reset (RST=) which return logical data values (true/false). In the case of device set (SET=)/device reset (RST=), whether the bit or comparison conditional expression specified at (S) is true or false is a transition condition, and when the transition condition enables, device set/reset is executed and execution shifts to the next step.
  • Page 246: Motion Control Programs

    Table 7.1 lists servo instructions used in servo programs. Refer to Section 7.2 to 7.4 for details of the current value change control (CHGA, CHGA-E, CHGA-C). Refer to the "Q173HCPU/Q172HCPU Motion Controller (SV13/SV22) Programming Manual (REAL MODE)" for other servo instructions. (1) Guide to servo instruction list Table 7.1 Guide to Servo Instruction List...
  • Page 247: Servo Instruction List

    7 MOTION CONTROL PROGRAMS (2) Servo instruction list Table 7.2 indicates the servo instructions available for servo programs and the positioning data set in servo instructions. Table 7.2 Servo Instruction List Positioning data Common Circular Instruction Processing symbol — Virtual enable Number of steps Number of indirect words —...
  • Page 248 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 4 to 17 5 to 20 7 to 21 8 to 22 7 to 22 6 to 21 : Must be set.
  • Page 249 7 MOTION CONTROL PROGRAMS Table 7.2 Servo Instruction List (continued) Positioning data Common Circular Instruction Processing symbol — Virtual enable Number of steps Number of indirect words — Absolute central point-specified circular interpolation CW Absolute central point-specified circular interpolation CCW Incremental central point-specified circular interpolation CW Incremental central point-specified circular...
  • Page 250 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 7 to 22 10 to 27 9 to 26 10 to 27 : Must be set. : Set if required.
  • Page 251 7 MOTION CONTROL PROGRAMS Table 7.2 Servo Instruction List (continued) Positioning data Common Circular Instruction Processing symbol Virtual enable — Number of steps Number of indirect words — FEED-1 1-axis fixed-pitch feed start 2-axes linear interpolation FEED-2 fixed-pitch feed start 3-axes linear interpolation FEED-3 fixed-pitch feed start...
  • Page 252 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 4 to 17 5 to 19 7 to 21 3 to 15 3 to 16 4 to 18 2 to 4 1 to 13...
  • Page 253 7 MOTION CONTROL PROGRAMS Table 7.2 Servo Instruction List (continued) Positioning data Common Circular Instruction Processing symbol — Virtual enable Number of steps — Number of indirect words Speed control with fixed position stop absolute specification PFSTART Position follow-up control start CPSTART1 1-axis constant-speed control start CPSTART2...
  • Page 254 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 6 to 19 4 to 16 3 to 15 3 to 17 4 to17 2 to 10 3 to 11 4 to 12...
  • Page 255 7 MOTION CONTROL PROGRAMS Table 7.2 Servo Instruction List (continued) Positioning data Common Circular Instruction Processing symbol — Virtual enable Number of steps — Number of indirect words INC-1 INC-2 INC-3 INC-4 Constant-speed control passing point incremental specification Constant-speed control passing point helical incremental specification CPEND Constant-speed control end...
  • Page 256 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 2 to 10 3 to 11 4 to 12 5 to 13 5 to 14 4 to 13 5 to 14 9 to 14...
  • Page 257 7 MOTION CONTROL PROGRAMS Table 7.2 Servo Instruction List (continued) Positioning data Common Circular Instruction Processing symbol — Virtual enable Number of steps — Number of indirect words FOR-TIMES FOR-ON Repeat range start setting FOR-OFF NEXT Repeat range end setting START Simultaneous start ZERO...
  • Page 258 7 MOTION CONTROL PROGRAMS Positioning data Parameter block Others Number of steps — — — — — — — — — 1(B) 1(B) 1(B) 1(B) 1(B) 2 to 3 5 to 10 : Must be set. : Set if required. *1 : Only reference axis speed specification.
  • Page 259: Servomotor/Virtual Servomotor Shaft Current Value Change

    (3) The current value of the specified virtual servo-motor shaft is changed in the virtual mode. (4) The used axis No. can be set within the following range. Q172HCPU Q173HCPU Axis 1 to 8 Axis 1 to 32 (5) The address which made the current value change by CHGA instruction is valid on the power supply turning on.
  • Page 260 7 MOTION CONTROL PROGRAMS [Program example] A program which made the current value change control in the real mode is described as the following conditions. (1) System configuration The current value change control of axis 2 is executed. Q172 QX10 Q02H Q173H Axis 1...
  • Page 261 [908] (virtual real changing) occurs and the current value change is not made. (Note) : Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)"/ "Q173HCPU/Q172HCPU Motion controller (SV22) Programming Manual (VIRTUAL MODE)" for minor error, major error and servo program setting error.
  • Page 262: Synchronous Encoder Shaft Current Value Change Control (Sv22 Only)

    (2) The used axis No. can be set within the following range. Q172HCPU Q173HCPU Axis 1 to 8 Axis 1 to 12 (3) The address which made the current value change by CHGA-E instruction is valid after also the power supply turned off.
  • Page 263 7 MOTION CONTROL PROGRAMS [Program example] A program which made the current value change control of the synchronous encoder shaft is described as the following conditions. (1) System configuration The current value change control of the synchronous encoder shaft P1 is executed.
  • Page 264 [908] (virtual real changing) occurs and the current value change is not made. (Note) : Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)"/"Q173HCPU/Q172HCPU Motion controller (SV22) Programming Manual (VIRTUAL MODE)" for minor error, major error and servo program setting error.
  • Page 265: Cam Shaft Within-One-Revolution Current Value Change Control (Sv22 Only)

    (2) The cam shaft may be starting. (3) The used axis No. can be set within the following range. Q172HCPU Q173HCPU Axis 1 to 8 Axis 1 to 32 (4) The address which made the current value change by the CHGA-C instruction is valid after also the power supply turned off.
  • Page 266 [908] (virtual real changing) occurs and the current value change is not made. (Note) : Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)"/"Q173HCPU/Q172HCPU Motion controller (SV22) Programming Manual (VIRTUAL MODE)" for minor error, major error and servo program setting error.
  • Page 267: Programming Instructions

    7 MOTION CONTROL PROGRAMS 7.5 Programming Instructions 7.5.1 Cancel • start When a cancel start has been set in the setting items of the servo program which was started at the motion control step of the Motion SFC program, the cancel of the running servo program is valid but the servo program specified to start after a cancel is ignored, without being started.
  • Page 268: Motion Devices

    8 MOTION DEVICES 8. MOTION DEVICES The motion registers (#0 to #8191) and coasting timer (FT) are available as Motion CPU-dedicated devices. They can be used in operation control (F/FS) programs or transition (G) programs. 8.1 Motion Registers (#0 to #8191) Motion device Item Specifications...
  • Page 269 8 MOTION DEVICES (a) Motion SFC dedicated devices (#8000 to #8063) The Motion SFC dedicated devices are shown below. The device's refresh cycle is indicated when the signal direction is "status", or its fetch cycle when the signal direction is "command". Signal direction Refresh Fetch...
  • Page 270 8 MOTION DEVICES 1) Motion SFC error history devices The error information occurred is stored as a history of up to eight past errors. The latest error is stored in #8056 to #8063. All errors, including the Motion SFC control errors and the conventional minor, major, servo, servo program and mode changing errors are stored in this history.
  • Page 271 8 MOTION DEVICES 2) Motion SFC error detection flag (M2039) (Refresh cycle : Scan time) The Motion SFC error detection flag (M2039) turns on when any of the errors detected by the Motion CPU occurs. At error occurrence, data are set to the error devices in the following procedure.
  • Page 272 8 MOTION DEVICES (b) Servo monitor devices (#8064 to #8191) Information about "servo amplifier type", "motor current" and "motor speed" for each axis is stored the servo monitor devices. The details of the storage data are shown below. Axis Device No. Signal name #8064 to #8067 #8068 to #8071...
  • Page 273: Coasting Timer (Ft)

    8 MOTION DEVICES 8.2 Coasting Timer (FT) Motion device Item Specification Number of points 1 point (FT) Data size 32-bit/point (-2147483648 to 2147483647) No latch. Cleared to zero at power-on or reset, a count Latch rise is continued from now on. Coasting timer (FT) Usable tasks Normal, event, NMI...
  • Page 274: Motion Sfc Parameter

    9 MOTION SFC PARAMETER 9. MOTION SFC PARAMETER Two different Motion SFC parameters are available: "task parameters" designed to control the tasks (normal task, event task, NMI task) and "program parameters" to be set per Motion SFC program. Their details are shown below. 9.1 Task Definitions When to execute the Motion SFC program processing can be set only once in the program parameter per program.
  • Page 275: Number Of Consecutive Transitions And Task Operation

    9 MOTION SFC PARAMETER 9.2 Number of Consecutive Transitions and Task Operation 9.2.1 Number of consecutive transitions With "execution of active step judgment of next transition condition transition processing performed when condition enables (transition of active step)" defined as a single basic operation of the Motion SFC program execution control in the execution cycle of the corresponding task, this operation is performed for the number of active steps to terminate processing once.
  • Page 276: Task Operation

    9 MOTION SFC PARAMETER 9.2.2 Task operation (1) Normal task operation [Operations] The Motion SFC program is executed in the main cycle (free time) of the Motion CPU processing. Program 1 Program 2 Program name Program name SFCS1 SFCS2 PLC program Main cycle Main cycle Normal task...
  • Page 277 9 MOTION SFC PARAMETER (2) Event task operation [Operations] An event task executes the Motion SFC program at occurrence of an event. There are the following events. (a) Fixed cycle The Motion SFC program is executed periodically in any of 0.88ms, 1.77ms, 3.55ms, 7.11ms and 14.2ms cycles.
  • Page 278 9 MOTION SFC PARAMETER <Example 2> Program name SFCS PLC program EI/DI status by other programs. Event processing by external interrupt/ Starting of the GINT event task is accepted. Event occurrence during DI status Event task is not executed is memorized and executed. during DI status.
  • Page 279 9 MOTION SFC PARAMETER (3) NMI task operation [Operations] The Motion SFC program is executed when the input set to the NMI task factor among external interrupts (16 points of QI60) turns on. Program name SFCS PLC program External interrupts NMI task END operation: End END operation: Continue...
  • Page 280: Execution Status Of The Multiple Task

    9 MOTION SFC PARAMETER 9.3 Execution Status of The Multiple Task Execution status of each Motion SFC program when the Motion SFC program is executed multiple tasks is shown below. 3.55ms NMI interrupt NMI interrupt NMI task-execute program 3.55ms event task-execute program Normal task-execute program When there are programs which are executed by the NMI task, 3.55ms fixed-cycle even task with a program to run by the NMI task, and the normal task like a chart,...
  • Page 281: Task Parameters

    9 MOTION SFC PARAMETER 9.4 Task Parameters Item Setting item Initial value Remark Number of Normal task These parameters are imported consecutive 1 to 30 (Normal task when PLC ready flag (M2000) transitions common) turns off to on and used for control Set whether the event thereafter.
  • Page 282 9 MOTION SFC PARAMETER (2) Interrupt setting [Description] Set whether 16 interrupt input points (I0 to I15) of the QI60 interrupt module loaded in the motion slot are used as NMI or event task inputs. Setting can be made freely per point. All points default to event tasks.
  • Page 283: Program Parameters

    9 MOTION SFC PARAMETER 9.5 Program Parameters Set the following parameters for every Motion SFC program. Item Setting range Initial value Remark Start setting Automatically started or not Not setting It is only one of normal, event and NMI tasks Normal task When you have set the event task, further set the event which will be enabled.
  • Page 284 9 MOTION SFC PARAMETER (1) Start setting [Description] The following control is changed by "automatically started or not" setting. • Program run by normal task Item When "automatically started" When "not automatically started" In the main cycle after the PLC ready flag (M2000) The program is started by the Motion SFC start instruction turns off to on, the program is executed from the ( S(P).SFCS ) from the PLC or by a subroutine call/start...
  • Page 285 9 MOTION SFC PARAMETER • Program run by NMI task Item When "automatically started" When "not automatically started" At occurrence of a valid event after starting of the The program is started by the Motion SFC start instruction PLC ready flag (M2000), the program is executed ( S(P).SFCS ) from the PLC or by a subroutine call/start from the initial (first) step in accordance with the (GSUB) made from within the Motion SFC program.
  • Page 286 9 MOTION SFC PARAMETER (2) Execute task [Description] Set the timing (task) to execute a program. Specify whether the program will be run by only one of the "normal task (main cycle), event task (fixed cycle, external interrupt, PLC interrupt) and NMI task (external interrupt)".
  • Page 287 9 MOTION SFC PARAMETER POINT Since the execute task can be set for every Motion SFC program No., multiple programs need not be written for single control (machine operation) to divide execution timing-based processing’s. For example, it can be achieved easily by subroutine starting the areas to be run in fixed cycle and to be run by external interrupt partially in the Motion SFC program run by the normal task.
  • Page 288 9 MOTION SFC PARAMETER (4) END operation [Description] Set the operation at execution of the END step toward the program executed by the event or NMI task. This varies the specifications for the following items. • Program run by NMI task Item When "ended"...
  • Page 289: How To Start The Motion Sfc Program

    9 MOTION SFC PARAMETER 9.6 How to Start The Motion SFC Program The Motion SFC program is executed during PLC ready flag (M2000) is on. The Motion SFC program may be started by any of the following three methods. (1) Automatic start (2) Start from the Motion SFC program (3) Start from the PLC Set the starting method in the program parameter for every Motion SFC program.
  • Page 290: How To Change From One Motion Sfc Program To Another

    When a RUN/STOP switch is operated, PLC ready flag (M2000) turns on/off in accordance with "Operation at STOP to RUN" of a setting of a basic systems. Refer to Section "3.1.3 Individual parameters" of the "Q173HCPU/Q172HCPU Motion controller Programming Manual (COMMON)" for the details of "Operation at STOP to RUN".
  • Page 291: Operation Performed When Plc Ready Flag (M2000) Turns Off/On

    The on/off condition of PLC ready flag (M2000) differences in "Operation at STOP to RUN" of a setting of a basic systems. Refer to Section "3.1.3 Individual parameters" of the "Q173HCPU/Q172HCPU Motion controller Programming Manual (COMMON)" for details. [M2000 OFF If there is no fault when PLC ready flag (M2000) turns off to on, the PCPU ready flag (M9074) turns on.
  • Page 292: User Files

    10 USER FILES 10. USER FILES A user file list and directory structure are shown below 10.1 Projects User files are managed on a "project" basis. When you set a "project name", a "project name" folder is created as indicated on the next page, and under that, sub folders (Sfc, Glist, Gcode, Flist, Fcode) classified by file types are created.
  • Page 293: User File List

    10 USER FILES 10.2 User File List A user file list is shown below. : Indicates the file(data) stored in CPU memory. Project name folder Folder of user-set "project name" Sub folders (fixed) Project name.prj Project file ( 1pc.) Information file of correspondence between Motion SFC program No. (0 to 255) and SFC program names (SFC files) Motion SFC chart file SFC program name.sfc ( 256 pcs.)
  • Page 294: Online Change In The Motion Sfc Program

    10 USER FILES 10.3 Online Change in The Motion SFC Program The online change is used to write to the Motion SFC program to the internal SRAM during the positioning control (M.RUN LED: ON). Program correction and a check of operation can be executed repeatedly at the Multiple CPU system start.
  • Page 295: Operating Method For The Online Change

    10 USER FILES 10.3.1 Operating method for The Online Change Select the "Online change OFF/ON" of Motion SFC program with the "program editor screen [Convert] menu – [Online change setting]" of SW6RN- GSV P. There are following three methods for the online change of Motion SFC program. •...
  • Page 296 10 USER FILES (2) When the operation control/transition program editor screen [Convert] is used. Online change of the operation control/transition program during edit is executed by selecting the [Convert] key. Online change is possible to the operation control/transition program during execution.
  • Page 297 10 USER FILES (3) When the servo program editor screen [Store] is used. Online change of the servo program during edit is executed by selecting the [Store] key. Online change is possible to the servo program during execution. A program that the online change was made is executed at the next servo program start.
  • Page 298: Transfer Of Program

    10 USER FILES 10.3.2 Transfer of program The outline operations to transfer the program from SW6RN- GSV P to the program memory of Motion CPU are described. (1) Program writing by the [Communication] menu - [Transfer] (a) After transfer, programs are stored in the program memory of Motion CPU stuffing to the front for every kind.
  • Page 299 10 USER FILES (b) If the online change is executed repeatedly, the free space in program memory is lost and the online change may not be executed. In this case, an error message is displayed by SW6RN-GSV P at the online change, and "Online change OFF"...
  • Page 300: Error Code Lists

    The procedure for reading error codes by the SW6RN-GSV P is shown below. (1) Start the SW6RN-GSV P. (2) Connect the Q173HCPU/Q172HCPU to the peripheral devices. (3) Select [New project] create the project- [Read from Motion CPU] Menu by the SW6RN-GSV P, and also read the project from the Motion CPU.
  • Page 301: Motion Sfc Error Code List

    "error history devices (#8000 to #8063)" of the motion registers. (Check by SW6RN- GSV P.) The "error codes" for the Motion SFC program are shown below. Refer to the "Q173HCPU/Q172HCPU Motion controller (SV13/SV22) Programming Manual (REAL MODE)"/ "Q173HCPU/Q172HCPU Motion controller (SV22) Programming Manual (VIRTUAL MODE)" for minor errors, major errors, servo errors and servo program setting errors.
  • Page 302 11 ERROR CODE LISTS Table 11.2 Motion SFC program start errors (16000 to 16099) Error factor Error code Error Processing Corrective Action Name Description • At a start by S(P).SFCS instruction, PLC Provide ON of the PLC ready flag (M2000) PLC ready OFF 16000 ready flag (M2000) or PCPU ready flag...
  • Page 303 11 ERROR CODE LISTS Table 11.3 Motion SFC interpreter detection errors (16100 to 16199) (continued) Error factor Error code Error Processing Corrective Action Name Description • The self program was called/started by 16110 GSUB setting error 1 GSUB cannot call its own or main program. GSUB.
  • Page 304 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) Error factor Error code Error Processing Corrective Action Name Description Event task enable • Event task enable was executed at except for Event task enable may be executed in the 16301 (EI) execution error the normal task.
  • Page 305 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) (continued) Error factor Error code Error Processing Corrective Action Name Description Bit device output • The device No. which indirectly specifies (D) is Correct the program so that the device No. 16338 (OUT=) execution illegal.
  • Page 306 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) (continued) Error factor Error code Error Processing Corrective Action Name Description • Correct the program so that the number of words (n) to be written is within the range of •...
  • Page 307 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) (continued) Error factor Error code Error Processing Corrective Action Name Description • Number of words (n) to be written is outside the • Correct the program so that the number of range of 1 to 256.
  • Page 308 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) (continued) Error factor Error code Error Processing Corrective Action Name Description Indirectly specified • The indirectly specified device No. is outside 16-bit motion device 16462 the range. (#(n)) read error Indirectly specified 16463...
  • Page 309 11 ERROR CODE LISTS Table 11.5 Operation control/transition execution errors (16300 to 16599) (continued) Error factor Error code Error Processing Corrective Action Name Description Indirectly specified 16-bit batch input 16516 relay (X(n)) read error Indirectly specified 32-bit batch input 16517 relay (X(n)) read error •...
  • Page 310: Motion Sfc Parameter Errors

    11 ERROR CODE LISTS 11.3 Motion SFC Parameter Errors Motion SFC parameters are checked by SW6RN-GSV P. Table 11.6 PLC ready flag (M2000) OFF ON errors (17000 to 17009) Error factor Error code Error Processing Corrective Action Name Description Normal task •...
  • Page 311 11 ERROR CODE LISTS MEMO 11 - 12...
  • Page 312: Appendices

    APPENDICES APPENDICES APPENDIX 1 Processing Times APPENDIX 1.1 Processing time of operation control/Transition instruction (1) Operation instructions APP. Processing time of operation instructions Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] #0=#1 5.85 D800=D801 6.15 #0L=#2L 6.70 Substitution D800L=D802L 8.50...
  • Page 313 APPENDICES Processing time of operation instructions (Continued) Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] #0=#1&#2 7.70 D800=D801&D802 10.00 & Bit logical AND #0L=#2L&#4L 9.70 D800L=D802L&D804L 12.95 #0=#1|#2 7.75 D800=D801|D802 9.05 Bit logical OR #0L=#2L|#4L 10.20 D800L=D802L|D804L 11.10 #0=#1^#2 7.70...
  • Page 314 APPENDICES Processing time of operation instructions (Continued) Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] #0F=FIX(#4F) 11.30 Round-down D800F=FIX(D804F) 13.20 #0F=FUP(#4F) 11.70 Round-up D800F=FUP(D804F) 13.05 #0=BIN(#1) 8.40 Standard D800=BIN(D801) 9.00 BCD→BIN conversion function #0L=BIN(#2L) 10.60 D800L=BIN(D802L) 10.60 #0=BCD(#1) 12.80...
  • Page 315 APPENDICES Processing time of operation instructions (Continued) Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] DOUT M0,#0 8.60 DOUT M0,#0L 10.50 DOUT Y100,#0 9.90 DOUT Device output DOUT Y100,#0L 11.75 DOUT PY0,#0 14.65 DOUT PY0,#0L 20.20 DIN #0,M0 8.10...
  • Page 316 APPENDICES Processing time of operation instructions (Continued) Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] SET M1000 = #0>#1 14.25 SET M1000 = D800>D801 22.50 SET M1000 = #0L>#2L 21.25 > More than SET M1000 = D800L>D802L 16.70 SET M1000 = #0F>#4F...
  • Page 317 APPENDICES Processing time of operation instructions (Continued) Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] MULTR #0,H3E0,H800,K1 34.10 MULTR D800,H3E0,H800,K1 34.35 MULTR H800,#0,K10,M0 40.15 Read device data from shared MULTR #0,H3E0,H800,K10 41.35 MULTR CPU memory of the other CPU MULTR D800,H3E0,H800,K10 126.15...
  • Page 318 APPENDICES (2) Transition conditional expressions Processing time of transition condition expressions Q173HCPU/Q172HCPU Classifications Symbol Instruction Operation expression Unit [ µ s] 6.00 ON (Normally open contact) (None) X100 5.40 (When condition enables) Bit device 10.40 control 6.00 OFF (Normally closed contact) !X100 6.65...
  • Page 319 APPENDICES (3) Processing time by the combination F and G (program described in F/G is NOP) F alone G alone GSUB JMP/coupling Note) Note) Q173HCPU/ 28.85 26.10 31.45 81.65 36.15 16.70 Q172HCPU [ s] Parallel branch (2 Pcs.) Parallel branch (5 Pcs.)
  • Page 320: Appendix 2 Sample Program

    APPENDICES APPENDIX 2 Sample Program APPENDIX 2.1 Program example to execute the Multiple CPU dedicated instruction continuously This is the program example which publishes the instruction continuously toward the same Motion CPU in the Multiple dedicated instruction toward the Motion CPU. When an instruction cannot be accepted even if it is executed, it becomes "No operation".
  • Page 321 APPENDICES There is the following restriction in the case as an example. 1) The Multiple CPU instruction of Motion CPU cannot be used Interrupt program/fixed cycle executive type program and low speed executive type program. When it is used, an instruction may not operate by the timing. APP - 10...
  • Page 322: Appendix 2.2 The Program Example To Execute Plural Multiple Cpu Instruction By The Instructions Of One Time

    APPENDICES APPENDIX 2.2 The program example to execute plural Multiple CPU instruction by the instructions of one time This is the program example which executes to the Multiple same Motion CPU at high speed by one instruction. In this case, you must take an interlock with "To self CPU high speed interrupt accept flag from CPU".
  • Page 323 APPENDICES <Example 2> SM400 D251 D451 SM400 D1000 DECP D1000 > D1000 DECP D1000 > D1000 > DECP D1000 D1000 > To self CPU high speed interrupt accept flag from CPU 1 U3E1 G48.0 SP.DDRD H3E1 D100 D1000 INCP To self CPU high speed interrupt accept flag from CPU 1 U3E1 G48.0 H3E1...
  • Page 324: Appendix 2.3 Motion Control Example By Motion Sfc Program

    APPENDICES APPENDIX 2.3 Motion control example by Motion SFC program (1) The Motion SFC program composition example to execute motion control. This sample program example is described to every following function. Function list of sample program Item Description Monitor of the positioning The positioning dedicated device status of the Motion CPU (CPU No.2) dedicated device is reflected on "M2400 to"...
  • Page 325 Contents of processing connective operation transitions • This program starts automatically at the time of run of Q173HCPU, and it is always executed. • The positioning dedicated device (bit device) for monitor is transferred to "W0 to". Positioning Normal Start •...
  • Page 326 APPENDICES Motion SFC program list (Continued) Number of Automatic Program name Task Contents of processing connective operation transitions • "K140 : The home position return of 1 axis" is started when PX3 is on,"K141 : The home position return of 2 axes" is started Home position Normal Not start when PX4 is on.
  • Page 327 //D640 to CPU No.1 of the Qn(H)CPU W380=D9000 Automatic refresh of the between Multiple CPU, and "W100 to" W381=D9005 of Q173HCPU (CPU No.2) sets it up to have refresh by "D0 to" W382=D9008 of Qn(H)CPU (CPU No.1), therefore the condition of W384L=D9010L Q173HCPU (CPU No.2) can be grasped with Qn(H) CPU of the...
  • Page 328 APPENDICES (b) No.20 : Main Main [F20] SET M9028 //Clock data read request ON [G20] When a forced stop is released, a M9076 //Did you during the forced subroutine starts "No.110 : Motion //stop? control". (Because the next step is a shift, it becomes a subroutine start, and Motion control the next step is executed at the same...
  • Page 329 APPENDICES (d) No.120 : JOG [F120] //1 axis JOG operation speed = //100000PLS/s D640L=K100000 //2 axes JOG operation speed = //100000PLS/s D642L=K100000 When each signal of PX3 to PX6 is turned on/off, which the [G120] correspondences JOG command device is SET/RST. //1 axis forward rotation JOG start It makes forward rotation JOG start of the same axis and a //SET/RST...
  • Page 330 APPENDICES (f) No.140 : Home position return Home position return request [G140] [G141] [G142] //(PX3*!1 axis home position return //(PX4*!2 axes home position return //Did you finish home position return //completion *1 axis in-position signal*!1 //completion *2 axes in-position signal*!2 //request mode? //axis start accept)? //axis start accept)?
  • Page 331 APPENDICES (g) No.150 : Programming operation Programming operation [G150] [G151] [G152] //(OFF to ON)detection of PX3. //Did you turn on PX4? //Did you finish a programming operation //mode? //PX3 turns on M0 in on when M1 (last time !(PX2*!PX1) //condition of PX3) is off. RST M0 Edge(OFF to ON) SET M0=PX3 * !M1...
  • Page 332 APPENDICES (3) System setting data of the Motion CPU System setting is shown below. (a) Module setting Manual pulse generator interface module (Q173PX : Slot 3) Axis No. Description Manual pulse generator, Synchronous encoder (INC) Manual pulse generator, Synchronous encoder (INC) Manual pulse generator, Synchronous encoder (INC) I/O response time 0.4[ms]...
  • Page 333 "W0 to" by the Motion SFC No.2 0800 0831 program on the No.3 Q173HCPU side.). No.4 3) Automatic refresh setting 2 This device area is set Send range for each CPU CPU side device up in "D0" with the Qn CPU share memory G Dev.
  • Page 334 APPENDICES 6) System setting Setting items Description Operation cycle setting Auto Operation mode M2000 is turned on with switch (Stop to Run) Emergency shout down input 7) Latch range setting Latch (1) Latch (2) Item Symbol Start Start Internal relay Link relay Annunciator Data register...
  • Page 335: Appendix 2.4 Continuation Execution Example At The Subroutine Re-Start By The Motion Sfc Program

    APPENDICES APPENDIX 2.4 Continuation execution example at the subroutine re-start by the Motion SFC program (1) Explanation of the operation This is the program example which execute continuously from the motion control step which stopped on the way when it re-started after stopping the subroutine program with the clear step during the motion control is running.
  • Page 336 • This program starts automatically at the time of RUN of Q173HCPU, and it is always executed. • Watch data is taken out, and clock data read request (M9028) is turned on. • "0" is set on the continuation point (#100 : user device) as an...
  • Page 337 APPENDICES (a) No.20 : Main Main [F20] "0" is set on the continuation point (#100) SET M9028 //Clock data read request on as an initial value. #100=0 //Continuation point=0 [G20] M9076 //Did you release a forced //stop? The subroutine starts "No.160 : Restart continuation"...
  • Page 338 APPENDICES (b) No.160 : Restart continuation Restart continuation [G190] [G191] [G192] [G193] #100==0 //Is a continuation point 0? #100==10 //Is a continuation #100==20 //Is a continuation #100==30 //Is a continuation //point 10? //point 20? //point 30? [G151] The process is started corresponding to the value of //Did you turn on PX4? #100 (continuation point) from each point of P0 to P30.
  • Page 339: Appendix 2.5 Continuation Execution Example After The Stop By The Motion Sfc Program

    APPENDICES APPENDIX 2.5 Continuation execution example after the stop by the Motion SFC program (1) The explanation of the operation The program example that the Motion SFC program is stopped by external input signal ON for the forced stop from the input module, and it is executed continuously by external signal OFF for the stop is shown below.
  • Page 340 • This program starts automatically at the time of RUN of Q173HCPU, and it is always executed. • Watch data is taken out, and clock data read request (M9028) is turned on. • The initials condition of the internal relay (M100) for the stop is turned on.
  • Page 341 APPENDICES (a) No.20 : Main Main [F20] The internal relay (M100) for the stop SET M9028 //Clock data read request on turn on. SET M100 //Stop ON (Initials set) Stop The subroutine starts "170: stop" and "150 : Programming operation". Programming operation [G20] The subroutine that motion control was...
  • Page 342 APPENDICES (c) No.150 : Programming operation Programming operation WAIT transition which [G151] wants to stop substitutes //Did you turn on PX4, and turn "The internal relay (M100) //off a stop? for the stop turns off." for PX4*!M100 the AND status. [K150:Real] The motion control step 1 ABS-2...
  • Page 343 WARRANTY Please confirm the following product warranty details before using this product. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company.
  • Page 344 MOTION CONTROLLER Qseries SV13/SV22(Motion SFC)Programming Manual (Q173HCPU/Q172HCPU) HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN Q173H-P-SV13/22-SFCE MODEL MODEL 1XB912 CODE When exported from Japan, this manual does not require application to the IB(NA)-0300112-B(0609)MEE Ministry of Economy, Trade and Industry for service transaction permission.

This manual is also suitable for:

Q172hcpu

Table of Contents