Mitsubishi MELSEC-L series Programming Manual

Mitsubishi MELSEC-L series Programming Manual

Hide thumbs Also See for MELSEC-L series:
Table of Contents

Advertisement

Quick Links

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MELSEC-L series and is the answer not in the manual?

Questions and answers

Summary of Contents for Mitsubishi MELSEC-L series

  • Page 3: Safety Precautions

    SAFETY PRECAUTIONS (Always read these instructions before using this product.) Before using the MELSEC-Q series and MELSEC-L series programmable controllers, thoroughly read the manuals attached to the products and the relevant manuals introduced in the attached manuals. Also pay careful attention to safety and handle the products properly.
  • Page 4: Conditions Of Use For The Product

    PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi and provided further that no special quality assurance or fail-safe, redundant or other safety features which exceed the general specifications of the PRODUCTs are required.
  • Page 5: 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 6: Table Of Contents

    INTRODUCTION Thank you for purchasing the Mitsubishi MELSEC-Q series programmable controller. Before using the product, thoroughly read this manual to develop full familiarity with the programming specifications to ensure correct use. Please forward this manual to the end user. CONTENTS SAFETY PRECAUTIONS ..........................A - 1...
  • Page 7 5. MODULE DEDICATED INSTRUCTION 5 - 1 to 5 - 246 5.1 Analog Instruction 5 - 2 5.1.1 OFFGAN instruction ........................5 - 2 5.1.2 OGLOAD instruction ........................5 - 4 5.1.3 OGSTOR instruction........................5 - 31 5.2 Serial Communication and Modem Interface Instruction 5 - 60 5.2.1 ONDEMAND instruction ......................
  • Page 8 5.4.22 UINI instruction .......................... 5 - 218 5.4.23 MRECV instruction ........................5 - 221 5.4.24 MSEND instruction ........................5 - 226 5.5 Positioning Instruction 5 - 233 5.5.1 ABRST instruction ........................5 - 233 5.5.2 PSTRT instruction........................5 - 237 5.5.3 TEACH instruction ........................
  • Page 9 8.2.3 ICPREWR instruction ........................8 - 21 8.2.4 ICLTHRD instruction........................8 - 22 8.2.5 ICSMPRD instruction........................8 - 23 8.2.6 ICCOVWR instruction ........................8 - 24 8.2.7 ICFCNT instruction ........................8 - 25 8.2.8 ICRCNT instruction........................8 - 26 8.2.9 ICPLSRD instruction........................8 - 27 8.2.10 ICPWM instruction ........................
  • Page 10: Manuals

    MANUALS Related manuals The manuals related to this product are shown below. Refer to the following tables when ordering required manuals. (1) Structured programming Manual number Manual name (Model code) MELSEC-Q/L/F Structured Programming Manual (Fundamentals) Explains the programming method, types of programming languages, and other information required to create SH-080782ENG structured programs.
  • Page 11 (3) Detailed specifications of instructions • Analog instruction Manual number Manual name (Model code) Analog-Digital Converter Module User's Manual SH-080055 Explains the system configuration, performance specifications, functions, handling, wiring, and troubleshooting of the Q64AD, Q68ADV, and Q68ADI. (13JR03) (Sold separately) Channel Isolated High Resolution Analog-Digital Converter Module Channel Isolated High Resolution Analog-Digital Converter Module (With Signal Conditioning Function) User's Manual...
  • Page 12 • Serial communication and modem interface instruction Manual number Manual name (Model code) Q Corresponding Serial Communication Module User's Manual (Basic) Explains the overview for use of the module, applicable system configuration, specifications, procedures before SH-080006 operation, fundamental data communication with external devices, maintenance, inspection, and troubleshooting. (13JL86) (Sold separately) MELSEC-L Serial Communication Module User's Manual (Basic)
  • Page 13 • Positioning instruction Manual number Manual name (Model code) Type QD75P/QD75D Positioning Module User's Manual (Details) Explains the system configuration, performance specifications, functions, handling, procedures before operation, and SH-080058 troubleshooting of the QD75P1/QD75P2/QD75P4 and QD75D1/QD75D2/QD75D4. (13JR09) (Sold separately) Type QD75M Positioning Module User's Manual (Details) Explains the system configuration, performance specifications, functions, handling, procedures before operation, and IB-0300062 troubleshooting of the QD75M1/QD75M2/QD75M4.
  • Page 14 MEMO A-12...
  • Page 15: Overview

    OVERVIEW Purpose of This Manual ......... . 1-2 Generic Terms and Abbreviations in This Manual .
  • Page 16: Purpose Of This Manual

    Purpose of This Manual This manual explains the instructions for the network module, intelligent function module, PID control, socket communication function, built-in I/O function, and data logging function among common instructions and special instructions necessary for creating programs using the structured programming technique.
  • Page 17 (2) Programming User's Manual MELSEC- MELSEC- MELSEC- for intelligent Q/L/F function module/ MELSEC-Q/L Structured Programming Q/L/QnA Structured Reference Manual Programming Programming Programming Manual for Manual Manual Manual network module Purpose Common Special Application Common PID Control − Fundamentals Instructions Instructions Functions Instructions Instructions...
  • Page 18: Generic Terms And Abbreviations In This Manual

    Generic Terms and Abbreviations in This Manual This manual uses the generic terms and abbreviations listed in the following table to discuss the software packages and programmable controller CPUs. Corresponding module models are also listed if needed. Generic term and Description abbreviation GX Works2...
  • Page 19: Explanation Contents In This Manual

    Explanation Contents in This Manual This manual explains the programming methods and data used for control of the following modules and PID control using structured programming technique. Function/module for explaining an Processing performed by the instruction Reference instruction • Switches the mode. (Offset/gain setting mode or normal mode) Analog module Section 5.1...
  • Page 20 Function/module for explaining an Processing performed by the instruction Reference instruction • Starts positioning of the specified axis. • Starts OPR of the specified axis. • Starts JOG operation of the specified axis. Positioning function • Restores the absolute position of the specified axis. •...
  • Page 21: Modules And Versions Applicable To Instructions

    Modules and Versions Applicable to Instructions This section explains the modules and versions applicable to the instructions explained in this manual. For details of applicable versions, refer to each instruction in Chapter 5. Function/module for explaining an instruction Applicable version/serial number Q64AD Q68ADV Q68ADI...
  • Page 22 Function/module for explaining an instruction Applicable version/serial number QD75P1 QD75P2 QD75P4 QD75D1 QD75D2 QD75D4 Positioning module Applicable to all versions QD75M1 QD75M2 QD75M4 QD75MH1 QD75MH2 QD75MH4 Q00J Q00UJ Q00U Q01U Q02H Q02U Q03UD Q03UDE Q04UDH Q04UDEH The modules that can use the instruction are limited. CPU module supporting the PID control Q06H instruction...
  • Page 23 • How to check the applicable version or serial number Intelligent function modules : User's Manual or Reference Manual for the module listed in 'Manuals' CPU modules supporting PID control: User's Manual (Function Explanation, Program Fundamentals) of the CPU module to be used Built-in Ethernet port QCPU : QnUCPU User's Manual (Communication via Built-in Ethernet...
  • Page 24 MEMO 1-10...
  • Page 25: Instruction Tables

    INSTRUCTION TABLES How to Read Instruction Tables ........2-2 Module Dedicated Instruction .
  • Page 26: How To Read Instruction Tables

    How to Read Instruction Tables Instruction tables in Section 2.2 have the following form: Executing Classification Instruction name Argument Processing details Page condition G_OFFGAN Moves to the offset/gain setting mode. Mode switching Moves to the normal mode. GP_OFFGAN G_OGLOAD Setting value Reads the user range settings offset/gain value to the programmable controller CPU.
  • Page 27: Module Dedicated Instruction

    Module Dedicated Instruction 2.2.1 Analog instruction Executing Classification Instruction name Argument Processing details Page condition G_OFFGAN Moves to the offset/gain setting mode. Mode switching Moves to the normal mode. GP_OFFGAN G_OGLOAD Setting value Reads the user range settings offset/gain value reading to the programmable controller CPU.
  • Page 28: Serial Communication And Modem Interface Instruction

    2.2.2 Serial communication and modem interface instruction Applicable module Executing Classification Instruction name Argument Processing details Page Serial condition Modem communica interface tion On-demand G_ONDEMAND Sends data using the on-demand 5-60 function function of MC protocol. GP_ONDEMAND transmission G_OUTPUT Nonprocedural Sends the specified number of data.
  • Page 29: Cc-Link Instruction

    2.2.3 CC-Link instruction Executing Classification Instruction name Argument Processing details Page condition Reading from the G_RIRD buffer memory of Reads data from the buffer memory of the 5-108 an intelligent specified station. GP_RIRD device station Writing to the G_RIWT Writes data to the buffer memory of the specified buffer memory of station or the programmable controller CPU device 5-113...
  • Page 30: Cc-Link Ie Controller Network, Melsecnet/H, And Ethernet Instruction

    2.2.4 CC-Link IE controller network, MELSECNET/H, and Ethernet instruction Applicable module CC-Link Classific Executing Instruction name Argument Processing details MELSEC Page ation condition Ethernet controller NET/H network J_READ Jn * JP_READ Jn * Reads data from a word device 5-137 of another station.
  • Page 31 Applicable module CC-Link Classific Executing Instruction name Argument Processing details MELSEC Page ation condition Ethernet controller NET/H network J_REQ Jn * Transient Executes remote RUN/STOP for request JP_REQ Jn * another station. 5-172 Reads/writes clock data from G_REQ another another station. station GP_REQ Z_RRUN_J...
  • Page 32: 2.2.5 Positioning Instruction

    Applicable module CC-Link Classific Executing Instruction name Argument Processing details MELSEC Page ation condition Ethernet controller NET/H network Connection 5-195 ZP_OPEN Opens a connection. – – opening or 5-199 closing ZP_CLOSE Closes a connection. – – Reads received data. 5-202 ZP_BUFRCV –...
  • Page 33: Pid Control Instruction

    PID Control Instruction 2.3.1 PID control instruction (inexact differential) Executing Classification Instruction name Argument Processing details Page condition S_PIDINIT Data setting Sets data to be used for PID operation. SP_PIDINIT S_PIDCONT Performs PID operation based on the set value (SV) PID operation and process value (PV).
  • Page 34: Socket Communication Function Instruction

    Socket Communication Function Instruction Executing Classification Instruction name Argument Processing details Page condition SP_SOCOPEN Establishes a connection. Opening/closing connection SP_SOCCLOSE Shuts a connection off. SP_SOCRCV Reads receive data. (Reading at the end process) Reading receive Reads receive data. (Reading at the instruction data S_SOCRCVS 7-11...
  • Page 35: Built-In I/O Function Instruction

    Built-in I/O Function Instruction 2.5.1 Positioning function dedicated instruction Executing Classification Instruction name Argument Processing details Page condition IPPSTRT1 Specifies a data number to be executed from IPPSTRT1P "Positioning Data" No. 1 to No. 10 which are previously set in GX Works2, and starts the IPPSTRT2 positioning.
  • Page 36: Counter Function Dedicated Instruction

    2.5.2 Counter function dedicated instruction Executing Classification Instruction name Argument Processing details Page condition ICCNTRD1 ICCNTRD1P Stores the most recent value for the current Current value read 8-18 value of the specified CH. ICCNTRD2 ICCNTRD2P ICRNGWR1 Ring counter ICRNGWR1P Sets a ring counter lower limit value and upper upper/lower limit 8-19 limit value of the specified CH.
  • Page 37 Executing Classification Instruction name Argument Processing details Page condition ICPLSRD1 ICPLSRD1P Pulse Stores the measured pulse value of the 8-27 measurement read specified CH. ICPLSRD2 ICPLSRD2P ICPWM1 PWM output Outputs the PWM waveform of the specified CH. 8-28 ICPWM2 2.5 Built-in I/O Function Instruction 2-13 2.5.2 Counter function dedicated instruction...
  • Page 38: Data Logging Function Instruction

    Data Logging Function Instruction Executing Classification Instruction name Argument Processing details Page condition Generates the trigger conditions in a trigger logging. Stores the data sampling results to the data logging LOGTRG Trigger logging file for the number of times specified in the trigger set/reset logging configuration of the programming tool.
  • Page 39 CONFIGURATION OF INSTRUCTIONS Configuration of Instructions........3-2...
  • Page 40 Configuration of Instructions Instructions available in the CPU module can be divided into an instruction name and an argument. The application of an instruction name and an argument are as follows: • Instruction name..Indicates the function of the instruction. •...
  • Page 41 (2) Source (a) A source is data used in an operation. (b) The following source types are available depending on the device specified in an instruction: • Constant ..... Specifies a numeric value used in an operation. Constants are set during programming so that they cannot be changed while the program is being executed.
  • Page 42 MEMO...
  • Page 43 HOW TO READ INSTRUCTIONS...
  • Page 44 Chapter 5 provides detailed explanation on each instruction in the layout as shown below. Indicates a section number and an outline of an instruction. Indicates an instruction to be explained. Indicates the instruction execution target module. If one instruction is to be executed in two or more modules, applicable modules are indicated using icons.
  • Page 45 Indicates the names of input and output arguments, and the data type of each argument. For details of each data type, refer to the MELSEC-Q/L/F structured programming manual (Fundamentals). Devices that can be used in the instruction are marked with The following table shows applicable classification for usable devices.
  • Page 46 Indicates the processing performed by the instruction. Indicates data such as control data, send data or receive data, that are used for an input argument or output argument in an instruction. Example: Control data to be used in the CC-Link instruction 'GP_RIRD' The setting side indicates the following: User : Data set by user before dedicated instruction execution System : Data stored by the programmable controller CPU after dedicated instruction...
  • Page 47 MODULE DEDICATED INSTRUCTION Analog Instruction..........5-2 Serial Communication and Modem Interface Instruction .
  • Page 48: Offgan Instruction

    G_OFFGAN Analog Instruction 5.1.1 OFFGAN instruction G_OFFGAN G(P)_OFFGAN P: Executing condition indicates any of the following instructions. Structured ladder G_OFFGAN G_OFFGAN GP_OFFGAN ENO:= (EN, Un*, s); G_OFFGAN Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Mode switching...
  • Page 49 G_OFFGAN Program Example The following program converts the mode of the A/D converter module mounted on the I/O numbers from X/Y0 to X/YF to the offset/gain setting mode when the flag turns ON, and gets it back to the normal mode when the flag turns OFF. [Structured ladder] Sets mode when flag turns ON...
  • Page 50: Ogload Instruction

    G_OGLOAD 5.1.2 OGLOAD instruction G_OGLOAD G(P)_OGLOAD P: Executing condition indicates any of the following instructions. Structured ladder G_OGLOAD G_OGLOAD GP_OGLOAD ENO:= (EN, Un*, s, d); G_OGLOAD Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..99]...
  • Page 51 G_OGLOAD Control Data (1) Q64AD/L60AD4 Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 52 G_OGLOAD (2) Q68ADV Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 53 G_OGLOAD (3) Q68ADI Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 54 G_OGLOAD (4) Q64AD-GH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 55 G_OGLOAD (5) Q62AD-DGH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 56 G_OGLOAD (6) Q68AD-G Device Item Setting data Setting range Setting side Ñü System area – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 57 G_OGLOAD (7) Q66AD-DG Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) – System area – – CH1 Industrial shipment settings offset value System –...
  • Page 58 G_OGLOAD (8) Q62DAN/Q62DA Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 59 G_OGLOAD (9) Q64DAN/Q64DA/L60DA4 Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 60 G_OGLOAD (10) Q68DAVN/Q68DAV Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 61 G_OGLOAD (11) Q68DAIN/Q68DAI Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 62 G_OGLOAD (12) Q62DA-FG Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the user range setting to read the offset/gain values.
  • Page 63 G_OGLOAD (13) Q66DA-G Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) Specify the user range setting to read the offset/gain values.
  • Page 64 G_OGLOAD (14) Q64RD/Q64RD-G Control data of Q64RD/Q64RD-G (1/5) Setting Setting Device Item Setting data range side System area – – – The instruction completion status is stored. : Normal Completion status completion System – Other than 0 : Error completion (error code) System area –...
  • Page 65 G_OGLOAD Control data of Q64RD/Q64RD-G (2/5) Setting Setting Device Item Setting data range side 4-wire CH1 Factory default offset value (L) [16] System – – 4-wire CH1 Factory default offset value (H) [17] 4-wire CH1 Factory default gain value (L) [18] System –...
  • Page 66 G_OGLOAD Control data of Q64RD/Q64RD-G (3/5) Setting Setting Device Item Setting data range side 4-wire CH2 Factory default offset value (L) [40] System – – 4-wire CH2 Factory default offset value (H) [41] 4-wire CH2 Factory default gain value (L) [42] System –...
  • Page 67 G_OGLOAD Control data of Q64RD/Q64RD-G (4/5) Setting Setting Device Item Setting data range side 4-wire CH3 Factory default offset value (L) [64] System – – 4-wire CH3 Factory default offset value (H) [65] 4-wire CH3 Factory default gain value (L) [66] System –...
  • Page 68 G_OGLOAD Control data of Q64RD/Q64RD-G (5/5) Setting Setting Device Item Setting data range side 4-wire CH4 Factory default offset value (L) [88] System – – 4-wire CH4 Factory default offset value (H) [89] 4-wire CH4 Factory default gain value (L) [90] System –...
  • Page 69 G_OGLOAD (15) Q64TD/Q64TDV-GH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) System area – –...
  • Page 70 G_OGLOAD (16) Q68TD-G-H02(H01) Control data of Q68TD-G-H02(H01) (1/2) Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) System area –...
  • Page 71 G_OGLOAD Control data of Q68TD-G-H02(H01) (2/2) Device Item Setting data Setting range Setting side CH5 User range settings thermal EMF gain value (L) [42] System – – CH5 User range settings thermal EMF gain value (H) [43] System CH6 Factory default offset value –...
  • Page 72 G_OGLOAD (17) Q68RD3-G Control data of Q68RD3-G (1/2) Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) System area –...
  • Page 73 G_OGLOAD Control data of Q68RD3-G (2/2) Device Item Setting data Setting range Setting side CH5 User range settings resistance gain value (L) [42] System – – CH5 User range settings resistance gain value (H) [43] System CH6 Factory default offset value –...
  • Page 74 G_OGLOAD (18) Q61LD Control data of Q61LD (1/2) Device Item Setting data Setting range Setting side System System area – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) System System area –...
  • Page 75 G_OGLOAD Control data of Q61LD (2/2) Device Item Setting data Setting range Setting side System 1.0mV/V span calibration value (L) – – [56] System 1.0mV/V span calibration value (H) – – [57] 2.0mV/V zero calibration value (L) System – – [58] System 2.0mV/V zero calibration value (H)
  • Page 76 G_OGLOAD Program Example The following program reads out the offset/gain value of the A/D converter module mounted on the I/O numbers from X/Y0 to X/YF. *1: With the Q68ADV/Q68ADI, the pass data classification setting (control data [2]) does not need to be set. [Structured ladder] Specifies voltage Not needed...
  • Page 77: Ogstor Instruction

    G_OGSTOR 5.1.3 OGSTOR instruction G_OGSTOR G(P)_OGSTOR P: Executing condition indicates any of the following instructions. Structured ladder G_OGSTOR G_OGSTOR GP_OGSTOR ENO:= (EN, Un*, s, d); G_OGSTOR Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..99]...
  • Page 78 G_OGSTOR Control Data (1) Q64AD Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) The value set for pass data classification setting by the OGLOAD instruction is stored.
  • Page 79 G_OGSTOR (2) Q68ADV Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 80 G_OGSTOR (3) Q68ADI Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 81 G_OGSTOR (4) Q64AD-GH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) The value set for pass data classification setting by the OGLOAD instruction is stored.
  • Page 82 G_OGSTOR (5) Q62AD-DGH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 83 G_OGSTOR (6) Q68AD-G Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 84 G_OGSTOR (7) Q66AD-DG Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) System area – – – CH1 Industrial shipment settings offset value System –...
  • Page 85 G_OGSTOR (8) Q62DAN/Q62DA Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) The value set for pass data classification setting by the OGLOAD instruction is stored.
  • Page 86 G_OGSTOR (9) Q64DAN/Q64DA Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) The value set for pass data classification setting by the OGLOAD instruction is stored.
  • Page 87 G_OGSTOR (10) Q68DAVN/Q68DAV Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 88 G_OGSTOR (11) Q68DAIN/Q68DAI Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) System area – –...
  • Page 89 G_OGSTOR (12) Q62DA-FG Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) The value set for pass data classification setting by the OGLOAD instruction is stored.
  • Page 90 G_OGSTOR (13) Q66DA-G Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status :Normal completion System – Other than 0 :Error completion (error code) The value set for pass data classification setting [2] by the OGLOAD instruction is stored.
  • Page 91 G_OGSTOR (14) Q64RD/Q64RD-G Control data of Q64RD/Q64RD-G (1/5) Setting Setting Device Item Setting data range side System area – – – The instruction completion status is stored. : Normal Completion status completion System – Other than 0 : Error completion (error code) System area –...
  • Page 92 G_OGSTOR Control data of Q64RD/Q64RD-G (2/5) Setting Setting Device Item Setting data range side 4-wire CH1 Factory default offset value (L) [16] System – – 4-wire CH1 Factory default offset value (H) [17] 4-wire CH1 Factory default gain value (L) [18] System –...
  • Page 93 G_OGSTOR Control data of Q64RD/Q64RD-G (3/5) Setting Setting Device Item Setting data range side 4-wire CH2 Factory default offset value (L) [40] System – – 4-wire CH2 Factory default offset value (H) [41] 4-wire CH2 Factory default gain value (L) [42] System –...
  • Page 94 G_OGSTOR Control data of Q64RD/Q64RD-G (4/5) Setting Setting Device Item Setting data range side 4-wire CH3 Factory default offset value (L) [64] System – – 4-wire CH3 Factory default offset value (H) [65] 4-wire CH3 Factory default gain value (L) [66] System –...
  • Page 95 G_OGSTOR Control data of Q64RD/Q64RD-G (5/5) Setting Setting Device Item Setting data range side 4-wire CH4 Factory default offset value (L) [88] System – – 4-wire CH4 Factory default offset value (H) [89] 4-wire CH4 Factory default gain value (L) [90] System –...
  • Page 96 G_OGSTOR (15) Q64TD/Q64TDV-GH Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) System area – –...
  • Page 97 G_OGSTOR (16) Q68TD-G-H02(H01) Control data of Q68TD-G-H02(H01) (1/2) Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) –...
  • Page 98 G_OGSTOR Control data of Q68TD-G-H02(H01) (2/2) Device Item Setting data Setting range Setting side CH5 User range settings thermal EMF offset value (L) [40] System – – CH5 User range settings thermal EMF offset value (H) [41] CH5 User range settings thermal EMF gain value (L) [42] System –...
  • Page 99 G_OGSTOR (17) Q68RD3-G Control data of Q68RD3-G (1/2) Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) System area –...
  • Page 100 G_OGSTOR Control data of Q68RD3-G (2/2) Device Item Setting data Setting range Setting side System CH5 User range settings gain value – – [39] CH5 User range settings resistance offset value (L) [40] System – – CH5 User range settings resistance offset value (H) [41] CH5 User range settings resistance gain value (L) [42]...
  • Page 101 G_OGSTOR (18) Q61LD Control data of Q61LD (1/2) Device Item Setting data Setting range Setting side System System area – – The instruction completion status is stored. :Normal completion Completion status System – Other than 0 :Error completion (error code) System System area –...
  • Page 102 G_OGSTOR Control data of Q61LD (2/2) Device Item Setting data Setting range Setting side System 1.0mV/V span calibration value (L) – – [56] – System 1.0mV/V span calibration value (H) – [57] 2.0mV/V zero calibration value (L) System – – [58] System 2.0mV/V zero calibration value (H)
  • Page 103 G_OGSTOR (19) L60AD4 Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 104 G_OGSTOR (20) L60DA4 Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the voltage/current of the offset/gain values to be read.
  • Page 105 G_OGSTOR Program Example The following program restores the offset/gain setting value to the A/D converter module mounted on the I/O numbers from X/Y10 to X/Y1F when the flag turns ON. [Structured ladder] Turns execution flag ON Restores setting value Normal completion Turns execution flag OFF Process on error completion...
  • Page 106: Serial Communication And Modem Interface Instruction

    G_ONDEMAND Serial Communication and Modem Interface Instruction 5.2.1 ONDEMAND instruction G_ONDEMAND Sirial Modem G(P)_ONDEMAND P: Executing condition indicates any of the following instructions. Structured ladder G_ONDEMAND G_ONDEMAND GP_ONDEMAND ENO:= (EN, Un*, s1, s2, d); G_ONDEMAND Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16...
  • Page 107 G_ONDEMAND Control Data Device Item Setting data Setting range Setting side Set the transmission channel. 1: Channel 1 (CH1 side) 1, 2 User Transmission channel 2: Channel 2 (CH2 side) The instruction completion status is stored. : Normal completion System Transmission result –...
  • Page 108 G_ONDEMAND Program Example The following program sends data of devices from D10 to D11 using the on-demand function. (For the Q series C24 whose I/O signals are X/Y00 to X/Y1F) [Structured ladder] On-demand transmission instruction pulse Sets transmission channel to 1 Sets number of send data to 2 words Sets send data...
  • Page 109 G_ONDEMAND [ST] PLS(X53, Var_Flag_Inst); (* On-demand transmission instruction pulse *) IF(Var_Flag_Inst=TRUE)THEN (* Instruction flag ON *) MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *) MOV(TRUE, 2, Var_ControlData[2]); (* Sets number of send data to 2 words *) MOV(TRUE, H1234, D10); (* Sets send data to D10 to D11 *) MOV(TRUE, H5678, D11);...
  • Page 110: Output Instruction

    G_OUTPUT 5.2.2 OUTPUT instruction G_OUTPUT Sirial Modem G(P)_OUTPUT P: Executing condition indicates any of the following instructions. Structured ladder G_OUTPUT G_OUTPUT GP_OUTPUT ENO:= (EN, Un*, s1, s2, d); G_OUTPUT Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 111 G_OUTPUT Control Data Device Item Setting data Setting range Setting side Set the transmission channel. Transmission channel 1: Channel 1 (CH1 side) 1, 2 User 2: Channel 2 (CH2 side) The instruction completion status is stored. Transmission result : Normal completion System –...
  • Page 112 G_OUTPUT [ST] PLS(X20, Var_Flag_Inst); (* Transmission instruction pulse*) IF (Var_Flag_Inst=TRUE) THEN MOV(TRUE, H4241, D11); (* Sets send data *) MOV(TRUE, H4443, D12); MOV(TRUE, H4645, D13); MOV(TRUE, H0047, D14); MOV(TRUE, H0A0D, D15); MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *) MOV(TRUE, 5, Var_ControlData[2]);...
  • Page 113: Input Instruction

    G_INPUT 5.2.3 INPUT instruction G_INPUT Sirial Modem G_INPUT indicates any of the following instructions. Structured ladder G_INPUT G_INPUT ENO:= (EN, Un*, s, d1, d2); G_INPUT Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..3]...
  • Page 114 G_INPUT Control Data Device Item Setting data Setting range Setting side Set the reception channel. 1: Channel 1 (CH1 side) 1, 2 User Reception channel 2: Channel 2 (CH2 side) The instruction completion status is stored. : Normal completion System Reception result –...
  • Page 115 G_INPUT [ST] IF((X3=TRUE) OR (X4=TRUE))THEN MOVP(TRUE, 1, Var_ControlData[0]); (* Sets receive channel to 1 *) MOVP(TRUE, 10, Var_ControlData[3]); (* Sets allowable number of words for receive data to 10 words *) G_INPUT(TRUE, H0, Var_ControlData, D10, Var_Result); (* Receives data *) END_IF;...
  • Page 116: Bidout Instruction

    G_BIDOUT 5.2.4 BIDOUT instruction G_BIDOUT Sirial Modem G(P)_BIDOUT P: Executing condition indicates any of the following instructions. Structured ladder G_BIDOUT G_BIDOUT GP_BIDOUT ENO:= (EN ,Un* ,s1 ,s2 ,d); G_BIDOUT Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 117 G_BIDOUT Control Data Device Item Setting data Setting range Setting side Set the transmission channel. 1: Channel 1 (CH1 side) 1, 2 User Transmission channel 2: Channel 2 (CH2 side) The instruction completion status is stored. : Normal completion System Transmission result –...
  • Page 118 G_BIDOUT [ST] PLS(X20, Var_Flag_Inst); (* Transmission instruction pulse *) IF(Var_Flag_Inst=TRUE)THEN MOV(TRUE, H4241, D11); (* Sets send data *) MOV(TRUE, H4443, D12); MOV(TRUE, H4645, D13); MOV(TRUE, H0047, D14); MOV(TRUE, H0A0D, D15); MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *) MOV(TRUE, 5, Var_ControlData[2]);...
  • Page 119: Bidin Instruction

    G_BIDIN 5.2.5 BIDIN instruction G_BIDIN Sirial Modem G(P)_BIDIN P: Executing condition indicates any of the following instructions. Structured ladder G_BIDIN G_BIDIN GP_BIDIN ENO:= (EN, Un*, s, d1, d2); G_BIDIN Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 120 G_BIDIN Control Data Device Item Setting data Setting range Setting side Set the reception channel. 1: Channel 1 (CH1 side) 1, 2 User Reception channel 2: Channel 2 (CH2 side) The instruction completion status is stored. Reception result System – 0: Normal Number of receive data The number of received data are stored.
  • Page 121: Spbusy Instruction

    G_SPBUSY 5.2.6 SPBUSY instruction G_SPBUSY Sirial Modem G(P)_SPBUSY P: Executing condition indicates any of the following instructions. Structured ladder G_SPBUSY G_SPBUSY GP_SPBUSY ENO:= (EN, Un*, d); G_SPBUSY Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Output argument...
  • Page 122: Cset Instruction (Receive Data Clear)

    ZP_CSET 5.2.7 CSET instruction (receive data clear) ZP_CSET Sirial Modem ZP_CSET Executing condition indicates the following instruction. ZP_CSET Structured ladder ZP_CSET ENO:= (EN, Un*, s1, s2, d1, d2); ZP_CSET Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 123 ZP_CSET Control Data Device Item Setting data Setting range Setting side Execution type Specify '0'. User The instruction completion status is stored. : Normal completion System Completion status – : Error completion (error code) Other than 0 Specify the request. Request type User 4: Receive data clear request...
  • Page 124 ZP_CSET [ST] IF(X20=TRUE)THEN MOVP(TRUE, 0, Var_ControlData[0]); (* Clears execution type to 0 *) MOVP(TRUE, 4, Var_ControlData[2]); (* Sets request type *) ZP_CSET(TRUE, "00", 1, Var_ControlData, Var_Dummy, Var_Result); (* Clears data *) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) IF(Var_Result[1]=FALSE)THEN (* Normal completion *) SET(TRUE, Var_Flag_Normal);...
  • Page 125: Bufrcvs Instruction

    Z_BUFRCVS 5.2.8 BUFRCVS instruction Z_BUFRCVS Sirial Modem Z_BUFRCVS indicates the following instruction. Z_BUFRCVS Structured ladder Z_BUFRCVS ENO:= (EN, Un*, s, d); Z_BUFRCVS Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Reception channel number :ANY16...
  • Page 126 Z_BUFRCVS Receive Data Device Item Setting data Setting range Setting side The number of data read from the number of receive 0 or more System Receive data length data storage area is stored. Data read from the receive data storage area are System Receive data –...
  • Page 127: Prr Instruction

    G_PRR 5.2.9 PRR instruction G_PRR Sirial Modem G(P)_PRR P: Executing condition indicates any of the following instructions. Structured ladder G_PRR G_PRR GP_PRR ENO:= (EN, Un*, s, d); G_PRR Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 128 G_PRR Control Data Device Item Setting data Setting range Setting side Set the transmission channel. 1: Channel 1 (CH1 side) 1, 2 User Transmission channel 2: Channel 2 (CH2 side) The instruction completion status is stored. : Normal completion System Transmission result –...
  • Page 129 G_PRR Program Example The following program sends desired data and the user frames from number 1 to number 5 which are registered in the transmission frame setting. (For the Q series C24 whose I/O signals are X/Y00 to X/Y1F) [Structured ladder] Transmission instruction pulse Sets number of...
  • Page 130 G_PRR [ST] PLS(X50, Var_Flag_Inst); (* Transmission instruction pulse *) IF((Var_Flag_Inst=TRUE) & (X9E=TRUE) & (X9F=FALSE))THEN MOV(TRUE, 4, Var_TransData[0]); (* Sets number of send data *) MOV(TRUE, H1234, Var_TransData[1]); (* Sets desired send data *) MOV(TRUE, H56AB, Var_TransData[2]); TO(TRUE, H400, Var_TransData[0], 3); (* Sets send data to buffer memory *) MOV(TRUE, H3F2, Var_Frame[0]);...
  • Page 131: Cset Instruction (Initial Setting)

    ZP_CSET 5.2.10 CSET instruction (initial setting) ZP_CSET Sirial Modem ZP_CSET Executing condition : indicates the following instruction. ZP_CSET Structured ladder ZP_CSET ENO:= (EN, Un*, s1, s2, d1, d2); ZP_CSET Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 132 ZP_CSET Control Data Device Item Setting data Setting range Setting side Execution type Specify '0'. User The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the request. Request type 1: Change of unit (word/byte) and buffer memory User...
  • Page 133 ZP_CSET Program Example The following program changes the send buffer area of the CH1 side interface. (For the Q series C24 whose I/O signals are X/Y00 to X/Y1F) • Sets send buffer to C00H to FFFH. • Sets receive buffer to 600H to 7FFH. [Structured ladder] Clears D0 to D111 to 0...
  • Page 134 ZP_CSET [ST] IF(Var_Flag_Inst=TRUE)THEN FMOVP(TRUE,0,112, Var_ControlData[0]); (* Resets D0 to D111 to 0 *) MOVP(TRUE, 0, Var_ControlData[0]); (* Sets execution type *) MOVP(TRUE, 1, Var_ControlData[2]); (* Sets request type *) MOVP(TRUE, 1, Var_ControlData[3]); (* Sets word/byte unit to word *) MOVP(TRUE, H400, Var_ControlData[4]); (* Sets on-demand start address *) MOVP(TRUE, 0, Var_ControlData[5]);...
  • Page 135: Cset Instruction (Programmable Controller Cpu Monitor)

    ZP_CSET 5.2.11 CSET instruction (programmable controller CPU monitor) ZP_CSET Sirial Modem ZP_CSET Executing condition : indicates the following instruction. ZP_CSET Structured ladder ZP_CSET ENO:= (EN, Un*, s1, s2, d1, d2); ZP_CSET Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 136 ZP_CSET Control Data (1) Registering the programmable controller CPU monitoring Device Item Setting data Setting range Setting side Execution type Specify '0'. User The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the request.
  • Page 137 ZP_CSET Device Item Setting data Setting range Setting side Specify the code of the device to be monitored. to CC : No device monitored User Device code [13] (Device code) Other than 0 : Device code [14] Specify the start number of the monitoring device in Monitoring start device 0 or more User...
  • Page 138 ZP_CSET Device Item Setting data Setting range Setting side [103] [104] [105] User Fixed value Specify a fixed value to monitor the CPU status. [106] [107] [108] Specify the start pointer of the to which the user frame number for condition agreement transmission for this block is set.
  • Page 139 ZP_CSET Program Example (1) Program to register the programmable controller CPU monitoring The following program registers the programmable controller CPU monitoring and sends the monitoring result from the CH1 side interface. The following setting is to send contents of devices from M0 to M15 and devices from D100 to D109 to the external device through the constant cycle transmission.
  • Page 140 ZP_CSET Sets number of registered word blocks Sets number of registered bit blocks Sets device code Sets start number of monitoring device Sets number of registered points Sets device code Sets start number of monitoring device Sets number of registered points (For bit device, specify it in units of words) Turns execution flag ON...
  • Page 141 ZP_CSET [ST] PLS(X24, Var_Flag_Inst); (* Instruction pulse *) IF((Var_Flag_Inst=TRUE) & (Var_Flag_Normal=FALSE))THEN MOV(TRUE, 0, Var_ControlData[0]); (* Sets execution type *) MOV(TRUE, 2, Var_ControlData[2]); (* Sets request type *) MOV(TRUE, 2, Var_ControlData[3]); (* Sets cycle time unit to minute *) MOV(TRUE, 3, Var_ControlData[4]); (* Sets cycle time to 3 minutes *) MOV(TRUE, 1, Var_ControlData[5]);...
  • Page 142 ZP_CSET (2) Program to cancel the programmable controller CPU monitoring The following program cancels the programmable controller CPU monitoring of the CH1 side interface. (For the Q series C24 whose I/O signals are X/Y00 to X/Y1F) [Structured ladder] Instruction pulse Sets execution type Sets request type Cancels programmable...
  • Page 143: Pute Instruction

    G_PUTE 5.2.12 PUTE instruction G_PUTE Sirial Modem G(P)_PUTE P: Executing condition indicates any of the following instructions. Structured ladder G_PUTE G_PUTE GP_PUTE ENO:= (EN, Un*, s1, s2, d); G_PUTE Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 144 G_PUTE Program Example The following program registers a user frame as the registration number 3E8H. (For the Q series C24 whose I/O signals are X/Y80 to X/Y9F) [Structured ladder] Registration request pulse Sets registration request Sets user frame number Sets number of registered bytes User frame 0 User frame 1...
  • Page 145 G_PUTE [ST] PLS(X50, Var_Flag_Inst); (* Registration request pulse *) IF(Var_Flag_Inst=TRUE)THEN MOV(TRUE, 1, Var_ControlData[0]); (* Sets registration request *) MOV(TRUE, H3E8, Var_ControlData[2]); (* Sets user frame number *) MOV(TRUE, 10, Var_ControlData[3]); (* Sets number of registered bytes *) MOV(TRUE, H3946, Var_Frame[0]); (* User frame 0 *) MOV(TRUE, H3030, Var_Frame[1]);...
  • Page 146: Gete Instruction

    G_GETE 5.2.13 GETE instruction G_GETE Sirial Modem G(P)_GETE P: Executing condition indicates any of the following instructions. Structured ladder G_GETE G_GETE GP_GETE ENO:= (EN, Un*, s1, s2, d); G_GETE Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 147 G_GETE Control Data Device Item Setting data Setting range Setting side Dummy – – The instruction completion status is stored. Read result : Normal completion System – Other than 0 : Error completion (error code) Frame No. specification Specify the user frame number. 1000 to 1199 User Specify the maximum number of bytes for storing the...
  • Page 148 G_GETE [ST] PLS(X51, Var_Flag_Inst); (* Read request pulse *) IF(Var_Flag_Inst=TRUE)THEN MOV(TRUE, 0, Var_ControlData[0]); MOV(TRUE, H3E8, Var_ControlData[2]); (* Sets user frame number *) MOV(TRUE, 80, Var_ControlData[3]); (* Sets allowable number of bytes for read data *) FMOV(TRUE, 0, 40, Var_Frame[0]); (* Clears user frame to 0 *) G_PUTE(TRUE, H08, Var_ControlData, Var_Frame[0], Var_Result);...
  • Page 149: Uini Instruction

    Z_UINI 5.2.14 UINI instruction Z_UINI Sirial Z_UINI Executing condition : indicates the following instruction. Z_UINI Structured ladder Z_UINI ENO:= (EN, Un*, s, d); Z_UINI Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..12]...
  • Page 150 Z_UINI Control Data Device Item Setting data Setting range Setting side User For system Always specify '0'. The instruction completion status is stored. Execution result : Normal completion System – Other than 0 : Error completion (error code) Specify the execution type. 0: Switches the execution type according to the 0, 1 Execution type...
  • Page 151 Z_UINI [4] (CH1 Communication protocol setting) and [6] (CH2 Communication protocol setting) Setting No. Description Remarks Specify '0000 ' for the transmission specification MELSOFT connection setting. Format 1 – Format 2 – MC protocol Format 3 – Format 4 – Format 5 –...
  • Page 152 Z_UINI [Structured ladder] UINI instruction command Clears control data to 0 Sets execution type Sets CH1 transmission specification Sets CH1 communication protocol Sets CH2 transmission specification Sets CH2 communication protocol Sets host station number Switches mode Turns interlock signal for communication stop ON Normal completion Process on normal completion...
  • Page 153 Z_UINI [ST] IF(LDP(TRUE, X20))THEN (* UNI instruction command *) IF((Y2=FALSE) (* CH1 mode switching request *) &(Y9=FALSE) (* CH2 mode switching request *) &(X6=FALSE) (* CH1 mode switching *) &(X0D=FALSE))THEN (* CH2 mode switching *) (* Runs if there is no mode switching *) FMOV(TRUE, 0, 40, Var_ControlData[0]);...
  • Page 154: Cc-Link Instruction

    G_RIRD CC-Link Instruction 5.3.1 RIRD instruction G_RIRD GP_RIRD P: Executing condition indicates any of the following instructions. Structured ladder G_RIRD G_RIRD GP_RIRD ENO:= (EN, Un*, s, d1, d2); G_RIRD Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 155 G_RIRD Control Data Device Item Setting data Setting range Setting side The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the station number of the local station and the 0 to 64 User Station No.
  • Page 156 G_RIRD (2) Device memory of the programmable controller CPU module Device type Device Name Unit Access code Attribute code Word Input relay Hexadecimal – Hexadecimal Output relay – Internal relay Decimal – Decimal Latch relay – Hexadecimal Link relay – Timer (contact) Decimal –...
  • Page 157 G_RIRD Program Example The following program reads out 10-word data, which start from D1000 of the number 1 local station connected to the master module mounted on the I/O numbers from X/Y40 to X/Y5F, and stores the data in the devices starting from D0 when X0 turns ON. (When the refresh device of the link special register (SW) is set to SW0.) [Structured ladder] Sets station number...
  • Page 158 G_RIRD [ST] IF((LDP(TRUE, X0)) &(Var_Flag_Exe=FALSE) (* Execution flag *) &(SW80.0=FALSE))THEN (* Data link status of station number 1 *) MOV(TRUE,1, Var_ControlData[1]); (* Sets station number *) MOV(TRUE,H0405, Var_ControlData[2]); (* Sets access code and attribute code *) MOV(TRUE, 1000, Var_ControlData[3]); (* Sets device number *) MOV(TRUE, H10, Var_ControlData[4]);...
  • Page 159: Riwt Instruction

    G_RIWT 5.3.2 RIWT instruction G_RIWT G(P)_RIWT P: Executing condition indicates any of the following instructions. Structured ladder G_RIWT G_RIWT GP_RIWT ENO:= (EN, Un*, s1, s2, d); G_RIWT Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data...
  • Page 160 G_RIWT Control Data Device Item Setting data Setting range Setting side The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the station number of the local station and the 0 to 64 User Station No.
  • Page 161 G_RIWT (2) Device memory of the programmable controller CPU module Device type Device Name Unit Access code Attribute code Word Input relay Hexadecimal – Hexadecimal Output relay – Internal relay Decimal – Decimal Latch relay – Hexadecimal Link relay – Timer (contact) Decimal –...
  • Page 162 G_RIWT Program Example The following program stores 10-word data, which are stored in the devices starting from D0, to the devices starting from D1000 of the number 1 local station connected to the master module mounted on the I/O numbers from X/Y40 to X/Y5F. (When the refresh device of the link special register (SW) is set to SW0.) [Structured ladder] Sets station number...
  • Page 163 G_RIWT [ST] IF((LDP(TRUE, X0)) &(Var_Flag_Exe=FALSE) (* Execution flag *) &(SW80.0=FALSE))THEN (* Data link status of station number 1 *) MOV(TRUE, 1, Var_ControlData[1]); (* Sets station number *) MOV(TRUE, H0405, Var_ControlData[2]); (* Sets access code and attribute code *) MOV(TRUE, 1000, Var_ControlData[3]); (* Sets device number *) MOV(TRUE, 10, Var_ControlData[4]);...
  • Page 164: Rircv Instruction

    G_RIRCV 5.3.3 RIRCV instruction G_RIRCV G(P)_RIRCV P: Executing condition indicates any of the following instructions. Structured ladder G_RIRCV G_RIRCV GP_RIRCV ENO:= (EN, Un*, s1, s2, d1, d2); G_RIRCV Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 165 G_RIRCV Control Data Device Item Setting data Setting range Setting side The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the station number of the intelligent device 0 to 64 User Station No.
  • Page 166 G_RIRCV Program Example The following program reads 11-word data, which are stored in buffer memory starting from the buffer memory address 400H of the number 63 intelligent device station (AJ65BT-R2(N)) connected to the master module mounted on the I/O numbers X/Y00 to X/Y1F, and stores the data in the devices starting from D40.
  • Page 167 G_RIRCV [ST] IF((Var_Flag_Inst=TRUE) (* Read request ON *) &(Var_Flag_Exe=FALSE) (* Execution flag *) &(SW83.E=FALSE))THEN (* Data link status of station number 63 *) (* Sets control data *) MOV(TRUE, 63, Var_ControlData[1]); (* Sets station number *) MOV(TRUE,H4, Var_ControlData[2]); (* Sets access code and attribute code *) MOV(TRUE, H400, Var_ControlData[3]);...
  • Page 168: Risend Instruction

    G_RISEND 5.3.4 RISEND instruction G_RISEND G(P)_RISEND P: Executing condition indicates any of the following instructions. Structured ladder G_RISEND G_RISEND GP_RISEND ENO:= (EN, Un*, s1, s2, d1, d2); G_RISEND Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 169 G_RISEND Control Data Device Item Setting data Setting range Setting side The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the station number of the intelligent device 0 to 64 User Station No.
  • Page 170 G_RISEND Program Example The following program writes 1-word data of D10 to the buffer memory address 111H of the number 63 intelligent device station (AJ65BT-R2(N)) which is connected to the master module mounted on the I/O numbers from X/Y00 to X/Y1F. The interlock signal storage settings are set to request device: RY4, completion device: RX4, error code storage device: RWr1, and completion mode: 1.
  • Page 171 G_RISEND [ST] IF((Var_Flag_Inst=TRUE) (* Write request ON *) &(Var_Flag_Exe=FALSE) (* Execution flag *) &(SW83.E=FALSE))THEN (* Data link status of station number 63 *) (* Sets control data *) MOV(TRUE, 63, Var_ControlData[1]); (* Sets station number *) MOV(TRUE, H4, Var_ControlData[2]); (* Sets access code and attribute code *) MOV(TRUE, H111, Var_ControlData[3]);...
  • Page 172: Rifr Instruction

    G_RIFR 5.3.5 RIFR instruction G_RIFR G(P)_RIFR P: Executing condition indicates any of the following instructions. Structured ladder G_RIFR GP_RIFR G_RIFR ENO:= (EN, Un*, n1, n2, n3, d); G_RIFR Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 173 G_RIFR Program Example The following program reads out 10-word data from buffer memory starting from the offset value 100 of the auto-refresh buffer of the master module (400H in the intelligent device station) and stores the data in the devices starting from D0 when X0 turns ON. (When the refresh device of the link special register (SW) is set to SW0.) Master module Intelligent device station...
  • Page 174: Rito Instruction

    G_RITO 5.3.6 RITO instruction G_RITO G(P)_RITO P: Executing condition indicates any of the following instructions. Structured ladder G_RITO GP_RITO G_RITO ENO:= (EN, Un*, n1, n2, n3, d); G_RITO Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 175 G_RITO Program Example The following program write 10-word data which are stored in the devices starting from D0 into buffer memory starting the offset value 100 of the auto-refresh buffer of the master module (400H in the intelligent device station) when X0 turns ON. (When the refresh device of the link special register (SW) is set to SW0.) Programmable controller Master module...
  • Page 176: Rlpaset Instruction

    G_RLPASET 5.3.7 RLPASET instruction G_RLPASET G(P)_RLPASET P: Executing condition indicates any of the following instructions. G_RLPASET GP_RLPASET Structured ladder G_RLPASET ENO:= (EN, Un*, s1, s2, s3, s4, s5, d); G_RLPASET Input argument Executing condition :Bit Un*: Start I/O number of the module :ANY16 (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 177 G_RLPASET Control Data Device Item Setting data Setting range Setting side The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the validity of each setting data from 0: Invalid 1: Valid b15 b14...
  • Page 178 G_RLPASET (1) Slave station setting data Device Item Setting data Setting range Setting side Set the slave station type, the number of occupied slave stations, and the station number as shown below. b12 b11 b8 b7 Station number – Number of occupied slave stations Type of slave station Default parameter setting is '0101...
  • Page 179 G_RLPASET (2) Reserved station specification data Device Item Setting data Setting range Setting side Specify the reserved station. 0: Not specified 1: Specified Specification for 1 to 64 s3 [0] User – stations s3 [1] s3 [2] s3 [3] 1 to 64 in the table indicates a station number. Default parameter setting is '0: Not specified' for all stations.
  • Page 180 G_RLPASET (4) Send/receive and auto-refresh buffer assignment data Device Item Setting data Setting range Setting side Specify the buffer memory size assignment at transient transmission for local stations and intelligent device stations. Send/receive buffer s5 [0] Send buffer size (no setting) s5 [1] Setting for the 1st module Receive buffer size...
  • Page 181 G_RLPASET [Structured ladder] Reads SB0040 to SB01FF Reads SW0040 to SW01FF Parameter setting command Clears completion status Sets all of setting flags to Valid Sets number of connected modules Sets number of retries Sets number of automatic return modules Sets operation specification when CPU is down to stop Sets scan mode specification to asynchronous...
  • Page 182 G_RLPASET [ST] FROM(TRUE, H0, H5E4, 28, K4SB40); (* Reads SB0040 to SB01FF *) FROM(TRUE, H0, H640, 448, SW40); (* Reads SW0040 to SW01FF*) IF((SM402=TRUE) & (SB6E=TRUE))THEN SET(TRUE, Var_Flag_Inst); (* Parameter setting command *) END_IF; IF(Var_Flag_Inst=TRUE)THEN (* Parameter setting command ON *) MOV(TRUE, 0, Var_ControlData[0]);...
  • Page 183: Cc-Link Ie Controller Network, Melsecnet/H, And Ethernet Instruction

    J_READ, G_READ CC-Link IE Controller Network, MELSECNET/H, and Ethernet Instruction 5.4.1 READ instruction J_READ, G_READ CC IE NET/H J(P)_READ P: Executing condition G(P)_READ indicates any of the following Structured ladder instructions. J_READ JP_READ J_READ G_READ G_READ GP_READ ENO:= (EN, Jn*, s1, s2, d1, d2); J_READ ENO:= (EN, Un*, s1, s2, d1, d2);...
  • Page 184 J_READ, G_READ Control Data Device Item Setting data Setting range Setting side Error completion type (bit 7) Specify the clock data setup status at the time of error completion. 0001 User Error completion type 0: Clock data at the time of error completion is not set in the area 0081 starting from [11].
  • Page 185 J_READ, G_READ Device Item Setting data Setting range Setting side Specify the monitoring time required for the instruction completion. If the instruction is not completed within this time, it is resent by the number of times specified in [7]. Description Setting value 0 to TCP retransmission timer value: Monitoring is...
  • Page 186 J_READ, G_READ Program Example The following program reads out data from the devices from D250 to D254 in the station number 4 (target station) and stores the data to the devices from D700 to D704 of the station number 1 (host station).
  • Page 187 J_READ, G_READ [ST] IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H81,Var_ControlData[0]); (* Sets error completion type *) MOV(TRUE,K1,Var_ControlData[2]); (* Sets channel used by host station *) MOV(TRUE,H0,Var_ControlData[3]); (* Sets target station's CPU type *) MOV(TRUE,K1,Var_ControlData[4]); (* Sets target station network number *) MOV(TRUE,K4,Var_ControlData[5]); (* Sets target station number *) MOV(TRUE,K0,Var_ControlData[6]);...
  • Page 188: Sread Instruction

    J_SREAD, G_SREAD 5.4.2 SREAD instruction J_SREAD, G_SREAD CC IE NET/H J(P)_SREAD P: Executing condition G(P)_SREAD indicates any of the following instructions. Structured ladder J_SREAD JP_SREAD J_SREAD G_SREAD G_SREAD GP_SREAD ENO:= (EN, Jn*, s1, s2, d1, d2, d3); J_SREAD ENO:= (EN, Un*, s1, s2, d1, d2, d3); G_SREAD Input argument Executing condition...
  • Page 189 J_SREAD, G_SREAD Function This instruction reads data from a word device of another station. Control Data For the control data of the SREAD instruction that reads the word device memory of another station, refer to READ instruction. The control data of the SREAD instruction are the same as those of the READ instruction. Accordingly, this section omits the explanation.
  • Page 190 J_SREAD, G_SREAD Program Example The following program example of the SREAD instruction is different from that of the READ instruction by assigning the read notification device at the end of arguments. [Structured ladder] Sets error completion type Sets channel used by host station Sets target station's CPU type...
  • Page 191 J_SREAD, G_SREAD [ST] IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H81,Var_ControlData[0]); (* Sets error completion type *) MOV(TRUE,K1,Var_ControlData[2]); (* Sets channel used by host station *) MOV(TRUE,H0,Var_ControlData[3]); (* Sets target station's CPU type *) MOV(TRUE,K1,Var_ControlData[4]); (* Sets target station network number *) MOV(TRUE,K4,Var_ControlData[5]); (* Sets target station number*) MOV(TRUE,K0,Var_ControlData[6]);...
  • Page 192: Write Instruction

    J_WRITE, G_WRITE 5.4.3 WRITE instruction J_WRITE, G_WRITE CC IE NET/H J(P)_WRITE P: Executing condition G(P)_WRITE indicates any of the following instructions. Structured ladder J_WRITE JP_WRITE J_WRITE G_WRITE G_WRITE GP_WRITE ENO:= (EN, Jn*, s1, s2, d1, d2); J_WRITE ENO:= (EN, Un*, s1, s2, d1, d2); G_WRITE Input argument Executing condition...
  • Page 193 J_WRITE, G_WRITE Control Data Device Item Setting data Setting range Setting side Execution type (bit 0) 0: Without arrival confirmation When the target station is on the same network... Completed when data are sent from the host station. Completed Execution source Target station When the target station is on another network ..
  • Page 194 J_WRITE, G_WRITE Device Item Setting data Setting range Setting side Error completion type (bit 7) Specify the clock data setup status at the time of error completion. 0000 0: Clock data at the time of error completion is not set in the area Execution/Error completion 0001 User...
  • Page 195 J_WRITE, G_WRITE Device Item Setting data Setting range Setting side Specify the station number of the target station. (1) Station number specification Ethernet 1 to 64 MELSECNET/H Universal model QCPU 1 to 120 CC-Link IE controller network High Performance model QCPU 1 to 64 To increase the data reliability when the station number is specified, executing the instruction with setting Execution/Error completion type [0]) to '1: With arrival confirmation' is recommended.
  • Page 196 J_WRITE, G_WRITE Device Item Setting data Setting range Setting side Specify the number of write data. Description Setting value Ethernet 1 to 960 User Write data length MELSECNET/H 1 to 960 Writing to the QCPU CC-Link IE (word) controller network (Reserved) –...
  • Page 197 J_WRITE, G_WRITE Program Example The following program writes data which are stored in the devices from D750 to D753 of the station number 2 (host station) to the devices from D300 to D303 of the station number 3 (target station). [Structured ladder] Sets execution/error completion type...
  • Page 198 J_WRITE, G_WRITE [ST] IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H81,Var_ControlData[0]); (* Sets execution/error completion type *) MOV(TRUE,K2,Var_ControlData[2]); (* Sets channel used by host station *) MOV(TRUE,H0,Var_ControlData[3]); (* Sets target station's CPU type *) MOV(TRUE,K1,Var_ControlData[4]); (* Sets target station network number *) MOV(TRUE,K3,Var_ControlData[5]); (* Sets target station number *) MOV(TRUE,K0,Var_ControlData[6]);...
  • Page 199: Swrite Instruction

    J_SWRITE, G_SWRITE 5.4.4 SWRITE instruction J_SWRITE, G_SWRITE CC IE NET/H J(P)_SWRITE P: Executing condition G(P)_SWRITE indicates any of the following instructions. Structured ladder J_SWRITE JP_SWRITE J_SWRITE G_SWRITE G_SWRITE GP_SWRITE ENO:= (EN, Jn*, s1, s2, d1, d2, d3); J_SWRITE ENO:= (EN, Un*, s1, s2, d1, d2, d3); G_SWRITE Input argument Executing condition...
  • Page 200 J_SWRITE, G_SWRITE Function This instruction writes data to a word device of another station. Control Data For the control data of the SWRITE instruction that writes data to the word device memory of another station, refer to WRITE instruction. The control data of the SWRITE instruction are the same as those of the WRITE instruction. Accordingly, this section omits the explanation.
  • Page 201 J_SWRITE, G_SWRITE Program Example The following program example of the SWRITE instruction is different from that of the WRITE instruction by assigning the write notification device at the end of arguments. [Structured ladder] (1) Program on the request source (station number 2) of the SWRITE instruction Sets execution/error completion type Sets channel used by host station...
  • Page 202 J_SWRITE, G_SWRITE (2) Program on the request target (station number 3) of the SWRITE instruction Stores data of devices from D300 to D303 to devices from D500 to D503 [ST] (1) Program on the request source (station number 2) of the SWRITE instruction IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H81,Var_ControlData[0]);...
  • Page 203: Send Instruction

    J_SEND, G_SEND 5.4.5 SEND instruction J_SEND, G_SEND CC IE NET/H J(P)_SEND P: Executing condition G(P)_SEND indicates any of the following instructions. Structured ladder J_SEND JP_SEND J_SEND G_SEND G_SEND GP_SEND ENO:= (EN, Jn*, s1, s2, d); J_SEND ENO:= (EN, Un*, s1, s2, d); G_SEND Input argument Executing condition...
  • Page 204 J_SEND, G_SEND Control Data Device Item Setting data Setting range Setting side Execution type (bit 0) 0: Without arrival confirmation When the target station is on the same network... Completed when data are sent from the host station. Completed Execution source Target station When the target station is on another network ..
  • Page 205 J_SEND, G_SEND Device Item Setting data Setting range Setting side Error completion type (bit 7) Specify the clock data setup status at the time of error completion. 0000 0: Clock data at the time of error completion is not set in the area Execution/Error completion 0001 User...
  • Page 206 J_SEND, G_SEND Device Item Setting data Setting range Setting side Specify the monitoring time required for instruction completion. (Setting is available when Execution type is set to '1: With arrival confirmation' [0].) If the instruction is not completed within this time, it is resent by the number of times specified in [7].
  • Page 207 J_SEND, G_SEND Program Example The following program sends data of the devices from D750 to D753 of the station number 1 (host station) to the channel 5 of the station number 2 (target station). For the method for reading the data, which are sent by the SEND instruction, from the channel 5 of the station number 2 (target station), refer to the following sections.
  • Page 208 J_SEND, G_SEND [Structured ladder] Sets execution/error completion type Sets channel used by host station Sets target station channel Sets target station network number Sets target station number Sets number of resends Sets monitoring time Sets data length by the word Sets send data to D750 to D753 Sends data...
  • Page 209 J_SEND, G_SEND [ST] IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H81,Var_ControlData[0]); (* Sets execution/error completion type *) MOV(TRUE,K3,Var_ControlData[2]); (* Sets channel used by host station *) MOV(TRUE,H5,Var_ControlData[3]); (* Sets target station channel *) MOV(TRUE,K1,Var_ControlData[4]); (* Sets target station network number *) MOV(TRUE,K2,Var_ControlData[5]); (* Sets target station number *) MOV(TRUE,K0,Var_ControlData[6]);...
  • Page 210 J_RECV, G_RECV 5.4.6 RECV instruction J_RECV, G_RECV CC IE NET/H J(P)_RECV P: Executing condition G(P)_RECV indicates any of the following instructions. Structured ladder J_RECV JP_RECV J_RECV G_RECV G_RECV GP_RECV ENO:= (EN, Jn*, s, d1, d2); J_RECV ENO:= (EN, Un*, s, d1, d2); G_RECV Input argument Executing condition...
  • Page 211 J_RECV, G_RECV Control Data Device Item Setting data Setting range Setting side Error completion type (bit 7) 0000 Specify the clock data setup status at the time of error completion. User Error completion type 0080 0: Clock data at the time of error completion is not set in the area starting from [11].
  • Page 212: 5.4.6 Recv Instruction

    J_RECV, G_RECV Device Item Setting data Setting range Setting side Clock data at the time of error completion are stored in BCD format. b8 b7 [12] Year (00 to 99 ) Last two digits [12 ] Month (01 to 12 Clock data at the time of System –...
  • Page 213 J_RECV, G_RECV Program Example The following program reads out data, which is sent from the station number 1 by the SEND instruction, from the channel 5 of the station number 2 (host station) and stores the data to the devices from D770 to D773 of the station number 2 (host station) when SB0034 turns ON. For the SEND instruction, refer to the following section.
  • Page 214 J_RECV, G_RECV [ST] IF (LDP(TRUE,SM400)) THEN MOV(TRUE,H80,Var_ControlData[0]); (* Sets error completion type *) MOV(TRUE,K5,Var_ControlData[2]); (* Sets host station channel *) MOV(TRUE,K0,Var_ControlData[6]); MOV(TRUE,K0,Var_ControlData[7]); MOV(TRUE,K0,Var_ControlData[8]); (* Sets arrival monitoring time *) MOV(TRUE,K0,Var_ControlData[10]); END_IF; IF((SB34=TRUE) AND (SB47=FALSE)) THEN JP_RECV(TRUE,1,Var_ControlData,D770,Var_Result);(* Performs readout *) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) (* Process on completion of readout *)
  • Page 215: Recvs Instruction

    Z_RECVS 5.4.7 RECVS instruction Z_RECVS CC IE NET/H Z_RECVS indicates the following instruction. Z_RECVS Structured ladder Z_RECVS ENO:= (EN, Un*, s, d1, d2); Z_RECVS Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..9]...
  • Page 216 Z_RECVS Control Data Device Item Setting data Setting range Setting side User Completion type 0 (Fixed) The instruction completion status is stored. : Normal completion System Completion status – Other than 0 : Error completion (error code) Specify the channel of host station that stores receive data. Host station channel 1 to 8 User...
  • Page 217 Z_RECVS [ST] IF (LDP(TRUE,SM400)=TRUE) THEN MOV(TRUE,H0,Var_ControlData[0]); (* Sets execution/error completion type *) MOV(TRUE,K5,Var_ControlData[2]); (* Sets host station channel *) Z_RECVS(TRUE,"U0",Var_ControlData,D770,Var_Dummy); (* Performs readout *) (* Process on completion of readout *) END_IF; 5.4 CC-Link IE Controller Network, MELSECNET/H, and Ethernet Instruction 5-171 5.4.7 RECVS instruction...
  • Page 218: Req Instruction

    J_REQ, G_REQ 5.4.8 REQ instruction J_REQ, G_REQ CC IE NET/H J(P)_REQ P: Executing condition G(P)_REQ indicates any of the following instructions. Structured ladder J_REQ JP_REQ J_REQ G_REQ G_REQ GP_REQ ENO:= (EN, Jn*, s1, s2, d1, d2); J_REQ ENO:= (EN, Un*, s1, s2, d1, d2); G_REQ Input argument Executing condition...
  • Page 219 J_REQ, G_REQ Control Data Device Item Setting data Setting range Setting side Error completion type (bit 7) 0011 Specify the clock data setup status at the time of error completion. User Error completion type 0091 0: Clock data at the time of error completion is not set in the area starting from [11].
  • Page 220 J_REQ, G_REQ Device Item Setting data Setting range Setting side User (Fixed value) – For instruction execution 0 to 15 User Specify the number of resends when the instruction is not completed Number of resends within the monitoring time specified in [8].
  • Page 221 J_REQ, G_REQ Device Item Setting data Setting range Setting side Number of the station where an error was detected is stored. (However, when an error was detected at the host station, the network number is not stored.) Error-detected station No. System Ethernet –...
  • Page 222 J_REQ, G_REQ (1) Remote RUN/STOP Request data (all set by the user) Remote Remote Device Item Description STOP 0010 : When station number is specified in Request type 0030 : When all stations a group is specified in 0001 : Remote RUN Sub-request type 0002 : Remote STOP...
  • Page 223 J_REQ, G_REQ (2) Reading/writing the clock data Request data (all set by the user (indicated by Read Write Device Item Setting data clock data clock data 0001 : Clock data read 0011 : Clock data write (When station number is specified in Request type [5]) 0031...
  • Page 224 J_REQ, G_REQ Response data (all set by the system (indicated by Read Write Device Item Setting data clock data clock data 0081 : Clock data read 0091 : Clock data write (When station number is specified in [5]) Request type 00B1 : Clock data write (When all stations or a group is specified in...
  • Page 225 J_REQ, G_REQ Program Example The following program performs remote STOP to the QCPU, which is the station number 2 (target station). [Structured ladder] Sets execution/error completion type Sets channel used by host station Sets target station's CPU type Sets target station network number Sets target station number...
  • Page 226 J_REQ, G_REQ [ST] IF (LDP(TRUE,Var_Flag_Inst)) THEN MOV(TRUE,H91,Var_ControlData[0]); (* Sets execution/error completion type *) MOV(TRUE,K3,Var_ControlData[2]); (* Sets channel used by host station *) MOV(TRUE,H0,Var_ControlData[3]); (* Sets target station's CPU type *) MOV(TRUE,K1,Var_ControlData[4]); (* Sets target station network number *) MOV(TRUE,K2,Var_ControlData[5]); (* Sets target station number *) MOV(TRUE,K0,Var_ControlData[6]);...
  • Page 227: Rrun Instruction

    Z_RRUN_J, Z_RRUN_U 5.4.9 RRUN instruction Z_RRUN_J, Z_RRUN_U CC IE NET/H Z(P)_RRUN_J P: Executing condition Z(P)_RRUN_U indicates any of the following Structured ladder instructions. Z_RRUN_J Z_RRUN_U Z_RRUN_J ZP_RRUN_J Z_RRUN_U ZP_RRUN_U ENO:= (EN, Jn*, n1, n2, n3, n4, d); Z_RRUN_J ENO:= (EN, Un*, n1, n2, n3, n4, d); Z_RRUN_U Input argument Executing condition...
  • Page 228 Z_RRUN_J, Z_RRUN_U Function This instruction remotely switches a CPU module on another station to RUN. Precautions This instruction is applicable to the QJ71LP21 or QJ71BR11 with the function version B or later. Program Example The following program remotely switches the QCPU on the station number 2 (target station) to RUN.
  • Page 229: Rstop Instruction

    Z_RSTOP_J, Z_RSTOP_U 5.4.10 RSTOP instruction Z_RSTOP_J, Z_RSTOP_U CC IE NET/H Z(P)_RSTOP_J P: Executing condition Z(P)_RSTOP_U indicates any of the following Structured ladder instructions. Z_RSTOP_J Z_RSTOP_U Z_RSTOP_J ZP_RSTOP_J Z_RSTOP_U ZP_RSTOP_U ENO:= (EN, Jn*, n1, n2, n3, n4, d); Z_RSTOP_J ENO:= (EN, Un*, n1, n2, n3, n4, d); Z_RSTOP_U Input argument Executing condition...
  • Page 230 Z_RSTOP_J, Z_RSTOP_U Function This instruction remotely switches a CPU module on another station to STOP. Precautions This instruction is applicable to the QJ71LP21 or QJ71BR11 with the function version B or later. Program Example The following program remotely switches the QCPU on the station number 2 (target station) to STOP.
  • Page 231: Rtmrd Instruction

    Z_RTMRD_J, Z_RTMRD_U 5.4.11 RTMRD instruction Z_RTMRD_J, Z_RTMRD_U CC IE NET/H Z(P)_RTMRD_J P: Executing condition Z(P)_RTMRD_U indicates any of the following Structured ladder instructions. Z_RTMRD_J ZP_RTMRD_J Z_RTMRD_J Z_RTMRD_U Z_RTMRD_U ZP_RTMRD_U ENO:= (EN, Jn*, n1, n2, n3, d1, d2); Z_RTMRD_J ENO:= (EN, Un*, n1, n2, n3, d1, d2); Z_RTMRD_U Input argument Executing condition...
  • Page 232 Z_RTMRD_J, Z_RTMRD_U Function This instruction reads clock data from a CPU module on another station. Precautions This instruction is applicable to the QJ71LP21 or QJ71BR11 with the function version B or later. Program Example The following program reads out clock data from the QCPU on the station number 2 (target station) and stores the clock data in the station number 1 (host station).
  • Page 233: Rtmwr Instruction

    Z_RTMWR_J, Z_RTMWR_U 5.4.12 RTMWR instruction Z_RTMWR_J, Z_RTMWR_U NET/H Z(P)_RTMWR_J P: Executing condition Z(P)_RTMWR_U indicates any of the following Structured ladder instructions. Z_RTMWR_J ZP_RTMWR_J Z_RTMWR_J Z_RTMWR_U Z_RTMWR_U ZP_RTMWR_U ENO:= (EN, Jn*, n1, n2, n3, d1, d2); Z_RTMWR_J ENO:= (EN, Un*, n1, n2, n3, d1, d2); Z_RTMWR_U Input argument Executing condition...
  • Page 234 Z_RTMWR_J, Z_RTMWR_U Precautions This instruction is applicable to the QJ71LP21 or QJ71BR11 with the function version B or later. Program Example The following program writes the clock data (8:30:00) to all stations on the network number 1. [Structured ladder] Sets clock data Writes clock data to other stations Process on completion of writing...
  • Page 235 Z_RTMWR_J, Z_RTMWR_U [ST] IF(LDP(TRUE,Var_Flag_Inst))THEN MOV(TRUE,H38,Var_ClockData[0]); (* Sets clock data *) MOV(TRUE,H0,Var_ClockData[1]); MOV(TRUE,H8,Var_ClockData[2]); MOV(TRUE,H3000,Var_ClockData[3]); MOV(TRUE,H0,Var_ClockData[4]); END_IF; IF((Var_Flag_Exe=TRUE) AND (SB47=FALSE) AND (SB0A0=FALSE)) THEN ZP_RTMWR_J(TRUE,"J1",K5,H0FF,H3FF,Var_ClockData,Var_Result); (* Writes clock data to other stations*) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) (* Process on completion of writing *) IF(Var_Result[1]=FALSE)THEN (* Normal completion *) (* Process on normal completion *)
  • Page 236: Remfr Instruction

    Z_REMFR 5.4.13 REMFR instruction Z_REMFR NET/H Z(P)_REMFR P: Executing condition indicates any of the following Structured ladder instructions. Z_REMFR ZP_REMFR Z_REMFR ENO:= (EN, Jn*, n1, n2, n3, n4, n5, d1, d2); Z_REMFR Input argument Executing condition :Bit Jn*: Network number of the host station :String Channel number :ANY16...
  • Page 237 Z_REMFR Function This instruction reads data from the buffer memory of an intelligent function module on the remote I/O station. Program Example The following program reads digital output values. [Structured ladder] Reads data from buffer memory Reads CH1 digital value Reads CH2 digital value Reads CH3 digital...
  • Page 238: Remto Instruction

    Z_REMTO 5.4.14 REMTO instruction Z_REMTO NET/H Z(P)_REMTO P: Executing condition indicates any of the following Structured ladder instructions. Z_REMTO ZP_REMTO Z_REMTO ENO:= (EN, Jn*, n1, n2, n3, n4, n5, d1, d2); Z_REMTO Input argument Executing condition :Bit Jn*: Network number of the host station :String Channel number :ANY16...
  • Page 239 Z_REMTO Function This instruction writes data to the buffer memory of an intelligent function module on the remote I/ O station. Program Example The following program makes the A/D conversion enable setting on channels. [Structured ladder] A/D Conversion enable/disable setting CH2 time/count averaging setting CH3 time/count...
  • Page 240 Z_REMTO [ST] IF(Var_Flag_Inst=TRUE)THEN MOV(TRUE,H8,D0); (* A/D Conversion enable/disable setting *) MOV(TRUE,K50,D2); (* CH2 time/count averaging setting *) MOV(TRUE,K1000,D3); (* CH3 time/count averaging setting *) MOV(TRUE,H604,D9); (* Averaging processing specification *) ZP_REMTO(TRUE,"J1",K1,K1,H2,H0,K10,D0,Var_Result); (* Writes data to buffer memory *) END_IF; IF((Var_Result[0]=TRUE) AND (Var_Result[1]=FALSE))THEN SET(TRUE,Y1029);...
  • Page 241: Open Instruction

    ZP_OPEN 5.4.15 OPEN instruction ZP_OPEN ZP_OPEN Executing condition indicates the following instruction. Structured ladder ZP_OPEN ZP_OPEN ENO:= (EN, Un*, s1, s2, d); ZP_OPEN Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Connection number (1 to 16) :ANY16...
  • Page 242 ZP_OPEN Control Data Device Item Setting data Setting range Setting side Specify whether to use the parameter values set by GX Works2 or the setting values of the following control data ( [2] to ) at open Execution type/ 0000 User processing of a connection.
  • Page 243 ZP_OPEN Program Example The following program opens the connection 1 for TCP/IP communication using the Active open process. (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) [Structured ladder] Open request signal Connection 1 open request signal Turns execution flag ON when instruction flag is ON Execution type when...
  • Page 244 ZP_OPEN [ST] IF(SM400=TRUE)THEN (* Always ON *) MOV(TRUE,U0\G20480,K4M0); (* Open completed signal/connection 1 open completion signal *) MOV(TRUE,U0\G20482,K4M20); (* Open request signal/connection 1 open request signal *) END_IF; IF(Var_Flag_Inst=TRUE)THEN (* When instruction flag is ON*) PLS(TRUE,Var_Flag_Exe); (* Turns execution flag ON *) END_IF;...
  • Page 245: Close Instruction

    ZP_CLOSE 5.4.16 CLOSE instruction ZP_CLOSE ZP_CLOSE Executing condition indicates the following instruction. Structured ladder ZP_CLOSE ZP_CLOSE ENO:= (EN, Un*, s1, s2, d); ZP_CLOSE Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Connection number (1 to 16) :ANY16...
  • Page 246 ZP_CLOSE Program Example The following program closes the connection 1. (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) [Structured ladder] Connection 1 close timing Closing connection 1 from external device Close instruction 1PLS Closes connection Turns execution flag ON Turns normal completion flag ON...
  • Page 247 ZP_CLOSE [ST] IF(Var_Flag_Open=TRUE)THEN (* Connection 1 open completion signal *) PLF(TRUE,Var_Flag_CloseTiming); (* Connection 1 close timing *) END_IF; IF((Var_Flag_CloseTiming=TRUE) AND (Var_Flag_OpenOK=TRUE))THEN (* Connection 1 close timing/open instruction normal completion *) PLS(TRUE,Var_Flag_Close); (* Closing connection from external device *) END_IF; IF(Var_Flag_Inst=TRUE)THEN (* Close instruction *) PLS(TRUE,Var_Flag_Inst2);...
  • Page 248: Bufrcv Instruction

    ZP_BUFRCV 5.4.17 BUFRCV instruction ZP_BUFRCV ZP_BUFRCV Executing condition indicates the following instruction. Structured ladder ZP_BUFRCV ZP_BUFRCV ENO:= (EN, Un*, s1, s2, d1, d2); ZP_BUFRCV Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Connection number (1 to 16) :ANY16...
  • Page 249 ZP_BUFRCV Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Receive Data Device Item Setting data Setting range...
  • Page 250 ZP_BUFRCV Program Example The following program reads out receive data from the fixed buffer of the connection 1. (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) [Structured ladder] Connection 1 open completion signal Connection 1 open request signal Fixed buffer 1 receive status signal Receive...
  • Page 251 ZP_BUFRCV [ST] IF(SM400=TRUE)THEN (* Always ON *) MOV(TRUE,U0\G20480,K4M0); (* Open completion signal/connection 1 open completion signal *) MOV(TRUE,U0\G20482,K4M20); (* Open request signal/connection 1 open request signal *) MOV(TRUE,U0\G20485,K4M40); (* Fixed buffer receive status signal/fixed buffer 1 receive status signal *) END_IF;...
  • Page 252: Bufrcvs Instruction

    Z_BUFRCVS 5.4.18 BUFRCVS instruction Z_BUFRCVS Z_BUFRCVS indicates the following instruction. Structured ladder Z_BUFRCVS Z_BUFRCVS ENO:= (EN, Un*, s, d); Z_BUFRCVS Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Connection number (1 to 16) :ANY16...
  • Page 253 Z_BUFRCVS Function This instruction reads receive data from external device in fixed buffer communication. This instruction is used in an interrupt program. Receive Data Device Item Setting data Setting range Setting side Data length of the data read from the fixed buffer data area is stored. (Data length becomes the number of words or the number of bytes –...
  • Page 254: Bufsnd Instruction

    ZP_BUFSND 5.4.19 BUFSND instruction ZP_BUFSND ZP_BUFSND Executing condition indicates the following instruction. Structured ladder ZP_BUFSND ZP_BUFSND ENO:= (EN, Un*, s1, s2, s3, d1); ZP_BUFSND Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Connection number (1 to 16) :ANY16...
  • Page 255 ZP_BUFSND Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) (1) Send data Device Item Setting data...
  • Page 256 ZP_BUFSND Program Example The following program sends data from the fixed buffer of the connection 1. (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) [Structured ladder] Send instruction 1PLS Sets data length (number of words) Sets send data Sends data in fixed buffer communication...
  • Page 257 ZP_BUFSND [ST] IF((X19=TRUE) AND (Var_Flag_Open=TRUE))THEN (* Initialization normal completion signal/connection 1 open completion signal*) PLS(TRUE,Var_Flag_Inst); (* Send instruction 1PLS *) END_IF; IF(Var_Flag_Inst=TRUE)THEN (* Send instruction 1PLS *) MOV(TRUE,K3,D300); (* Sets data length (number of words) *) MOV(TRUE,K1234,D301); (* Sets send data *) MOV(TRUE,K5678,D302);...
  • Page 258: Errclr Instruction

    ZP_ERRCLR 5.4.20 ERRCLR instruction ZP_ERRCLR ZP_ERRCLR Executing condition indicates the following instruction. Structured ladder ZP_ERRCLR ZP_ERRCLR ENO:= (EN, Un*, s, d); ZP_ERRCLR Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..7]...
  • Page 259 ZP_ERRCLR Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the error information to be cleared. 0000 : Initial error code 0001...
  • Page 260 ZP_ERRCLR [ST] IF((Var_Flag_Inst=TRUE) AND (Var_Flag_Exe=FALSE))THEN MOVP(TRUE,H1,Var_ControlData[2]); (* Sets clear target *) MOVP(TRUE,H0,Var_ControlData[3]); (* Sets clear function *) SET(TRUE,Var_Flag_Exe); (* Turns execution flag ON *) END_IF; IF(Var_Flag_Exe=TRUE)THEN ZP_ERRCLR(TRUE,"U0",Var_ControlData,Var_Result); (* Clears error information *) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) IF(Var_Result[1]=FALSE)THEN (* Normal completion *) MOVP(TRUE,K0,Var_ErrorCode);...
  • Page 261: Errrd Instruction

    ZP_ERRRD 5.4.21 ERRRD instruction ZP_ERRRD ZP_ERRRD Executing condition indicates the following instruction. Structured ladder ZP_ERRRD ZP_ERRRD ENO:= (EN, Un*, s, d); ZP_ERRRD Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..7]...
  • Page 262 ZP_ERRRD Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Specify the error information to be read. : Initial error code Read information User...
  • Page 263 ZP_ERRRD [ST] IF((LDP(TRUE,Var_Flag_Inst)=TRUE) AND (Var_Flag_Exe=FALSE))THEN MOVP(TRUE,H1,Var_ControlData[2]); (* Sets open error code of connection number 1 *) MOVP(TRUE,H0,Var_ControlData[3]); (* Sets latest error information *) SET(TRUE,Var_Flag_Exe); (* Turns execution flag ON*) END_IF; IF(Var_Flag_Exe=TRUE)THEN ZP_ERRRD(TRUE,"U0",Var_ControlData,Var_Result); (* Reads error information *) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) IF(Var_Result[1]=FALSE)THEN(* Normal completion *) MOVP(TRUE,Var_ControlData[4],Var_ErrorInfo);...
  • Page 264: Uini Instruction

    Z_UINI 5.4.22 UINI instruction Z_UINI CC IE Z(P)_UINI P: Executing condition indicates any of the following Structured ladder instructions. Z_UINI ZP_UINI Z_UINI ENO:= (EN, Un*, s, d); Z_UINI Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 265 Z_UINI Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status : Normal completion System – Other than 0 : Error completion (error code) Ethernet Specify the parameter to be modified. b2 b1 b0 Modification specification of host station IP address Specify whether the host station IP address is modified or not.
  • Page 266 Z_UINI Program Example The following program sets the station number 2. [Structured ladder] Sets change target Sets host station number Performs reinitialization Execution finished Process on completion Normal completion Process on normal completion Process on error completion Error completion Stores error code [ST] IF(LDP(TRUE,Var_Flag_Inst)=TRUE)THEN MOV(TRUE,H1,Var_ControlData[2]);...
  • Page 267: Mrecv Instruction

    ZP_MRECV 5.4.23 MRECV instruction ZP_MRECV ZP_MRECV Executing condition indicates the following instruction. Structured ladder ZP_MRECV ZP_MRECV ENO:= (EN, Un*, s, d1, d2); ZP_MRECV Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..15]...
  • Page 268 ZP_MRECV Control Data Device Item Setting data Setting range Setting side b10 b9 Execution type (bit 9) Specify whether to inquire about existence of mails in the server after reading received mails. 0000 0: Not requested (not read) 0080 Execution/Error completion 1: Requested (read) User 0200...
  • Page 269 ZP_MRECV Device Item Setting data Setting range Setting side Clock data at the time of error completion are stored in BCD format. b8 b7 [12] Year (00 to 99 ) Last two digits [12 ] Month (01 to 12 Clock data (set only when System –...
  • Page 270 ZP_MRECV Program Example The following program performs the e-mail receiving process by the receive instruction (X21). (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) [Structured ladder] Sets to inquire to server Sets to read the first mail Sets to adjust data length to that of the received mail...
  • Page 271 ZP_MRECV [ST] IF(LDP(TRUE,X21)=TRUE)THEN SET(TRUE,Var_Flag_Exe); END_IF; IF((Var_Flag_Exe=TRUE) AND (U0\G9858.F=TRUE))THEN MOVP(TRUE,H200,Var_ControlData[0]); (* Sets to inquire to server *) MOVP(TRUE,K0,Var_ControlData[2]); (* Sets to read the first mail *) MOVP(TRUE,K0,Var_ControlData[9]); (* Sets to adjust data length to that of the received mail *) MOVP(TRUE,K0,Var_ControlData[10]); (* Sets to adjust header data length to that of the received mail *) ZP_MRECV(TRUE,"U0",Var_ControlData,D100,Var_Result);...
  • Page 272: Msend Instruction

    ZP_MSEND 5.4.24 MSEND instruction ZP_MSEND ZP_MSEND Executing condition indicates the following instruction. Structured ladder ZP_MSEND ZP_MSEND ENO:= (EN, Un*, s1, s2, d); ZP_MSEND Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..15]...
  • Page 273 ZP_MSEND Control Data Device Item Setting data Setting range Setting side Error completion type (bit 7) Specify the clock data setup status at the time of error completion. 0: Clock data at the time of error completion is not set in the area starting from [11].
  • Page 274 ZP_MSEND Device Item Setting data Setting range Setting side Valid/invalid status of the data in the area starting from [12] is stored. System Clock set flag – [11] 0: Invalid 1: Valid Clock data at the time of error completion are stored in BCD format. b8 b7 [12] [12 ]...
  • Page 275 ZP_MSEND Program Example The following program performs e-mail sending process by the send instruction (X20). (The I/O signals of the Ethernet module are X/Y00 to X/Y1F) (1) Sending the data as an attached file Sets ASCII as send data format Sets transmission destination number Sets send data...
  • Page 276 ZP_MSEND [ST] IF(X20=TRUE)THEN MOVP(TRUE,H800,Var_ControlData[0]); (* Sets ASCII as send data format *) MOVP(TRUE,K1,Var_ControlData[2]); (* Sets transmission destination number *) MOVP(TRUE,K10,Var_ControlData[9]); (* Sets send data length *) MOVP(TRUE,K7,Var_ControlData[10]); (* Sets subject length *) Int_Msg[0] := H6574; (* te *) Int_Msg[1] := H7473; (* st *) Int_Msg[2] := H616d;...
  • Page 277 ZP_MSEND (2) Sending the data as a text [Structured ladder] Sets text as send data format Sets transmission destination number Sets send data length Sets subject length Sets subject Sets text Sends e-mail Process on normal completion Normal completion Error completion Process on error completion 5.4 CC-Link IE Controller Network, MELSECNET/H, and Ethernet Instruction 5-231...
  • Page 278 ZP_MSEND [ST] IF(X20=TRUE)THEN MOVP(TRUE,H1000,Var_ControlData[0]); (* Sets text as send data format *) MOVP(TRUE,K1,Var_ControlData[2]); (* Sets transmission destination number *) MOVP(TRUE,K16,Var_ControlData[9]); (* Sets send data length *) MOVP(TRUE,K7,Var_ControlData[10]); (* Sets subject length *) Int_Msg[0] := H6574; (* te *) Int_Msg[1] := H7473; (* st *) Int_Msg[2] := H616d;...
  • Page 279: Positioning Instruction

    Z_ABRST1 Positioning Instruction 5.5.1 ABRST instruction Z_ABRST1 Z_ABRST1 Z_ABRST2 Executing condition: Z_ABRST3 Z_ABRST4 indicates any of the following instructions. Structured ladder Z_ABRST1 Z_ABRST1 Z_ABRST2 ENO:= (EN, Un*, s,d); Z_ABRST1 Z_ABRST3 Z_ABRST4 Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 280 Z_ABRST1 Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status • 0 : Normal completion System – • Other than 0 : Error completion (error code) Write the following signal status read from the servo amplifier to the input module.
  • Page 281 Z_ABRST1 Program Example The following program restores the absolute position of the axis 1. The devices from X47 to X49 and from Y50 to Y52 are used for the communication with the servo amplifier. X47: ABS data bit0 X48: ABS data bit1 X49: Send data READY flag Y50: Servo ON Y51: ABS transfer mode...
  • Page 282 Z_ABRST1 [ST] IPLS(SM400, Var_Flag_Inst); (* Absolute position restoration pulse *) IF((Var_Flag_Inst=TRUE) & (X0=FALSE))THEN SET(TRUE, Var_Flag_Mem); (* Turns absolute position restoration memory ON *) MOV(TRUE, 0, Var_ControlData[4]); (* Clears completion status *) END_IF; IF(Var_Result[0]=TRUE)THEN (* Execution finished *) IF(Var_Result[1]=FALSE)THEN (* Normal completion *) MOV(TRUE, Var_ControlData[3], K1Y50);...
  • Page 283: Pstrt Instruction

    ZP_PSTRT1 5.5.2 PSTRT instruction ZP_PSTRT1 ZP_PSTRT1 ZP_PSTRT2 Executing condition : ZP_PSTRT3 ZP_PSTRT4 indicates any of the following instructions. Structured ladder ZP_PSTRT1 ZP_PSTRT1 ZP_PSTRT2 ENO:= (EN, Un*, s,d); ZP_PSTRT1 ZP_PSTRT3 ZP_PSTRT4 Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 284 ZP_PSTRT1 Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status • 0 : Normal completion System – • Other than 0 : Error completion (error code) Specify the following data number to be started by the PSTRT instruction.
  • Page 285: Teach Instruction

    ZP_TEACH1 5.5.3 TEACH instruction ZP_TEACH1 ZP_TEACH1 ZP_TEACH2 Executing condition : ZP_TEACH3 ZP_TEACH4 indicates any of the following instructions. Structured ladder ZP_TEACH1 ZP_TEACH1 ZP_TEACH2 ENO:= (EN, Un*, s,d); ZP_TEACH1 ZP_TEACH3 ZP_TEACH4 Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits)
  • Page 286 ZP_TEACH1 Control Data Device Item Setting data Setting range Setting side System area – – – The instruction completion status is stored. Completion status • 0 : Normal completion System – • Other than 0 : Error completion (error code) Set the address (positioning address/circular address) to which the current feed value is written.
  • Page 287 ZP_TEACH1 Program Example The following program performs teaching for the positioning data number 3 of the axis 1 when X39 turns ON. [Structured ladder] Teaching instruction pulse Turns teaching instruction memory ON Sets teaching data Sets positioning data number Performs teaching Turns teaching instruction memory OFF [ST]...
  • Page 288: Pfwrt Instruction

    ZP_PFWRT 5.5.4 PFWRT instruction ZP_PFWRT ZP_PFWRT Executing condition : indicates the following instruction. ZP_PFWRT Structured ladder ZP_PFWRT ENO:= (EN, Un*, s,d); ZP_PFWRT Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..1]...
  • Page 289 ZP_PFWRT Program Example The following program writes the parameters, positioning data, and block start data stored in buffer memory to the flash ROM when X3D turns ON. [Structured ladder] Write to flash ROM instruction pulse Turns write to flash ROM instruction memory ON Waits output of programmable controller...
  • Page 290: Pinit Instruction

    Z_PINIT 5.5.5 PINIT instruction Z_PINIT Z_PINIT Executing condition : indicates the following instruction. Z_PINIT Structured ladder Z_PINIT ENO:= (EN, Un*, s,d); Z_PINIT Input argument Executing condition :Bit Un*: Start I/O number of the module :String (00 to FE: Higher two digits when expressing the I/O number in three digits) Variable that stores control data :Array of ANY16 [0..1]...
  • Page 291 Z_PINIT Program Example The following program initializes the parameters of buffer memory and those of flash ROM when X3C turns ON. [Structured ladder] Parameter initialization instruction pulse Turns parameter initialization instruction memory ON Waits output of programmable controller ready for the QD75 Performs initialization of parameters Turns parameter...
  • Page 292 MEMO 5-246...
  • Page 293: Pid Control Instruction

    PID CONTROL INSTRUCTION PID Control Instruction (Inexact Differential) ......6-2 PID Control Instruction (Exact Differential) ......6-16...
  • Page 294: Pid Control Instruction (Inexact Differential)

    S_PIDINIT PID Control Instruction (Inexact Differential) 6.1.1 PIDINIT instruction S_PIDINIT SP_PIDINIT P: Executing condition indicates any of the following instructions. Structured ladder S_PIDINIT S_PIDINIT SP_PIDINIT ENO:= (EN, s); S_PIDINIT Input argument Executing condition :Bit Start number of the device that stores PID control data :ANY16 Output argument ENO:...
  • Page 295 S_PIDINIT (1) PID control data Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits limits setting range Common setting data (device: +0 to Set the number of loops Number of loops 1 to 32 User...
  • Page 296: 6.1.1 Pidinit Instruction

    S_PIDINIT Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits Set the lower limit for the manipulated value (MV) calculated in PID operation in automatic MV lower limit -32768 to -50 to 2050...
  • Page 297 S_PIDINIT Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits (Fixed value) User – – Set a duration (delay in 0 to 32767 0 to 32767 action) for derivative (unit: 0.01) (unit: 0.01)
  • Page 298 S_PIDINIT Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits Setting data for No. n loop Operational expression +(m+0) selection Sampling cycle +(m+1) (TS) Proportional constant +(m+2) (KP)
  • Page 299: Pidcont Instruction

    S_PIDCONT 6.1.2 PIDCONT instruction S_PIDCONT S(P)_PIDCONT P: Executing condition indicates any of the following instructions. Structured ladder S_PIDCONT SP_PIDCONT S_PIDCONT ENO:= (EN, s); S_PIDCONT Input argument Executing condition :Bit Start number of the device that is assigned in I/O data area :ANY16 Output argument ENO:...
  • Page 300 S_PIDCONT (1) I/O data Setting range Processing when the Setting Device Data name Description With PID Without PID setting data are outside side limits limits the setting range : PID operation for the number of loops to be used is batch-processed Processing method at in one scan.
  • Page 301 S_PIDCONT Setting range Processing when the Setting Device Data name Description With PID Without PID setting data are outside the side limits limits setting range • Select whether the output to the D/A conversion module is a manual When other than 0 or 1 is 0: Automatic manipulated Manual/ manipulated value or...
  • Page 302 S_PIDCONT Setting range Processing when the Setting Device Data name Description Without PID setting data are outside the side With PID limits limits setting range I/O data area for No. n loop value Process value Automatic manipulated value Process value The same as I/O data area for No.
  • Page 303: Pidstop Instruction And Pidrun Instruction

    S_PIDSTOP, S_PIDRUN 6.1.3 PIDSTOP instruction and PIDRUN instruction S_PIDSTOP, S_PIDRUN S(P)_PIDSTOP P: Executing condition S(P)_PIDRUN indicates any of the following instructions. Structured ladder S_PIDSTOP S_PIDRUN SP_PIDSTOP SP_PIDRUN S_PIDSTOP ENO:= (EN, n); S_PIDSTOP Input argument Executing condition :Bit Loop number for stop/start :ANY16 Output argument ENO:...
  • Page 304: Pidprmw Instruction

    S_PIDPRMW 6.1.4 PIDPRMW instruction S_PIDPRMW S(P)_PIDPRMW P: Executing condition indicates any of the following instructions. Structured ladder S_PIDPRMW S_PIDPRMW SP_PIDPRMW ENO:= (EN, n, s); S_PIDPRMW Input argument Executing condition :Bit Loop number to be changed :ANY16 Start number of the device that stores PID control data to be :ANY16 changed Output argument...
  • Page 305: 6.1.4 Pidprmw Instruction

    S_PIDPRMW Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits Proportional Proportional gain of PID 1 to 10000 1 to 10000 constant User operation (unit: 0.01) (unit: 0.01) 1 to 32767 1 to 32767...
  • Page 306 S_PIDPRMW Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID With PID limits side setting range limits Set the variation limit between the previous In the case of "With PID MV and the present MV. limits", the PID operation is When the MV variation is performed after values are...
  • Page 307 S_PIDPRMW Precautions The following table shows the CPU modules applicable to the PID control instructions (inexact differential) and the PID control instructions (exact differential). Inexact Exact CPU module model differential differential The first five digits of the serial number are Basic model QCPU '04122' or higher The first five digits of the serial number are...
  • Page 308: Pid Control Instruction (Exact Differential)

    PIDINIT PID Control Instruction (Exact Differential) 6.2.1 PIDINIT instruction PIDINIT PIDINIT(P) P: Executing condition indicates any of the following instructions. Structured ladder PIDINIT PIDINIT PIDINITP ENO:= (EN, s); PIDINIT Input argument Executing condition :Bit Start number of the device that stores PID control data :ANY16 Output argument ENO:...
  • Page 309 PIDINIT (1) PID control data Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits limits setting range Common setting data (device: +0 to Set the number of loops Number of loops 1 to 32 User...
  • Page 310: 6.2.1 Pidinit Instruction

    PIDINIT Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits Set the lower limit for the manipulated value (MV) calculated in PID operation in automatic MV lower limit -32768 to -50 to 2050...
  • Page 311 PIDINIT Setting range Processing when the Setting Device Data item Description Without PID setting data are outside the side With PID limits setting range limits Setting data for No. 2 loop (device: +12 to +21) Operational expression selection Sampling cycle (TS) Proportional constant...
  • Page 312 PIDINIT Precautions The following table shows the CPU modules applicable to the PID control instructions (inexact differential) and the PID control instructions (exact differential). Inexact Exact CPU module model differential differential The first five digits of the serial number are Basic model QCPU '04122' or higher The first five digits of the serial number are...
  • Page 313: Pidcont Instruction

    PIDCONT 6.2.2 PIDCONT instruction PIDCONT PIDCONT(P) P: Executing condition indicates any of the following instructions. Structured ladder PIDCONT PIDCONTP PIDCONT ENO:= (EN, s); PIDCONT Input argument Executing condition :Bit Start number of the device that is assigned in I/O data area :ANY16 Output argument ENO:...
  • Page 314 PIDCONT (1) I/O data Setting range Processing when the Setting Device Data name Description setting data are outside Without PID side With PID limits limits the setting range : PID operation for the number of loops to be used is batch-processed in one Processing method at scan.
  • Page 315 PIDCONT Setting range Processing when the Setting Device Data name Description setting data are outside With PID Without PID side the setting range limits limits In the case of "With PID limits", the PID operation is performed after values are •...
  • Page 316 PIDCONT Setting range Processing when the Setting Device Data name Description setting data are outside With PID Without PID side the setting range limits limits I/O data area for No. 2 loop (device: +28 to +45) Set value Process value Automatic manipulated value...
  • Page 317 PIDCONT Precautions The following table shows the CPU modules applicable to the PID control instructions (inexact differential) and the PID control instructions (exact differential). Inexact Exact CPU module model differential differential The first five digits of the serial number are Basic model QCPU '04122' or higher The first five digits of the serial number are...
  • Page 318: Pidstop Instruction And Pidrun Instruction

    PIDSTOP, PIDRUN 6.2.3 PIDSTOP instruction and PIDRUN instruction PIDSTOP, PIDRUN PIDSTOP(P) P: Executing condition PIDRUN(P) indicates any of the following instructions. Structured ladder PIDSTOP PIDRUN PIDSTOPP PIDRUNP PIDSTOP ENO:= (EN, n); PIDSTOP Input argument Executing condition :Bit Loop number for stop/start :ANY16 Output argument ENO:...
  • Page 319: Pidprmw Instruction

    PIDPRMW 6.2.4 PIDPRMW instruction PIDPRMW PIDPRMW(P) P: Executing condition indicates any of the following instructions. Structured ladder PIDPRMW PIDPRMW PIDPRMWP ENO:= (EN, n, s); PIDPRMW Input argument Executing condition :Bit Loop number to be changed :ANY16 Start number of the device that stores PID control data to be :ANY16 changed Output argument...
  • Page 320: 6.2.4 Pidprmw Instruction

    PIDPRMW Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID side With PID limits setting range limits Proportional Proportional gain of PID 1 to 10000 1 to 10000 constant User operation (unit: 0.01) (unit: 0.01) (KP) 1 to 32767...
  • Page 321 PIDPRMW Setting range Processing when the Setting Device Data item Description setting data are outside the Without PID With PID limits side setting range limits Set the variation limit between the previous In the case of "With PID MV and the present MV. limits", the PID operation is When the MV variation is performed after values are...
  • Page 322 MEMO 6-30...
  • Page 323: Socket Communication Function Instruction

    SOCKET COMMUNICATION FUNCTION INSTRUCTION SOCOPEN Instruction ......... . . 7-2 SOCCLOSE Instruction .
  • Page 324: Socopen Instruction

    SP_SOCOPEN SOCOPEN Instruction SP_SOCOPEN QnUDE(H) L CPU SP_SOCOPEN Executing condition : indicates the following instruction. Structured ladder SP_SOCOPEN SP_SOCOPEN ENO:= (EN, Un, s1,s2,d); SP_SOCOPEN Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..9] Output argument ENO:...
  • Page 325 SP_SOCOPEN Control Data Device Item Setting data Setting range Setting side Specify which to use the parameter values set by GX Works2 or the +2 to setting values of the following control data ( ) at open 0000 Execution type/ processing of a connection.
  • Page 326 SP_SOCOPEN Program Example The following program opens the connection 1. (When the refresh device of the link special register (SW) is set to SW0.) [Structured ladder] Sets execution type/completion type to 0 Establishes the connection number 1 Turns normal completion flag ON Turns error completion flag ON [ST]...
  • Page 327: Socclose Instruction

    SP_SOCCLOSE SOCCLOSE Instruction SP_SOCCLOSE QnUDE(H) L CPU SP_SOCCLOSE Executing condition : indicates the following instruction. Structured ladder SP_SOCCLOSE SP_SOCCLOSE ENO:= (EN, Un, s1,s2,d); SP_SOCCLOSE Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..1] Output argument ENO:...
  • Page 328 SP_SOCCLOSE Control Data Device Item Setting data Setting range Setting side System area − − − The instruction completion status is stored. Completion status : Normal completion System − Other than 0 : Error completion (error code) Precautions Use the Built-in Ethernet port QCPU of which the function version is B or later and the first five digits of the serial number are '11012' or higher.
  • Page 329 SP_SOCCLOSE [ST] IF(LDF(TRUE, SD1282.0))THEN (* When open completion signal turns OFF *) PLS(TRUE, Var_Flag); (* Turns flag ON *) END_IF; IF((LDP(TRUE, Var_Flag_Inst)) &(SD1282.0=TRUE) OR((Var_Flag=TRUE)&(Var_Flag_Exe=FALSE)))THEN SP_SOCCLOSE(TRUE, "U0", 1, Var_ControlData, Var_Result); (* Shuts off the connection number 1 *) SET(TRUE, Var_Flag_Exe); (* Turns execution flag ON *) END_IF;...
  • Page 330: Socrcv Instruction

    SP_SOCRCV SOCRCV Instruction SP_SOCRCV QnUDE(H) L CPU SP_SOCRCV Executing condition : indicates the following instruction. Structured ladder SP_SOCRCV SP_SOCRCV (EN, Un, s1,s2,d1,d2); ENO:= SP_SOCRCV Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..1] Output argument ENO:...
  • Page 331 SP_SOCRCV Control Data Device Item Setting data Setting range Setting side System area − − − The instruction completion status is stored. Completion status : Normal completion − System Other than 0 : Error completion (error code) Receive Data Device Item Setting data Setting range...
  • Page 332 SP_SOCRCV Program Example The following program reads data received from the external device. [Structured ladder] Reads data from the connection number 1 Turns normal completion flag ON Turns error completion flag OFF [ST] IF((Var_Flag_Inst=TRUE) &(SD1282.0=TRUE) &(SD1286.0=TRUE) &(Var_Result[0]=FALSE))THEN SP_SOCRCV (TRUE, "U0", 1, Var_ControlData, D500, Var_Result); (* Reads data from the connection number 1 *) END_IF;...
  • Page 333: Socrcvs Instruction

    S_SOCRCVS SOCRCVS Instruction S_SOCRCVS QnUDE(H) L CPU S_SOCRCVS Executing condition : indicates the following instruction. Structured ladder S_SOCRCVS S_SOCRCVS (EN, Un, s, d); S_SOCRCVS ENO:= Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Output argument ENO: Output status :Bit...
  • Page 334 S_SOCRCVS Precautions Use the Built-in Ethernet port QCPU of which the function version is B or later and the first five digits of the serial number are '11012' or higher. Program Example The following program reads data received from the external device. [Structured ladder] Reads data from the connection...
  • Page 335: Socsnd Instruction

    SP_SOCSND SOCSND Instruction SP_SOCSND QnUDE(H) L CPU SP_SOCSND Executing condition : indicates the following instruction. Structured ladder SP_SOCSND SP_SOCSND ENO:= (EN, Un, s1,s2,s3,d); SP_SOCSND Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..1] Start number of the device that stores send data ANY16...
  • Page 336 SP_SOCSND Control Data Device Item Setting data Setting range Setting side System area − − − The instruction completion status is stored. Completion status : Normal completion − System Other than 0 : Error completion (error code) Send Data Device Item Setting data Setting range...
  • Page 337 SP_SOCSND Program Example The following program sends data (1234, 5678, and 8901) to the external device using the socket communication function. [Structured ladder] Sets data length by the byte Sets send data Sends data to the connection number 1 Turns normal completion flag ON Turns error completion flag ON...
  • Page 338: Soccinf Instruction

    SP_SOCCINF SOCCINF Instruction SP_SOCCINF QnUDE(H) L CPU SP_SOCCINF Executing condition : indicates the following instruction. Structured ladder SP_SOCCINF SP_SOCCINF ENO:= (EN, Un, s1,s2,d); SP_SOCCINF Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..1] Output argument ENO:...
  • Page 339 SP_SOCCINF Control Data Device Item Setting data Setting range Setting side System area − − − The instruction application status is stored. Completion status : Normal completion − System Other than 0 : Error completion (error code) Connection information Device Item Setting data Setting range...
  • Page 340 SP_SOCCINF Program Example The following program reads connection information of the connection number 1. [Structured ladder] Reads data from the connection number 1 [ST] IF(Var_Flag_Inst=TRUE)THEN SP_SOCCINF(TRUE, "U0", 1, Var_ControlData, Var_Connection); (* Reads data from the connection number 1 *) END_IF; 7.6 SOCCINF Instruction 7-18...
  • Page 341: Soccset Instruction

    SP_SOCCSET SOCCSET Instruction SP_SOCCSET QnUDE(H) L CPU SP_SOCCSET Executing condition : indicates the following instruction. Structured ladder SP_SOCCSET SP_SOCCSET (EN, Un, s1, s2); SP_SOCCSET ENO:= Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..4] Output argument ENO:...
  • Page 342 SP_SOCCSET Control Data Device Item Setting data Setting range Setting side System area − − − The instruction application status is stored. Completion status : Normal completion − System Other than 0 : Error completion (error code) FFFFFFFF : No User Destination IP address Specify the IP address of the external device.
  • Page 343 SP_SOCCSET Program Example The following program changes the destination (destination IP address and port number) of the connection number 1 which is being open. [Structured ladder] Sets destination IP address to 10.97.85.222 Sets destination port number to 8193 Changes the setting of the connection number 1 [ST]...
  • Page 344: Socrmode Instruction

    SP_SOCRMODE SOCRMODE Instruction SP_SOCRMODE QnUDE(H) L CPU SP_SOCRMODE Executing condition : indicates the following instruction. Structured ladder SP_SOCRMODE SP_SOCRMODE (EN, Un, s1, s2); SP_SOCRMODE ENO:= Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..3] Output argument ENO:...
  • Page 345 SP_SOCRMODE Control Data Device Item Setting data Setting range Setting side System area − − − The instruction application status is stored. Completion status : Normal completion − System Other than 0 : Error completion (error code) Specify the TCP receive mode. : TCP normal receive mode 1, 0 User...
  • Page 346: Socrdata Instruction

    S_SOCRDATA SOCRDATA Instruction S_SOCRDATA QnUDE(H) L CPU S(P)_SOCRDATA P:Executing condition : indicates the following instructions. Structured ladder S_SOCRDATA SP_SOCRDATA S_SOCRDATA ENO:= (EN, Un, s1, s2, n, d); S_SOCRDATA Input argument Executing condition :Bit Dummy ("U0") :String Connection number (1 to 16) :ANY16 Variable that stores control data :Array of ANY16 [0..1]...
  • Page 347 S_SOCRDATA Control Data Device Item Setting data Setting range Setting side − − − System area The instruction application status is stored. : Normal completion − System Completion status Other than 0 : Error completion (error code) Precautions Use the Built-in Ethernet port QCPU of which the function version is B or later and the first five digits of the serial number are '11012' or higher.
  • Page 348 MEMO 7-26...
  • Page 349: Built-In I/O Function Instruction

    BUILT-IN I/O FUNCTION INSTRUCTION Positioning Function Dedicated Instruction ....... 8-2 Counter Function Dedicated Instruction .
  • Page 350: Positioning Function Dedicated Instruction

    IPPSTRT1, IPPSTRT2 Positioning Function Dedicated Instruction 8.1.1 IPPSTRT instruction IPPSTRT1, IPPSTRT2 L CPU IPPSTRT1(P) P: Executing condition IPPSTRT2(P) indicates any of the following instructions. Structured ladder IPPSTRT1 IPPSTRT1 IPPSTRT1P ENO:= (EN, n); IPPSTRT IPPSTRT2 IPPSTRT2P Input argument Executing condition :Bit Positioning data number :ANY16 Output argument...
  • Page 351: Ipdstrt Instruction

    IPDSTRT1, IPDSTRT2 8.1.2 IPDSTRT instruction IPDSTRT1, IPDSTRT2 L CPU IPDSTRT1(P) P: Executing condition IPDSTRT2(P) indicates any of the following instructions. Structured ladder IPDSTRT1 IPDSTRT1 IPDSTRT1P ENO:= (EN, s); IPDSTRT1 IPDSTRT2 IPDSTRT2P Input argument Executing condition :Bit Start number of the device in which the control data are stored:Array of ANY16 [0..7] ENO: Output argument Execution result...
  • Page 352 IPDSTRT1, IPDSTRT2 Control Data Device Item Setting data Setting range Setting side 1: Positioning control (ABS) 2: Positioning control (INC) 3: Speed/position switching control (forward RUN) 1 to 7 Control system 4: Speed/position switching control (reverse RUN) 5: Current value change 6: Speed control (forward RUN) 7: Speed control (reverse RUN) User...
  • Page 353 IPDSTRT1, IPDSTRT2 [Structured ladder] [ST] MOV(M0, 1, D0); MOV(M0, 1000, D1); MOV(M0, 1000, D2); MOV(M0, 0, D3); DMOV(M0, 20000, D4); DMOV(M0, 100000, D6); IPDSTRT1P(M0, D0); 8.1 Positioning Function Dedicated Instruction 8.1.2 IPDSTRT instruction...
  • Page 354: Ipsimul Instruction

    IPSIMUL 8.1.3 IPSIMUL instruction IPSIMUL L CPU IPSIMUL(P) P: Executing condition indicates any of the following instructions. Structured ladder IPSIMUL IPSIMUL IPSIMULP ENO:= (EN, n1, n2); IPSIMUL Input argument Executing condition :Bit Axis 1 positioning data number :ANY16 Axis 2 positioning data number :ANY16 Output argument ENO:...
  • Page 355: Ipopr Instruction

    IPOPR1, IPOPR2 8.1.4 IPOPR instruction IPOPR1, IPOPR2 L CPU IPOPR1(P) P: Executing condition IPOPR2(P) indicates any of the following instructions. Structured ladder IPOPR1 IPOPR1 IPOPR1P ENO:= (EN, s); IPOPR1 IPOPR2 IPOPR2P Input argument Executing condition :Bit Start number of the device in which the control data are stored:Array of ANY16 [0..2] ENO: Output argument Execution result...
  • Page 356 IPOPR1, IPOPR2 Program Example The following program starts the machine OPR of the axis 1 when M0 turns ON. Device Item Setting data OPR type Machine OPR D1, D2 Standby address 0 (Ignored) [Structured ladder] [ST] MOV(M0, 1, D0); DMOV(M0, 0, D1); IPOPR1P(M0, D0);...
  • Page 357: Ipjog Instruction

    IPJOG1, IPJOG2 8.1.5 IPJOG instruction IPJOG1, IPJOG2 L CPU IPJOG1 IPJOG2 indicates any of the following instructions. Structured ladder IPJOG1 IPJOG1 IPJOG2 ENO:= (EN, s1, s2); IPJOG1 Input argument Executing condition :Bit Start number of the device in which the control data are stored:Array of ANY16 [0..3] Direction specification of the JOG operation :Bit 0: Forward RUN...
  • Page 358 IPJOG1, IPJOG2 Control Data Device Item Setting data Setting range Setting side 0 to 200000 − JOG speed (pulse/s) User − JOG acceleration time 0 to 32767 (ms) − JOG deceleration time *1: The restricted speed value may be applied when the set value of the JOG speed is not within 0 to 200000. Program Example The following program starts the forward JOG operation when M0 turns ON, and starts the reverse JOG operation when M1 turns ON.
  • Page 359: Ipabrst Instruction

    IPABRST1, IPABRST2 8.1.6 IPABRST instruction IPABRST1, IPABRST2 L CPU IPABRST1 P: Executing condition IPABRST2 indicates any of the following instructions. Structured ladder IPABRST1 IPABRST1 IPABRST2 ENO:= (EN, s, d); IPABRST1 Input argument Executing condition :Bit Start number of the device for input :Array of bit [0..2] ENO: Output argument...
  • Page 360 IPABRST1, IPABRST2 (2) Signals exported to servo amplifier Device Item Setting data Setting range Setting side Servo ON − System Signals exported to servo amplifier ABS transfer mode ABS request flag Program Example This instruction executes the absolute position restoration of the axis 1 when M0 turns ON. •...
  • Page 361: Ipstop Instruction

    IPSTOP1, IPSTOP2 8.1.7 IPSTOP instruction IPSTOP1, IPSTOP2 L CPU IPSTOP1 IPSTOP2 indicates any of the following instructions. Structured ladder IPSTOP1 IPSTOP2 ENO:= (EN); IPSTOP IPSTOP Input argument Executing condition :Bit Output argument ENO: Execution result :Bit Internal device Setting R, ZR Constant Others data...
  • Page 362: Ipspchg Instruction

    IPSPCHG1, IPSPCHG2 8.1.8 IPSPCHG instruction IPSPCHG1, IPSPCHG2 L CPU IPSPCHG1(P) P: Executing condition IPSPCHG2(P) indicates any of the following instructions. Structured ladder IPSPCHG1 IPSPCHG1 IPSPCHG1P ENO:= (EN, s); IPSPCHG1 IPSPCHG2 IPSPCHG2P Input argument Executing condition :Bit Start number of the device in which the control data are stored:Array of ANY16 [0..3] ENO: Output argument Execution result...
  • Page 363 IPSPCHG1, IPSPCHG2 Program Example The following program changes the speed of the axis 1 when M0 turns ON. Device Item Setting data Acceleration/deceleration time 2000 (ms) at speed change Deceleration stop time at speed 1000 (ms) change D2, D3 200000 (pulse/s) New speed value [Structured ladder] [ST]...
  • Page 364: Iptpchg Instruction

    IPTPCHG1, IPTPCHG2 8.1.9 IPTPCHG instruction IPTPCHG1, IPTPCHG2 L CPU IPTPCHG1(P) P: Executing condition IPTPCHG2(P) indicates any of the following instructions. Structured ladder IPTPCHG1 IPTPCHG1 IPTPCHG1P ENO:= (EN, s); IPTPCHG1 IPTPCHG2 IPTPCHG2P Input argument Executing condition :Bit Target position change value (constant), or start number of the :ANY32 device in which the control data are stored.
  • Page 365 IPTPCHG1, IPTPCHG2 Program Example The following program changes the target position of the axis 1 to 2000 when M0 turns ON. [Structured ladder] [ST] IPTPCHG1P(M0, 2000); 8.1 Positioning Function Dedicated Instruction 8-17 8.1.9 IPTPCHG instruction...
  • Page 366: Counter Function Dedicated Instruction

    ICCNTRD1, ICCNTRD2 Counter Function Dedicated Instruction 8.2.1 ICCNTRD instruction ICCNTRD1, ICCNTRD2 L CPU ICCNTRD1(P) P: Executing condition ICCNTRD2(P) indicates any of the following instructions. Structured ladder ICCNTRD1 ICCNTRD1P ICCNTRD1 ENO:= (EN); ICCNTRD1 ICCNTRD2 ICCNTRD2P Input argument Executing condition :Bit Output argument ENO: Execution result :Bit...
  • Page 367: Icrngwr Instruction

    ICRNGWR1, ICRNGWR2 8.2.2 ICRNGWR instruction ICRNGWR1, ICRNGWR2 L CPU ICRNGWR1(P) P: Executing condition ICRNGWR2(P) indicates any of the following instructions. Structured ladder ICRNGWR1 ICRNGWR1 ENO:= (EN, s1, s2); ICRNGWR1 ICRNGWR1P ICRNGWR2 ICRNGWR2P Input argument Executing condition :Bit Ring counter lower limit value (constant), or start number of :ANY32 the device that stores the ring counter lower limit value Ring counter upper limit value (constant), or start number of...
  • Page 368 ICRNGWR1, ICRNGWR2 Program Example The following program sets -100000 for the ring counter lower limit value and 100000 for the ring counter upper limit value of CH 1 when M0 turns ON. [Structured ladder] [ST] ICRNGWR1P(M0, -100000, 100000); 8.2 Counter Function Dedicated Instruction 8-20 8.2.2 ICRNGWR instruction...
  • Page 369: Icprewr Instruction

    ICPREWR1, ICPREWR2 8.2.3 ICPREWR instruction ICPREWR1, ICPREWR2 L CPU ICPREWR1(P) P: Executing condition ICPREWR2(P) indicates any of the following instructions. Structured ladder ICPREWR1 ICRNGWR1 ICPREWR1P ENO:= (EN, s); ICRNGWR1 ICPREWR2 ICPREWR2P Input argument Executing condition :Bit Preset value (constant), or start number of the device that :ANY32 stores the preset value ENO:...
  • Page 370: Iclthrd Instruction

    ICLTHRD1, ICLTHRD2 8.2.4 ICLTHRD instruction ICLTHRD1, ICLTHRD2 L CPU ICLTHRD1(P) P: Executing condition ICLTHRD2(P) indicates any of the following instructions. Structured ladder ICLTHRD1 ICLTHRD1 ICLTHRD1P ENO:= (EN, n, d); ICLTHRD1 ICLTHRD2 ICLTHRD2P Input argument Executing condition :Bit Latch count value :ANY16 ENO: Output argument...
  • Page 371: Icsmprd Instruction

    ICSMPRD1, ICSMPRD2 8.2.5 ICSMPRD instruction ICSMPRD1, ICSMPRD2 L CPU ICSMPRD1(P) P: Executing condition ICSMPRD2(P) indicates any of the following instructions. Structured ladder ICSMPRD1 ICSMPRD1 ICSMPRD1P ENO:= (EN, d); ICSMPRD1 ICSMPRD2 ICSMPRD2P Input argument Executing condition :Bit Output argument ENO: Execution result :Bit Start number of the device in which the sampling count value :ANY32...
  • Page 372: Iccovwr Instruction

    ICCOVWR1, ICCOVWR2 8.2.6 ICCOVWR instruction ICCOVWR1, ICCOVWR2 L CPU ICCOVWR1(P) P: Executing condition ICCOVWR2(P) indicates any of the following instructions. Structured ladder ICCOVWR1 ICCOVWR1 ICCOVWR1P ENO:= (EN, n, s); ICCOVWR1 ICCOVWR2 ICCOVWR2P Input argument Executing condition :Bit Coincidence output No. n point :ANY16 Coincidence output No.
  • Page 373: Icfcnt Instruction

    ICFCNT1, ICFCNT2 8.2.7 ICFCNT instruction ICFCNT1, ICFCNT2 L CPU ICFCNT1 ICFCNT2 indicates any of the following instructions. Structured ladder ICFCNT1 ICFCNT1 ICFCNT2 ENO:= (EN, d); ICFCNT1 Input argument Executing condition :Bit Output argument ENO: Execution result :Bit Start number of the device that stores the measured frequency :ANY32 value Internal device...
  • Page 374: Icrcnt Instruction

    ICRCNT1, ICRCNT2 8.2.8 ICRCNT instruction ICRCNT1, ICRCNT2 L CPU ICRCNT1 ICRCNT2 indicates any of the following instructions. Structured ladder ICRCNT1 ICRCNT1 ICRCNT2 ENO:= (EN, d); ICRCNT1 Input argument Executing condition :Bit Output argument ENO: Execution result :Bit Start number of the device that stores the measured rotation :ANY32 speed Internal device...
  • Page 375: Icplsrd Instruction

    ICPLSRD1, ICPLSRD2 8.2.9 ICPLSRD instruction ICPLSRD1, ICPLSRD2 L CPU ICPLSRD1(P) P: Executing condition ICPLSRD2(P) indicates any of the following instructions. Structured ladder ICPLSRD1 ICPLSRD1 ICPLSRD1P ENO:= (EN, d); ICPLSRD1 ICPLSRD2 ICPLSRD2P Input argument Executing condition :Bit Output argument ENO: Execution result Start number of the device that stores the measured pulse :ANY32 value...
  • Page 376: Icpwm Instruction

    ICPWM1, ICPWM2 8.2.10 ICPWM instruction ICPWM1, ICPWM2 L CPU ICPWM1 ICPWM2 dicates any of the following instructions. Structured ladder ICPWM1 ICPWM1 ICPWM2 ENO:= (EN, s1, s2); ICPWM1 Input argument Executing condition :Bit PWM output ON time setting value (constant), or start number :ANY32 of the device that stores the PWM output ON time setting value...
  • Page 377 ICPWM1, ICPWM2 Program Example The following program outputs the PWM waveform with 1µs ON time and 5µs cycle time from CH 1 while M0 is ON. [Structured ladder] [ST] ICPWM1(M0, 10, 50); 8.2 Counter Function Dedicated Instruction 8-29 8.2.10 ICPWM instruction...
  • Page 378 MEMO 8-30...
  • Page 379: Data Logging Function Instruction

    DATA LOGGING FUNCTION INSTRUCTION LOGTRG Instruction, LOGTRGR Instruction ......9-2...
  • Page 380 LOGTRG LOGTRG Instruction, LOGTRGR Instruction LOGTRG L CPU LOGTRG P: Executing condition LOGTRGR indicates any of the following instructions. Structured ladder LOGTRG LOGTRGR LOGTRG ENO:= (EN, n); LOGTRG Input argument Executing condition :Bit Data logging configuration number :ANY16 ENO: Output argument Execution result :Bit Internal device...
  • Page 381 LOGTRG Function LOGTRG (1) The LOGTRG instruction generates a trigger in the trigger logging of the data logging configuration number specified by 'n'. (2) A value from 1 to 10 is set for 'n'. (3) When the LOGTRG instruction is executed, the special relay (data logging trigger) of the data logging configuration number specified by 'n' turns ON.
  • Page 382 LOGTRG Program Example The following program executes the LOGTRG instruction on the data logging configuration No. 1 when X0 turns ON, and resets the trigger condition with the LOGTRGR instruction when X1 turns ON. [Structured ladder] [ST] LOGTRG(X0,K1); LOGTRGR(X1,K1); 9.1 LOGTRG Instruction, LOGTRGR Instruction...
  • Page 383 INDEX Index-1...
  • Page 384 ICRCNT (rotation speed measurement)....8-26 ICRNGWR (ring counter upper/lower limit value write) ABRST (absolute position restoration)....5-233 ................8-19 Analog instruction........2-3,2-11,2-12 ICSMPRD (sampling counter value read) ..... 8-23 Analog module ............1-7 INPUT (receiving data using nonprocedural protocol communication) ............. 5-67 BIDIN (receiving data using bidirectional protocol INSTRUCTION TABLES .........
  • Page 385 PINIT (setting data initialization) ......5-244 UINI (switching the mode, transmission specification, Positioning Instruction ......... 5-233 and host station number) ........5-103 PRR (data transmission/reception) ....... 5-81 PSTRT (positioning start)........5-237 WRITE (writing data to a word device)....5-146 PUTE (user frame registration) ......5-97 READ (reading data from a word device) ...
  • Page 386 MEMO Index-4...
  • Page 387 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 388 Microsoft, Windows are registered trademarks of Microsoft Corporation in the United States and other countries. Ethernet is a trademark of Xerox Corporation. All other company names and product names used in this manual are trademarks or registered trademarks of their respective companies.

This manual is also suitable for:

Melsec-q series

Table of Contents