(6) INTRODUCTION This textbook explains the programmable controller, the program editing methods with GX Works2, the sequence instructions and the a
4 - 6 4.4 Counting by Counter Project name QB-4 Program name MAIN K12Set value in counterC20Y72X1C20X7057RSTC20 *: OUT C is a 4-step instruct
4 - 7 Project name QEX1 Program name MAIN Ladder example When the conveyor belt operation start switch (X0) is turned on, the buzzer (Y70) beeps
4 - 8 Operating Procedure (1) Creating a new project (a) Click on the toolbar. Click (b) The New Project dialog box is displayed. Set "P
4 - 9 (2) Creating a program [Using the keyboard] F5X0F5C0F7M0F4ConversionShift+ [Using the tool buttons] (a) Click on the toolbar to open th
4 - 10 (3) Writing the project to the programmable controller (a) Write the created ladder to the memory on the programmable controller. Cli
4 - 11 (d) If parameters have been already written, the confirmation dialog box for overwriting the parameters is displayed. Click the Yes but
4 - 12 (g) Writing the program to the programmable controller is finished.
4 - 13 (4) Monitoring the ladder Monitor the ladder. (a) Click on the toolbar. Click (b) The ladder (write) screen is used to monito
4 - 14 4.5 PLS Pulse (turns on the specified device for one scan at rising edge of an input condition.) PLF Pulf (turns on the specified dev
4 - 15 Application • The instructions can be used in the standby program that waits for the operation condition. Execution commandX0M0M5Execution
1 - 1 CHAPTER 1 BASICS OF PROGRAMMABLE CONTROLLER 1.1 Program If a programmable controller is assumed as a control ladder, it can be described by
4 - 16 • The instructions can be used for a program that detects passage of moving objects. After the passage of a product is detected, the next p
4 - 17 Other Useful Ways of PLS and PLF Part 2 • The program for the repeated operation such as switching on/off status alternately by pressing th
4 - 18 Project name QEX2 Program name MAIN Ladder example Create the following ladder and check that it operates properly. Y70M0Y70X3Y71M1X2Y71
4 - 19 Operating Procedure The following procedures are the same as the Operating Procedure in section 4.4. (1) Creating a new project (2) Cre
4 - 20 4.6 MC Master Control (Start) MCR Master Control Reset (End) Project name QB-8 Program name MAIN X7X2X3NO M98Y71MCR NOY70MC035
4 - 21 Nested "MC to MCR" Program Example • The MC and MCR instructions can be nested as shown below. Project name QB-9 Program name M
4 - 22 Project name QEX3 Program name MAIN Ladder example The following program switches between manual and automatic operations using the MC an
4 - 23 Operating Procedure The following procedures are the same as the Operating Procedure in section 4.4. (1) Creating a new project (2) Cre
4 - 24 4.7 FEND / CJ / SCJ / CALL / RET Project name QB-10 Program name MAIN 4.7.1 FEND F end FENDFEND is a 1-step instruction. •
4 - 25 Project name QEX6 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
1 - 2 Internal Sequential Operation The following shows the signal flow of the internal sequential operation of figure 1.1. 1) When the sensor tu
4 - 26 Operation Practice Verify the operation of the ladder, which was created with GX Works2 and written to the CPU of the demonstration machine
4 - 27 4.7.2 CJ (Conditional jump: instantaneous execution condition jump) SCJ (S conditional jump: execution condition jump after one scan
4 - 28 NOTE • The pointer numbers available for both CJ and SCJ instructions are P0 to P4095. • Use the FEND instruction as shown below when a pro
4 - 29 Project name QEX4 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
4 - 30 Operation Practice (1) When X0 and X1 are off, the CJ and SCJ instructions are not executed. Therefore, Y70 is on. (2) When X0 is turned
4 - 31 4.7.3 CALL(P) Call RET Return 0103104M0X1X2CALLP10FENDY7050M5CALLP10157RETP10Subroutine programSequence program12 • The above program is
4 - 32 Nesting • The CALL (P) instructions can be nested up to 16 levels. CALL P1CALL P3CALL P4CALL P5RETRETRETRETRETSequence program0FENDSubrout
4 - 33 Project name QEX5 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
4 - 34 Operation Practice Verify the operation of the ladder, which was created with GX Works2 and written to the CPU of the demonstration machine
4 - 35 Project name QTEST1Program name MAIN 4.8 Exercise 4.8.1 Exercise 1 LD to NOP When X0 turns on, Y70 is self-maintained, and Y74 and Y
1 - 3 The internal sequential operation can be regarded as the program of the programmable controller. The program is saved in the program memory
4 - 36 Project name QTEST2Program name MAIN 4.8.2 Exercise 2 SET, RST When X0 is turned on, Y70 starts to flicker at one-second intervals a
4 - 37 Hint (1) The following shows the timing chart of the program. X0M0X1Contact T0Contact T1Y70Contact C01sec.1sec. 1sec.1secOne scan5sec.R
4 - 38 Project name QTEST3Program name MAIN 4.8.3 Exercise 3 PLS, PLF Y70 starts to switch between ON and OFF alternately when X0 is turned
4 - 39 Project name QTEST4Program name MAIN 4.8.4 Exercise 4 CJ, CALL, RET, FEND Y70 and Y71 flicker for 0.5sec. alternately when X7 is off
4 - 40 Hint 1) 2) 3) 4) 5) 6) X7 ON?YNY70,Y710.5-sec. flickeringYNX0 ON?<CJ P0>Y72,Y731-sec. flickeringX0 ON?YNP10Y70Y73ResetSubroutine p
4 - 41 Answers for the exercises in Chapter 4 Exercise No. Answer 1) Y70 2) X1 3) T1 4) T0 1 5) Y74 1) SET M0 2) C0 3) Y70 4) SET M1 5) RST C0
4 - 42 MEMO
5 - 1 CHAPTER 5 BASIC INSTRUCTION -PART 2- 5.1 Notation of Values (Data) The programmable controller CPU converts all input signals into ON o
5 - 2 Binary (BIN) The binary number system consists of two symbols: 0 and 1 which represent the order and size (amount). After a digit reaches
5 - 3 Hexadecimal The hexadecimal number system consists of 16 symbols: 0 to 9 and A to F which represent the order and size (amount). After a
1 - 4 1.2 Program Processing Procedure The operation process is executed in series from the start step of the program memory left to right and to
5 - 4 Binary Coded Decimal (BCD) The binary-coded decimal is "a numerical system using a binary number to represent a decimal number"
5 - 5 In the example below, a decimal number 157 is converted into the binary number. 1) 15712829161385411010 01 1 10112864 32 2Bit weights1684
5 - 6 ● Usually, 8 bits are called 1 byte, and 16 bits (2 bytes) are called 1 word. 0 000 0000 1001 11011 byte1 word (2 byte)1001 11011 bit ● Re
5 - 7 BCD (binary coded decimal) BIN (binary) K (decimal) H (hexadecimal)00000000 00000000 00000000 00000001 00000000 00000010 00000000 0000
5 - 8 Q61P QX42(64points)QY42P(64points)Q64AD(16points)Q62DAN(16points)Power supply moduleCPU moduleInput moduleOutput moduleBase unit Q38DBI/
5 - 9 5.2 Transfer Instruction Project name QB-11 Program name MAIN 5.2.1 MOV (P) 16-bit data transfer X7 T0T01T0K50C10K1500X1C10RST13X
5 - 10 3● When the input condition turns on, the hexadecimal number 4A9D is transferredto the data register D3. 0100101010011101D31H4A9D2481632641
5 - 11 Check Monitor the contents of the data registers D0 to D3. • After writing the data to the programmable controller, click [Online] → [
5 - 12 Indicates that a decimal number 157 (K157) is stored.Current values of a timer and counter are monitored.(They are changing.)This is a dec
5 - 13 • Click the Display Format button. • Change the display of the numerical value in the monitor to the hexadecimal notation. • Select &
1 - 5 1.3 MELSEC-QnUD Module Configuration (1) Universal model The Universal model QCPU is used for a training in this textbook, therefore, "
5 - 14 Project name QEX7 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
5 - 15 Operation Practice Check that "200" is displayed under both D0 and D1 on the monitor screen when X0 on the control panel of the d
5 - 16 Project name QB-12 Program name MAIN 5.2.2 BIN (P) BCD → BIN data conversion instruction Operations to read and write data after st
5 - 17 K4X20 Word devices D (data register), T (timer current value), and C (counter current value) consist of 16 bits (1 word), and data is ba
5 - 18 Project name QB-13 Program name MAIN 5.2.3 BCD (P) BIN → BCD data conversion instruction DSX7 T0T0T0K50C10K1500X6K2Y40T037 BCDK4Y50C
5 - 19 Displayable Range with BCD Instruction The displayable range of data with the BCD instruction (to be converted from BIN into BCD) is bet
5 - 20 Project name QEX8 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
5 - 21 5.2.4 Example of specifying digit for bit devices and transferring data Program example Process When the destination data D is a word
5 - 22 Project name QB-14 Program name MAIN 5.2.5 FMOV (P) FMOV (Batch transfer of the same data) BMOV (P) BMOV (Batch transfer of th
5 - 23 Input conditionDSK16D32D0BMOVPn BMOV When the input condition is turned on, the BMOV instruction transfers the data in the devices star
1 - 6 Base Unit Main base unit Extension base unitWith three I/O modulesWith fiveI/O modulesWith eight I/O modulesWith 12 I/O modulesPower supply
5 - 24 Operation Practice Write the program on the previous page to the CPU, then run the CPU. Follow the procedures below to execute the de
5 - 25 Reference If D is a bit device, the operation becomes as follows; FMOV instruction Input conditionDSK4K2Y40D0FMOVn0 0 0 0 0 0 0 1 0 1 1
5 - 26 Project name QEX9 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstratio
5 - 27 Project name QB-15 Program name MAIN 5.3 Comparison Operation Instruction Size comparison C10K4Y40C10BCDY70S1 S2X3SM413 (2-sec. clock)X
5 - 28 Operation Practice Write the program to the CPU. Turn on X3 and X4. C10 starts to count. (one count every two sec.) The current co
5 - 29 Project name QEX10 Program name MAIN Ladder example Read the following ladder and write it to the CPU of the demonstration machine. Then
5 - 30 ● The Open dialog box is displayed. Specify the save destination. ● Double-click the displayed workspace "SCHOOL". Double-click
5 - 31 Operation Practice Turn on X0 and check that the program works properly. X0T0029Y71Y72ENDM0M10X1281031T0K30T0K27T0K30T0K3330303030M0RSTK
5 - 32 5.4 Arithmetic Operation Instruction Project name QB-16 Program name MAIN 5.4.1 +(P) BIN 16-bit data addition -(P) BIN 16-bit data
5 - 33 Project name QB-17 Program name MAIN X40D2K1000MOVPX53D3S2X67D3K50D2-PDS14D2K10-PS 3● Every time the input condition is turned on, the
1 - 7 Power Supply Module Module name Input Output Q61P 100V to 240VAC 5VDC 6A Q62P 100V to 240VAC 5VDC 3A, 24VDC 0.6A Q63P 24VDC 5VDC 6A
5 - 34 Project name QEX11 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstrati
5 - 35 Operation Practice (1) When X0 is turned on, the data in X30 to 3F and X20 to 2F are added, and the result is output to Y40 to Y53. (2)
5 - 36 Project name QB-18 Program name MAIN 5.4.2 * (P) BIN 16-bit data multiplication / (P) BIN 16-bit data division X00D0K2000MOVPX231S2
5 - 37 2● When the input condition is turned on, the content of the device specified in S1is divided by the content of the device specified in S2a
5 - 38 ● How to monitor 32-bit integral number data When the operation result of the multiplication instruction is outside the range from 0 to 32,
5 - 39 Project name QEX12 Program name MAIN Ladder example Create the following ladder with GX Works2 and write it to the CPU of the demonstrati
5 - 40 Operation Practice (1) When X0 is turned on, the data in X20 to X2F is multiplied by the data in X30 to 3F, and the result is output to Y40
5 - 41 5.4.3 32-bit data instructions and their necessity The minimum unit in the data memory of the Q-series programmable controller is 1 wor
5 - 42 Whether the data is processed in 2-word (32-bit) basis or not depends on the size of the data. In the following cases, 2-word instructio
5 - 43 Project name QB-19 Program name MAIN 5.4.4 Calculation examples for multiplication and division including decimal points (when the multi
1 - 8 Memory Card A QCPU equips a built-in memory as standard for storing parameters and programs, therefore, the programs can be executed without
5 - 44 5.5 Index Register and File Register 5.5.1 How to use index register Z The index register (Zn) is used to indirectly specify the de
5 - 45 Application Example • Write the data to the data register with number which is specified with the digital switch. Project name Index reg
5 - 46 5.5.2 How to use file register R The file register (R) consists of 16 bits as well as the data register (D). Set the file register
5 - 47 (From the previous page) 4) Select!5) Click!3) Click!6) Click!(To the next page) 3) The Q Parameter Setting dialog box is displayed. Cli
5 - 48 (From the previous page) 7) Select!8) Click! 7) Click [Online] → [Write to PLC] to display the Online Data Operation dialog box. Select &
5 - 49 5.6 External Setting of Timer/Counter Set Value and External Display of Current Value The timer and counter can be specified by K (decim
5 - 50 Operation Practice (1) External setting of the timer set value and display of the current value • Set the timer set value in the digital
5 - 51 Project name QTEST5 Program name MAIN 5.7 Exercise 5.7.1 Exercise 1 MOV Transfer the eight input statuses (X0 to X7) to D0 once then
5 - 52 Project name QTEST6 Program name MAIN 5.7.2 Exercise 2 BIN and BCD conversion Output the number of times that X1 is turned on on th
5 - 53 Project name QTEST7 Program name MAIN 5.7.3 Exercise 3 FMOV Create a program in which turning on X0 turns on the 64 outputs Y40 to Y
1 - 9 <Reference: Universal model QCPU memory system configuration> The memory of the Universal model QCPU consists of the following blocks
5 - 54 Project name QTEST8 Program name MAIN 5.7.4 Exercise 4 Comparison instruction Using the two BCD digital switches, execute the calcul
5 - 55 Project name QTEST9 Program name MAIN 5.7.5 Exercise 5 Addition and subtraction instructions Create a program that: 1) Imports the
5 - 56 Project name QTEST10Program name MAIN 5.7.6 Exercise 6 Multiplication and division instructions Create a program that: 1) Sets dat
5 - 57 Project name QTEST11Program name MAIN 5.7.7 Exercise 7 D-multiplication and D-division Create a program that: 1) Multiplies the valu
5 - 58 Answers for the exercises in Chapter 5 Exercise No. Answer 1) K2X0 1 2) K2Y70 1) D0 2) K4X20 3) BCD 2 4) K4Y40 1) K2Y40 2) K8 3 3) K0 1) B
6 - 1 CHAPTER 6 HOW TO USE OTHER FUNCTIONS 6.1 Test Function at Online As a preparation, follow the procedure below. Project name QEX14Pro
6 - 2 6.1.1 Turning on and off the device "Y" forcibly Stop the CPU before this operation. 1) Click [Debug] → [Modify Value]. 1) Cl
6 - 3 POINT The test function during ladder monitoring of GX Works2 is also available for setting and resetting contacts, changing current values
6 - 4 6.1.2 Setting and resetting the device "M" Activate the CPU before this operation. 1) Click [Debug] → [Modify Value]. 1) Clic
6 - 5 6.1.3 Changing the current value of the device "T" Activate the CPU before this operation. 1) Click [Debug] → [Modify Value].
1 - 10 POINT Secure backup by long-term storage Programs and parameter files are automatically backed up to the program memory (Flash ROM) which
6 - 6 6.1.4 Reading error steps Activate the CPU before this operation. 1) Click [Diagnostics] → [PLC Diagnostics]. 2) The PLC Diagnostics dia
6 - 7 6.1.5 Remote STOP and RUN Activate the CPU before this operation. 1) Click [Online] → [Remote Operation]. 2) The Remote Operation dial
6 - 8 6.2 Forced I/O Assignment by Parameter Settings 1) Double-click "Parameter" in the project list. 2) "PLC Parameter"
6 - 9 Check with demonstration machine Stop the CPU and click on the toolbar. The Online Data Operation dialog box is displayed. Click the param
6 - 10 6.3 How to Use Retentive Timers When an input condition is turned on, the coil is energized. Then the value of a retentive timer starts
6 - 11 3) The Q Parameter Setting dialog box is displayed. Click the "Device" tab. (From the previous page) 3) Click!5) Click!4) Enter
6 - 12 6.4 Device Batch Replacement 6.4.1 Batch replacement of device numbers This section explains how to replace Y40 to Y7F (64 devices) wit
6 - 13 6.4.2 Batch change of specified devices between normally open contacts and normally closed contacts This section explains how to change
6 - 14 6.5 Online Program Change This function is used to write programs to the CPU that is running. Activate the CPU before this operation. 1)
6 - 15 6.6 Registering Devices This section explains how to register multiple devices or labels in one screen and to monitor them at the same tim
1 - 11 1.4 External I/O Signal and I/O Number (1) Wiring of I/O devices The signals output from the external input devices are substituted by
6 - 16 6.7 How to Create Comments Project name QEX15 Program name MAIN The following is an example of a printed out ladder with comments.
6 - 17 (1) Flowchart of when creating comments Set the device range on which comments are attached.*Double-click the comment file on the workspa
6 - 18 (2) Creating comments 1) Double-click! 1) Double-click "Global Device Comment" in the project list. The Device Comment screen i
6 - 19 (From the previous page) 8) Enter comments!6) Enter "M1"! 6) Enter "M1" in the "Device Name" list box. 7)
6 - 20 (3) Saving comments 1) Click! 1) Click [Project] → [Save As]. 2) Click! 2) The Save As dialog box is displayed. Specify (or select) a
6 - 21 (4) Displaying a ladder with comments on GX Works2 screens 1) Click! 1) Click [View] → [Comment]. 2) Comments are displayed on the la
6 - 22 POINT In addition to device comments, statements and notes can be created on the ladder screen. • Statement : Comment for explaining func
6 - 23 6.8 Setting Security for Projects This section explains how to set security for projects to protect the projects and the data in the pro
6 - 24 6.8.1 Setting and resetting security for projects This section explains how to set security for an open project and how to reset the sec
6 - 25 6.8.2 Managing (adding, deleting, and changing) users This section explains how to manage the registered statuses of users for a project w
1 - 12 (2) I/O numbers of a main base unit The I/O numbers of I/O modules which are attached to a main base unit are assigned as follows. This co
6 - 26 [Adding users] Add a user to a project with security. A user whose access level is higher than that of the login user cannot be added. 1)
6 - 27 [Changing user information] Change the access level of the user added on the previous page from "Developers(Level3)" to "Use
6 - 28 [Changing passwords] Change the password of a user selected in the list on the User Management screen. The password of the login user and o
6 - 29 6.8.3 Logging in projects A user authentication is required for opening a project with security. 1) Click!1) Enter items! 1) When a proj
6 - 30 6.8.4 Changing access authority for each access level This section explains how to set an authorization of displaying and saving data fo
6 - 31 6.9 Sampling Trace Function This function is used to acquire data at the specified timing to find how device values change during program
6 - 32 (1) Setting the sampling trace 1) Click! 1) Click [Debug] → [Sampling Trace] → [Open Sampling Trace]. 2) The Sampling Trace screen i
6 - 33 (From the previous page) 4) Select!5) Click! 4) The Trace Setting dialog box is displayed. Select "Standard RAM" from the &quo
6 - 34 (From the previous page) 8) Click!7) Enter item and set! 7) The Detail Setting - Trigger Condition dialog box is displayed. Set the foll
6 - 35 (2) Starting the sampling trace 1) Click! 1) Click [Debug] → [Sampling Trace] → [Start Trace]. 2) The message shown on the left is di
1 - 13 (3) I/O numbers of an extension base unit Connect an extension base unit when the number of slots of the main base unit is insufficient. T
6 - 36 (3) Checking the trace result 1) Scroll the trend graph screen to the trigger point to check the device value at an error occurrence.
7 - 1 CHAPTER 7 PROGRAMMING INTELLIGENT FUNCTION MODULE 7.1 Intelligent Function Module (1) Intelligent function module type On programmable c
7 - 2 7.2 Data Communication between Intelligent Function Modules and CPUs An intelligent function module and a CPU exchange mainly two formats
7 - 3 7.2.1 I/O signals to CPUs For 1-bit signals exchanged between a QCPU and an intelligent function module, input Xs and output Ys are used.
7 - 4 7.2.2 Data communication with intelligent function modules Data is transmitted or received in 16-bit or 32-bit units. Intelligent functio
7 - 5 7.3 Communication with Intelligent Function Module 7.3.1 Communication methods with intelligent function modules The following table s
7 - 6 7.4 Intelligent Function Module System in Demonstration Machine Use an A/D or D/A converter module to convert analog signals/digital data
7 - 7 7.5 Q64AD Analog/Digital Converter Module 7.5.1 Names of parts The following explains the parts of Q64AD. For details, refer to the User
7 - 8 7.5.2 A/D conversion characteristics (1) A/D conversion characteristics on voltage inputs (For analog input range from -10 to 10V in a sta
7 - 9 7.5.3 List of I/O signals and buffer memory assignment (1) List of I/O signals The following shows a list of the I/O signals for the A/D
1 - 14 1.5 System Configuration and I/O Number of Demonstration Machine Q61P QX42(64points)QY42P(64points)Q64AD(16points)Q62DAN(16points)Power
7 - 10 (2) Buffer memory assignment (Q64AD) This section explains the assignment of the Q64AD buffer memory. POINT Do not write data to the sys
7 - 11 Buffer memory assignment (Q64AD) (2/2) Address Hexadecimal Decimal Description Default Read/ write*1 18H 24 ... ... 1DH 29 System area -
7 - 12 7.5.4 Adding or setting intelligent function module data This section explains how to set the intelligent function module data. After an
7 - 13 (From the previous page) 6) Double-click! 6) Double-click Switch Setting. 7) Set!8) Click! 7) The Switch Setting screen is displayed.
7 - 14 (From the previous page) 11) Double-click! 11) Double-click Auto_Refresh. 12) Set! 12) The Auto_Refresh screen is displayed. Set Digita
7 - 15 (From the previous page) 15) Click! 14) Check that "Setting Exist" is checked in Initialization (Count) and Auto Refresh (Count
7 - 16 7.5.5 Exercise with the demonstration machine (1) Sequence program The sequence program executes a sampling processing on analog voltage
7 - 17 7.6 Q62DAN Digital/Analog Converter Module 7.6.1 Names of parts The following explains the parts of Q62DAN. For details, refer to the U
7 - 18 7.6.2 D/A conversion characteristics (1) D/A conversion characteristics on voltage outputs (For analog output range from -10 to 10V in a
7 - 19 7.6.3 List of I/O signals and buffer memory assignment (1) List of I/O signals The following shows a list of the I/O signals for the D/
2 - 1 CHAPTER 2 OPERATING GX Works2 GX Works2 is a programming tool for designing, debugging, and maintaining programs on Windows®. GX Works2 has
7 - 20 (2) Buffer memory assignment (Q62DAN) This section explains the assignment of the Q62DAN buffer memory. POINT Do not write data to the s
7 - 21 7.6.4 Adding or setting intelligent function module data 1) Click!1) Click [Project] → [Intelligent Function Module] → [New Module].
7 - 22 (From the previous page) 6) Double-click! 6) Double-click Switch Setting. 7) Set!8) Click! 7) The Switch Setting screen is displayed.
7 - 23 (From the previous page) 11) Double-click! 11) Double-click Auto_Refresh. 12) Set! 12) The Auto_Refresh screen is displayed. Set Digita
7 - 24 (From the previous page) 15) Click! 14) Check that "Setting Exist" is checked in Initialization (Count) and Auto Refresh (Count
7 - 25 7.6.5 Exercise with the demonstration machine (1) Sequence program The sequence program converts values of the digital switches to anal
7 - 26 MEMO
8 - 1 CHAPTER 8 SIMULATION FUNCTION 8.1 Simulation Function The simulation function is for debugging a sequence program using the virtual program
8 - 2 8.3 Debugging with Example Program Use the following example for exercise. <<Example program>> Y70X0Y700K4Y80C0MOV14X1M0SM4
8 - 3 8.3.1 Monitoring and testing device status This section explains how to monitor device status, turn bit devices on/off forcibly, and chan
2 - 2 Monitoring/debugging Created sequence programs can be written to the programmable controller CPU and device values at operation can be moni
8 - 4 (2) Changing the word device value In the example operation below, the word device value "C0" is changed to "5". 1) C
9 - 1 CHAPTER 9 MAINTENANCE 9.1 Typical Trouble The following bar graph shows the ratio of faulty parts and causes of programmable controller err
9 - 2 9.2 Maintenance To keep programmable controllers in the best operating condition, conduct the following daily inspection and periodic inspe
9 - 3 (2) Periodic inspection The following table lists the items that must be inspected one or two times every half year to a year. When the equi
9 - 4 9.4 Service Life of Output Relay The output relays of the modules are consumed by the switching operation. A relay which is directly moun
9 - 5 9.5 Spare Product Alternative products are easily purchased through Mitsubishi service centers or local Mitsubishi representatives in Japan
9 - 6 (7) Spare product Table 9.3 Spare products Product name Quantity Remark 1 Battery One or two Storage lives of lithium batteries are abou
9 - 7 9.6 Using Support Equipment The following shows examples of support equipment in which programmable controller-used systems or devices auto
9 - 8 3. Displaying the contents of the detected error on the screen The errors details of the programmable controller can be displayed on an exte
App. - 1 APPENDIX Appendix 1 I/O Control Mode The CPU supports two types of I/O control modes; the direct mode and refresh mode. Appendix 1.1
2 - 3 2.1 Features of GX Works2 This section explains the features of GX Works2. (1) Project types in GX Works2 In GX Works2, the project type
App. - 2 Appendix 1.2 Refresh mode In the refresh mode, all changes caused in an input module are imported to the input data memory in a programm
App. - 3 Appendix 1.3 Comparisons between the direct mode and refresh mode In the example ladder given below, turning on input X0 turns on outp
App. - 4 Appendix 2 Special Relay The special relay (SM) is an internal relay whose application is fixed in the programmable controller. For this
App. - 5 Appendix 3 Special Register The special register (SD) is an internal register whose application is fixed in the programmable controller.
App. - 6 Appendix 4 Application Program Example Appendix 4.1 Flip-flop ladder (1) Y70 turns on when X0 is turned on, and turns off when X1 is
App. - 7 (3) The flip-flop operation starts when X2 is turned on. In this operation, Y70 turns on if the timer T0 is on, and Y71 turns on if the
App. - 8 Appendix 4.2 One shot ladder (1) Output starts and continues for a certain time after the input X1 is turned on. (Time for the inpu
App. - 9 Appendix 4.3 Long-time timer (1) Necessary time is obtained by connecting timers in serial. T9X2T9053000.0sec.2000.0sec.Turns on after
App. - 10 Appendix 4.4 Off delay timer MELSEC-Q does not provide off delay timers. Configure an off delay timer as follows. (1) The timer T6
App. - 11 Appendix 4.5 On delay timer (momentary input) An on delay timer of a programmable controller operates easily with a continuous input.
2 - 4 (2) Enhanced use of program assets Projects created with existing GX Developer can be utilized in a Simple project. Utilizing the past asset
App. - 12 Appendix 4.6 ON-OFF repeat ladder In an ON-OFF repeat ladder, Y70 turns on when X1 is turned on, and turns off when X1 is turned on a
App. - 13 Appendix 4.8 Ladders with a common line The following ladder cannot be operated as it is. To make such ladders controllable, use mast
App. - 14 Appendix 4.9 Time control program The time value is set in the two digits of a digital switch. The currently elapsed time is displaye
App. - 15 Appendix 4.10 Clock ladder The clock data such as hour, minute, and second is output to a digital display. Project name QA-3 Program
App. - 16 Appendix 4.10.1 Clock function (supplement) The following ladder displays the time setting set in GX Works2 to the Q demonstration ma
App. - 17
App. - 18 Appendix 4.11 Starting - operation of electrical machinery Turning on the start switch starts the operation. After the operatio
App. - 19 Appendix 4.12 Displaying elapsed time and outputting before time limit The following ladder outputs the time elapsed in the timer on
App. - 20 Appendix 4.13 Retentive timer The input X2 switches between on and off continuously. The on-time of X2 is accumulated and Y72 turns on
App. - 21 Appendix 4.14 Switching timer set value externally (1) With an external switch, a value to be set in one timer can be selected from
2 - 5 (4) Wide variety of programming languages The wide variety of programming languages available with GX Works2 enables to select the optimum p
App. - 22 Appendix 4.15 Setting counters externally With an external digital switch having 4 digits, a counter can be set remotely and their cu
App. - 23 Project name QA-4 Program name MAIN X0M0D1K100-012Outputs error when set value is 100 or lessD1D0MOVD2D0MOVD2K50-SettingReads set val
App. - 24 Appendix 4.16 Measuring operation time Setting an operation time to a control target is useful for judging the timing of a component
App. - 25 Appendix 4.18 Application example of (D) C M LComplement (P) The following explains how to obtain absolute values of negative values
App. - 26 Appendix 4.19 Program showing divided value of 4-digit BIN value to 4 places of decimals (1) Example 1 The program displays the opera
App. - 27 Sequence program of example 1 The FOR-NEXT instruction is executed to divide each decimal place individually and 4 decimal places are di
App. - 28 (2) Example 2 In example 2, D0 is divided by D1 to obtain D5 in 4 decimal places. The dividend D0 is multiplied with 10000. The result o
App. - 29 Appendix 4.20 Carriage line control The following is an example of a sequence control using a carriage to convey works (materials). S
App. - 30 Project name QA-10 Program name MAIN Y700M1PLSX0 M2X1 X3Y70M1Y71 X2Y71SETY71RSTY73SETT0Y73K30T0Y73RSTY74SETY74 X4Y74RSTY72SETY72 X3Y7
App. - 31 Appendix 4.21 Compressor sequential operation using ring counters This system provides pressure control using three compressors. A pr
SAFETY PRECAUTION (Always read these instructions before using the products.) When designing the system, always read the relevant manua
2 - 6 (b) The screen layout can be customized to the user's preference The docking windows enable to change the screen layout of GX Works2 wi
App. - 32 Operation explanation (1) The pressure switches (X2, X3, and X4) are initially off. In this state, turning on the start switch (X0) act
App. - 33 Project name QA-11 Program name MAIN M00X0 X1M0X4 Y76Y75During operationIndicates pressure statusTurns on M9 at startupShifts by pres
App. - 34 After the basic operation, one compressor is activated in reaction to pressure shortage detected. To use the three compressors equally,
App. - 35 Appendix 4.22 Application example of positioning control The following is an example of a positioning system with a pulse generator tha
App. - 36 Appendix 4.23 Application example using index Z (1) The number of manufactured products is counted every day in one month cycle, and
App. - 37 Project name QA-7 Program name MAIN C5SM410C6X0Y070M2M3SM400 (always ON)C5C6X7K4Y40D0Z0BCDD33C6MOVC6C5-PC5RSTRSTRST051643465779Digita
App. - 38 Appendix 4.24 Application example of FIFO instruction Manual coating work and its working time can be stored and duplicated by machiner
App. - 39 Operation pattern from manual to automatic operation Teaching panelCoating bathX00 = Manual right moving buttonX01 = Manual left moving
App. - 40 Project name QA-9 Program name MAIN Y730SM403FMOV K0 D0 K505X6> D10 K0M2 SM403X7Y73M3M4M5M6M4M6M118>= KO D10 M2> K2Y74 K2X20
App. - 41 Appendix 4.25 Application example of data shift Works are conveyed along with their code numbers, and the data register of the proces
2 - 7 2.1.1 MELSOFT iQ Works MELSOFT iQ Works integrates the engineering software (GX Works2, MT Developer2, and GT Designer3). Sharing the design
App. - 42 Project name QA-12 Program name MAIN Y70X0Y70SM400 (always ON)X2M1Y70Y700481253Machinery AX194D30K1X20MOVK6D30DSFLPM2M3M4M5M6M7M8M11
App. - 43 M31Y70Y70135176Machinery D217M32M33M34M35M36M37M38M41M42M43M44M45M46M47M48M51M52M53M54M55M56M57M58Y70D33K1=K2=K3=K4=K5=K6=K7=K8=D34K1=K2
App. - 44 Project name QA-14 Program name MAIN Appendix 4.26 Example of operation program calculating square root of data The data stored in
App. - 45 Project name QA-15 Program name MAIN Appendix 4.27 Example of operation program calculating n-th power of data A value stored in D
App. - 46 Appendix 4.28 Program using digital switch to import data When a set value of the digital switch is always input and stored to D10 of
App. - 47 Appendix 4.29 Displaying number of faults and fault numbers using fault detection program The following program sequentially displays
App. - 48 Project name QA-31 Program name MAIN F3X20F5X24F8X28F13X2CF33X30F35X34F37X38F39X3CF1X4F11X5F16X6F40X7X2M700M500X000M500M600D10K8F1DSU
App. - 49 M100X1M300M800103120125144150164M200M700SM700Z0K32=Z0K50=K1D0SETZ0INCK4Y60Z0BCDM300PLSM100RSTD10K1-K4Y40D10BCDM600SETM200RSTK4Y60MOVPK0M
App. - 50 1 11 1 10 0 0 00 0 11 1 1 1 1 10 0 1 0 0 10 00 000110 0 00 00 01 1 11 10 0 00 0000 0101 0 00001 01F16F1F48F33F32F17F64F49F5016 16723D10D
App. - 51 Appendix 5 Memory and File to be Handled by CPU Module Data to be stored in memories The following table lists the data and drive
2 - 8 [Purpose of the engineering environment] NetworkMES(Manufacturing Execution System)ERP(Enterprise Resource Planning) Integrating development
App. - 52 Memory capacities and necessity of formatting The following tables list the memory capacities and necessity of formatting of each mem
App. - 53 Appendix 6. Comparison with GX Developer (changes) (1) Supported CPU modules The following table lists the CPU modules that are supp
App. - 54 (2) Unsupported features The following table lists the features that are not supported in GX Works2. Use GX Developer, GX Simulator, or
App. - 55 (3) Supported project types The following table lists the project types that are supported in GX Works2. Project type Description Sim
App. - 56 (4) Programming languages supported by each project type The following table lists the programming languages that are supported by each
App. - 57 (b) Using SFC (MELSAP3) language Before using the SFC (MELSAP3) language in GX Works2, review the following precautions. Description (
App. - 58 (d) Using function blocks Before using function blocks in GX Works2, review the following precautions. Function Description Use funct
App. - 59 (7) Using device initial values Before using device initial values in GX Works2, review the following precautions. Description (diffe
App. - 60 (9) Using monitor/debug function Before using the monitor/debug function in GX Works2, review the following precautions. Function Descr
App. - 61 (13) Compatibility with GX IEC Developer For the compatibility between GX IEC Developer and GX Works2, review the following precautions.
2 - 9 2.2 Basic Knowledge Required for Operating GX Works2 2.2.1 Screen configuration in GX Works2 3) Toolbar9) Status bar5) View contents d
App. - 62 Appendix 7 Customizing Shortcut Keys Shortcut keys of each function can be customized. Customized shortcut keys can be registered as
App. - 63 Screen button Assigns the shortcut key. The assigned shortcut key is displayed in "Current Key". Deletes the shortcut key s
App. - 64 Appendix 8 Indexing In the Universal model QCPU (excludes Q00UJCPU), expanding the index register to 32 bits enables the indexing for a
App. - 65 (c) Device for which indexing can be used Indexing can be used only for the devices shown below. • ZR: Serial number access format file
App. - 66 (2) When specifying the 32-bit indexing using "ZZ" specification (a) One index register can specify 32-bit indexing using &q
App. - 67 (e) The following shows an example of the 32-bit indexing with "ZZ" specification and the actual processing device. (When Z0 (
App. - 68 Appendix 9 FB Appendix 9.1 FB FB is an abbreviation for a Function Block that is designed to convert a ladder block, which is used repe
App. - 69 Appendix 9.1.2 Advantages of using FBs This section introduces advantages of creating programs by using FBs. (1) Easy programming A
App. - 70 (3) Reusing Converting a standard program into a component allows the program to be reused any number of times. As a result, operations
App. - 71 (5) Protecting assets By setting up a block password, the created FB can be protected so that it cannot be viewed. Sequence program rela
2 - 10 1) Title bar Title bar displays the name of the active project. Resizes or terminates GX Works2.Displays the name and the path of the proje
App. - 72 <Example of partner product> FBs for partner productsVisionsensorFB FB FBRFIDCC-LinkEthernetLaserdisplacementsensorVision sensor
App. - 73 Appendix 9.1.4 Development tool GX Works2 (Simple project) ver 1.12N or later is required to develop sequence programs using FBs. POIN
App. - 74 Appendix 9.2 Creating a program by using an FB library This section explains the procedure to create a program by using an FB library
App. - 75 Appendix 9.2.2 Preparations prior to use of FB libraries Before using an FB library, contact your distributor to obtain it. (FB libra
App. - 76 Appendix 9.2.3 Importing an FB library to projects This section explains how to import an FB library for analog input module (Q64AD)
App. - 77 Appendix 9.2.4 Pasting FBs Drag and drop FBs to be pasted to the program window from the Project view or Selection window. (Drag and dro
App. - 78 Appendix 9.2.5 Setting names of the pasted FBs When an FB library is pasted to the program window, a dialog to input a name of the pa
App. - 79 Appendix 9.2.6 Creating input and output ladders Create the input ladder section and the output ladder section of the pasted FB to comp
App. - 80 Appendix 9.2.8 Writing sequence programs For the procedure to write sequence programs, refer to section 2.7 (1) "Writing data to
2 - 11 2.2.2 Ladder editor This section explains the screen display of the GX Works2 ladder editor and its basic operations. (1) Edit screen (
2 - 12 (3) Changing the text size on the edit screen The text size displayed on the edit screen can be changed. 1) Select [View] → [Text Size] →
2 - 13 (5) Setting the number of rows and columns for displaying comments The option setting allows switching the number of rows and columns for
2 - 14 (From the previous page) Set the number of display rows in the range from 1 to 4.Set the number of display columns to 5 or 8.Example) 4 r
2 - 15 (6) Setting the number of contacts to be displayed in ladder programs The option setting allows switching the number of contacts to be dis
REVISIONS *The textbook number is written at the bottom left of the back cover. Print date *Textbook number Revision Oct., 2012 SH-081123ENG-
2 - 16 (7) Switching the label name display and device display The display of a program that uses labels can be switched between the label name d
2 - 17 (8) Hiding a ladder block The ladder block after the ladder conversion can be hidden. The ladder block in which the statements are set is
2 - 18 (From the previous page) The ladder block is hidden.3) The selected ladder blocks are hidden. (b) Canceling the hidden ladder block.
2 - 19 (From the previous page) The hidden ladder blocks are displayed.3) The hidden ladder blocks are displayed. POINT Displaying/hiding
2 - 20 2.2.3 Project This section explains the configurations of a project that is displayed in a tree format in the Project view. The display co
2 - 21 1) One project per GX Works2 One GX Works2 can edit only one project unit. To edit two or more projects at a time, run as many GX Works2 a
2 - 22 2.3 Operation Before Creating Ladder Program 2.3.1 Starting up GX Works2 1) Click the button. 2) Select [All Programs]. 3) Select
2 - 23 2.3.2 Creating a new project 1) Click on the toolbar or select [Project] → [New Project] (Ctrl+N). 2) Click the "Project Type&qu
2 - 24 6) Click the "PLC Type" list button. 7) The "PLC Type" list is displayed. Select "Q06UDH". 8) Click the
2 - 25 2.4 Preparation for Starting Up CPU Setting switches and formatting the built-in memory are required before writing a program to the CPU.
(1) CONTENTS CHAPTER 1 BASICS OF PROGRAMMABLE CONTROLLER 1- 1 to 1-14 1.1 Program······························································
2 - 26 (4) Setting the connection destination This section explains how to set the connection destination for accessing the programmable controll
2 - 27 (From the previous page) 6) Click! 6) The PLC side I/F Detailed Setting of PLC Module dialog box is displayed. Select "QCPU (Q mode
2 - 28 (5) Formatting the built-in memory of the CPU This section explains how to format the program memory of the QCPU. 1) Click! 1) Click [On
2 - 29 (6) Clearing all the device memory from the CPU This section explains how to clear the device memory of the QCPU. 1) Click! 1) Click [Onl
2 - 30 (7) Clearing the error history in the CPU This section explains how to clear the error history data stored in the QCPU. 1) Click! 1) Cli
2 - 31 (8) Setting the clock on the programmable controller CPU Setting a year, month, date, time, minute, second, and day of the week to the clo
2 - 32 2.5 Creating Ladder Program 2.5.1 Creating a ladder program using the function keys Follow the steps below to create the ladder program
2 - 33 9) The entered symbol (Y70) is displayed. 10) Press the F6 key, and enter "Y70". 11) Press the Enter key to confirm the entr
2 - 34 2.5.2 Creating a ladder program using the tool buttons Follow the steps below to create the ladder program as shown on the left. 1) Cli
2 - 35 9) The entered symbol (Y70) is displayed. 10) Click on the toolbar, and enter "Y70". 11) Click the OK button. 12) The en
(2) CHAPTER 4 SEQUENCE AND BASIC INSTRUCTIONS -PART 1- 4- 1 to 4-42 4.1 List of Instruction Explained in this Chapter··························
2 - 36 2.6 Converting Program (Ladder Conversion) 1) Click! 1) Click [Compile] → [Build] ( F4 ). 2) The ladder program has been converted.
2 - 37 2.7 Writing/Reading Data to/from Programmable Controller CPU (1) Writing data to the CPU 2) Set the switch to "STOP"! 1) S
2 - 38 7) The progress dialog box is displayed. (From the previous page) 8) Click! 8) The message "Completed" is displayed when the w
2 - 39 (2) Reading data from the CPU 1) Click! 1) Click on the toolbar or click [Online] → [Read from PLC]. 2) Select a program to be read
2 - 40 2.8 Monitoring Ladder Program Status 1) Suppose that the ladder program (sequence program) has been written into the programmable cont
2 - 41 (1) In the monitor mode, the Monitor Status dialog box shown below is displayed regardless of the monitor status. 1) 2) 5)3) 4) 1) Conne
2 - 42 (3) Ladder conversion during the monitoring This section explains the procedure to convert Y70 into Y72 during the monitoring. 1) Double-
2 - 43 2.9 Diagnosing Programmable Controller CPU 1) Click! 1) Click [Diagnostics] → [PLC Diagnostics]. 2) The PLC Diagnostics screen is dis
2 - 44 Item Description 1) Monitor Status Displays the current monitor status. 2) Connection Channel List Displays the connection route which h
2 - 45 2.10 Editing Ladder Program 2.10.1 Modifying a part of the ladder program This section explains how to modify a part of the ladder progr
(3) CHAPTER 6 HOW TO USE OTHER FUNCTIONS 6- 1 to 6-36 6.1 Test Function at Online······························································
2 - 46 3) The Enter Symbol window is displayed. (From the previous page) 3) The Enter Symbol window is displayed!4) Enter "Y72"!5) Clic
2 - 47 2.10.2 Drawing/deleting lines (1) Drawing lines This section explains how to add a line to the ladder program shown on the left. 1) Click
2 - 48 4) Click on the toolbar, and enter "Y73". 5) Click the OK button. (From the previous page) 6) The symbol is displayed!4
2 - 49 (2) Deleting lines Perform the following steps to delete the line from the ladder shown on the left. 1) Click ( Alt + F9 ) on the toolbar
2 - 50 2.10.3 Inserting/deleting rows (1) Inserting rows This section explains how to add a row to the ladder program shown on the left. 1) Clic
2 - 51 3) Select the [Edit] → [Insert Row] ( Shift + Ins ). 4) A new row is inserted above the selected row. (From the previous page) 4) A new
2 - 52 7) The entered symbol (X7) is displayed. 8) Click on the toolbar, and enter "Y77". 9) Click the OK button. (From the pr
2 - 53 (2) Deleting rows This section explains how to delete the row from the ladder program shown on the left. 1) Click on any point of the row
2 - 54 3) Select the [Edit] → [Delete Row] ( Shift + Del ). (From the previous page) 4) The row is deleted!3) Click!4) The selected row is del
2 - 55 2.10.4 Cutting/copying ladder program This section explains how to copy and cut the ladder program shown on the left. 1) Click on the sta
(4) CHAPTER 8 SIMULATION FUNCTION 8- 1 to 8- 4 8.1 Simulation Function·········································································
2 - 56 4) Click on the start point of the ladder program to be copied to move the cursor. 5) Drag the mouse over the ladder to specify the area
2 - 57 8) Click on the toolbar or select [Edit] → [Paste] ( Ctrl + V ) to paste the cut or copied area. (From the previous page) 9) Completed!
2 - 58 2.11 Verifying Data This section explains how to verify the open project against the data on the programmable controller CPU. The verifica
2 - 59 2.12 Saving Ladder Program 2.12.1 Saving newly-created or overwritten projects 1) Click on the toolbar or select [Project] → [Save] (
2 - 60 POINT • Workspace Workspace enables GX Works2 to manage several projects with one name. • When the save destination exists When the save
2 - 61 2.13 Reading the saved project 1) Click on the toolbar or select [Project] → [Open] ( Ctrl + O ). 2) Specify the location where the
2 - 62 2.14 Opening Projects in Different Format This section explains how to open a project created with GX Developer in GX Works2. 1) Cli
2 - 63 POINT • Status after a project in a different format are opened When a project in a different format is opened, the project is in the unc
2 - 64 MEMO
3 - 1 CHAPTER 3 DEVICE AND PARAMETER OF PROGRAMMABLE CONTROLLER 3.1 Device A device is an imaginary element for programming in the programmable c
(5) 4.25 Application example of data shift························································································App.-41 4.26 Ex
3 - 2 Type Description Remark FD Function register Register for the exchange data between a subroutine call source and a subroutine program Z Index
3 - 3 3.2 Parameter The parameters are basic setting values applied to a programmable controller in order to control objects as planned. The param
3 - 4 Item Description Boot option Sets whether to clear the program memory when booting up. Boot file Boot file setting Sets the type, data n
3 - 5 • When GX Works2 starts, it employs the preset values as the parameters. These values are called the default (initial values). • The program
3 - 6 MEMO
4 - 1 CHAPTER 4 SEQUENCE AND BASIC INSTRUCTIONS -PART 1- 4.1 List of Instruction Explained in this Chapter This chapter explains the sequence
4 - 2 <List of instructions not explained in this chapter: part 1> "Introduction: PLC Course" covers the instructions shown below.
4 - 3 <List of instructions not explained in this chapter: part 2> The instructions listed below are intended for the Q series and not suppo
4 - 4 4.2 Differences between OUT and SET / RST Project name QB-1 Program name MAIN OUT instruction Y70X00 • The OUT instruction t
4 - 5 4.3 Measuring Timer Project name QB-3 Program name MAIN K30Timer setting value (time limit: 3.0sec.)T0Y70Y71X5T0T0057 *: OUT T is a 4-s
Commenti su questo manuale