Mitsubishi Electric MELSEC iQ-F Series Training Manual

Fx5u
Hide thumbs Also See for MELSEC iQ-F Series:

Advertisement

MELSEC iQ-F
FX5U User's Manual (Hardware)
FX5U Training Maunal
MELFT

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC iQ-F Series

  • Page 1 MELSEC iQ-F FX5U User's Manual (Hardware) FX5U Training Maunal MELFT...
  • Page 2 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 3 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 4 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 5 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 6 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 7 COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED COPYRIGHT © 2016 MITSUBISHI ELECTRIC FACTORY AUTOMATION (THAILAND) ALL RIGHTS RESERVED...
  • Page 8                                         ...
  • Page 9   ...
  • Page 10 Program processing sequence A CPU module executes operations in series from the start step of the program memory from left to right and from top to bottom (in the order of 1), 2) ... and 17)) in units of a ladder block as shown below. 1 BASICS OF A PROGRAMMABLE CONTROLLER 1 - 5 1.2 Program...
  • Page 11 OUTLINE Part Names Front panel [10] [11] Name Description DIN rail mounting hooks Hook for mounting the CPU module on a DIN rail of DIN46277 (35 mm wide). Expansion adapter connecting When connecting an expansion adapter, secure it with these hooks. hooks Terminal block cover Cover for protecting the terminal block.
  • Page 12 With cover open [10] Name Description Built-in RS-485 communication Terminal block for connection with RS-485-compatible devices terminal block RS-485 terminal resistor selector Switch for switching terminal resistance for built-in RS-485 communication. switch RUN/STOP/RESET switch Switch for operating the CPU module. (Page 151 Methods of running, stopping, and resetting) RUN: Runs the program STOP: Stops the program RESET: Resets the CPU module (hold the switch on the RESET side for approximately 1 second.)
  • Page 13 Power Supply Specifications The CPU module power supply specifications are explained below. For the consumption current of extension modules, refer to Page 37 PRODUCT LIST or manuals of each extension module. AC power supply type Item Specifications Rated voltage 100 to 240 V AC Allowable supply voltage range 85 to 264 V AC Frequency rating...
  • Page 14 Input Specifications The CPU module input specifications are explained below. 24 V DC Input (sink/source) The input points in the table below indicate the CPU module terminal points. Item Specifications No. of input points FX5U-32M 16 points FX5U-64M 32 points FX5U-80M...
  • Page 16 Transistor output Item Output specifications No. of output points FX5U-32MT/ 16 points FX5U-64MT/ 32 points FX5U-80MT/ 40 points Connection type Removable terminal block (M3 screws) Output type FX5U-MT/S Transistor/sink output FX5U-MT/SS Transistor/source output External power supply 5 to 30 V DC Max.
  • Page 17 Performance Specifications Item Specification Control system Stored-program repetitive operation Input/output control system Refresh system (Direct access input/output allowed by specification of direct access input/output [DX, DY]) Programming Programming language Ladder diagram (LD), structured text (ST), function block diagram/ladder diagram (FBD/LD) specifications Programming extension function Function block (FB), function (FUN), label programming (local/global)
  • Page 18 Number of device points Item Base Max. number of points No. of user device Input relay (X) 1024 points The total number of X and Y assigned to input/output points is up to points 256 points. Output relay (Y) 1024 points Internal relay (M) 32768 points (can be changed with parameter) Latch relay (L)
  • Page 19 Built-in Analog Specifications The analog input/output specifications of the built-in analog function are explained below. For details on the analog built-in function, refer to MELSEC iQ-F FX5 User's Manual (Analog Control). Analog input Item Specifications Analog input points 2 points (2 channels) Analog input Voltage 0 to 10 V DC (input resistance 115.7 kΩ)
  • Page 20 Communication Specifications The built-in Ethernet and built-in RS-485 communication specifications are as explained below. Built-in Ethernet communication For details of built-in Ethernet communication, refer to the following. MELSEC iQ-F FX5 User's Manual (Ethernet Communication) MELSEC iQ-F FX5 User's Manual (SLMP) Item Specifications Data transmission speed...
  • Page 21 Built-in RS-485 communication For details of built-in RS-485 communication, refer to the following. MELSEC iQ-F FX5 User's Manual (Serial Communication) MELSEC iQ-F FX5 User's Manual (MELSEC Communication Protocol) MELSEC iQ-F FX5 User's Manual (MODBUS Communication) Item Specifications Transmission standards Conforms to RS-485/RS-422 specifications Data transmission speed Max.
  • Page 22 2.10 Terminal Layout Built-in RS-485 terminal European type terminal block 5 poles Built-in analog terminal European type terminal block 5 poles Analog Analog input output Built-in Ethernet connector Signal name TXD+ TXD- RXD+ Not used Not used RXD- Not used Not used 2 SPECIFICATIONS 2.10 Terminal Layout...
  • Page 23 Power, input/output terminal block ■Interpretation of terminal block layout Power supply 24 V DC service [•] Vacant terminal (Do not use) Input terminal terminals power supply S/S 0 V 24 V Output terminals FX5U-32MR/ES connected to COM3 COM0 3 COM1 COM2 COM3 Common terminal...
  • Page 24 Input wiring example Sink input [AC power supply type] FX5U-32MT/ES Fuse Class D grounding Three-wire sensor Input Input terminal impedance 5V 0V 24V FX5-16EX/ES Two-wire proximity sensor 5V 0V 24V Input terminal FX5-16EX/ES 24 V DC Three-wire 5V 0V 24V sensor Input terminal...
  • Page 25 Source input [AC power supply type] FX5U-32MT/ESS Fuse Class D grounding Three-wire sensor Input Input impedance terminal 5V 0V 24V Two-wire FX5-16EX/ES proximity sensor 5V 0V 24V Input terminal FX5-16EX/ES 24 V DC Three-wire sensor 5V 0V 24V Input terminal *1 Handle the power supply circuit properly in accordance with "Power Supply Wiring."...
  • Page 30 Analog Wiring Wiring to the built-in analog I/O terminals of the CPU module is explained below. For specifications of the built-in analog I/O terminals of the CPU module, refer to Page 30 Built-in Analog Specifications. Analog input wiring CH Shield 82.7 k...
  • Page 31 OPERATING GX Works3 This chapter describes the basic operations of GX Works3. GX Works3 is an engineering tool for setting, programming, debugging, and maintenance of projects for the MELSEC iQ-R  series programmable controllers and others on Windows Compared with GX Works2, the functionality and operability of GX Works3 have been improved. For changes in the window display, refer to the following.
  • Page 32 Setting parameters Users can set parameters for CPU modules, I/O modules, and intelligent function modules. Reading/writing data from/to the CPU module Users can read/write created sequence programs from/to the CPU module by using the "Write to PLC" and "Read from PLC" functions.
  • Page 33 Diagnostic function GX Works3 make diagnoses on the current error status and error history of the CPU module or network. With the diagnostic function, system recovery can be completed in a short time. The system monitor shows detailed information on intelligent function modules and others. This feature helps users to shorten the time taken for system recovery when an error occurs.
  • Page 34 Operations Before Creating a Ladder Program 2.2.1 Starting GX Works3 Operating procedure  Select [MELSOFT]  [GX Works3]  [GX Works3] from the Windows Start menu   *1 Select [Start] [All apps] or [Start] [All Programs]. Figure 2.1 Startup window of GX Works3 2 OPERATING GX Works3 2 - 4 2.2 Operations Before Creating a Ladder Program...
  • Page 35 Precautions • When mounting or removing the SD memory card while the power is ON, follow the above-mentioned procedure. Otherwise, the data in the card may become corrupted. • When removing an SD memory card which is being accessed by a function, the CARD LED is turned OFF after the access is completed.
  • Page 36 Connecting a Personal Computer Connect the CPU module to a personal computer that has an engineering tool installed. For details on the system configuration examples and GX Works3 settings, refer to the following manual. MELSEC iQ-F FX5U User's Manual (Hardware) MELSEC iQ-F FX5UC User's Manual (Hardware) When Ethernet cable is used (direct connection) Connect a personal computer directly to the CPU module, following the procedure below.
  • Page 37 When Ethernet cable is used (connection via a hub) To connect to Ethernet via a hub, setting of both the personal computer and the CPU module is required. Connect a personal computer to the CPU module via a hub, following the procedure below. Setting the CPU module ■Setting module parameters From the engineer tool, set on the “Module Parameter Ethernet Port”...
  • Page 38 Engineering tool settings From the engineer tool, this is done on the “Specify Connection Destination Connection” window. Select “Online”  [Current Connection Destination] . Select "Ethernet Board" for "PC side I/F"(1). Select "PLC Module" for "PLC side I/F"(2). Input the CPU IP address or host name in the “PLC side I/F Detailed Setting of PLC Module”...
  • Page 39 When RS-232C cable is used Connect a personal computer directly to the CPU module, following the procedure below. Connect a personal computer to the CPU module using the RS- 232C cable. Select [Online]  [Current Connection Destination] on the menubar of the engineering tool. Click the [CPU Module Direct Coupled Setting] button (1) on the "Specify Connection Destination Connection"...
  • Page 40 2.3.7 Setting the clock of the CPU module The year, month, day, hour, minute, second, and day of week can be set to the clock element of the CPU module. To use the clock function, use GX Works3 or a program. Set the clock and read the setting with GX Works3.
  • Page 41 Creating a Ladder Program Operating procedure This section describes how to create a ladder A ladder program to be created program such as the one shown on the left. X102 X100 • Use only one-byte characters. Y170 Two-byte characters cannot be used. Y170 X103 Y171...
  • Page 42 2.4.1 Creating a ladder program by entering devices and labels Operating procedure Move the cursor to the position where a ladder is added, and enter "X102". (When entering of the number starts, the ladder input window appears.) Press the To cancel an incorrect entry, press the  Enter key! key.
  • Page 43 (From the previous page) Move the cursor to the next position and enter "Y170". Press the Enter key! Press the  key. Enter the I/O number! The added symbol ( ) is displayed. Y170 The symbol is displayed! Move the cursor to the next position, enter "Y170", and select "Open Branch".
  • Page 44 (From the previous page) X103 The added symbol ( ) is displayed. The symbol is displayed! Move the cursor to the next position and enter "Y171". Press the Enter key! Press the  key. Enter the I/O number! The added symbol ( ) is displayed.
  • Page 45 2.4.2 Creating a ladder program with function keys Operating procedure Press the  key to open the ladder input window, and enter "X102". To cancel an incorrect entry, press the  key. Press the Enter key! To confirm the entry, press the  key. Press the F5 key and enter "X102"! •...
  • Page 46 (From the previous page) The added symbol ( ) is displayed. Y170 The symbol is displayed! Press the  key and the  key and enter "Y170". Press the  key after entering the device number. Press the Enter key! Press the Shift and F5 keys and enter "Y170"! Y170...
  • Page 47 (From the previous page) The added symbol ( ) is displayed. Y171 The symbol is displayed! Creating a ladder program is completed. 2 OPERATING GX Works3 2 - 26 2.4 Creating a Ladder Program...
  • Page 48 2.4.3 Creating a ladder program with tool buttons Operating procedure Click on the toolbar to open the ladder input window, and enter "X102". To cancel an incorrect entry, press the  Press the key. Enter key! To confirm the entry, press the  key. •...
  • Page 49 (From the previous page) The added symbol ( ) is displayed. Y170 The symbol is displayed! Click on the toolbar and enter "Y170". Press the Press the  key. Enter key! Click and enter the I/O number! Y170 The added symbol ( ) is displayed.
  • Page 50 (From the previous page) The added symbol ( ) is displayed. Y171 The symbol is displayed! Creating a ladder program is completed. 2 OPERATING GX Works3 2 - 29 2.4 Creating a Ladder Program...
  • Page 51 Converting the Program Compile the input ladder blocks. Procedure Select [Convert]  [Convert] on the menu bar. When the conversion processing completes and the input ladder blocks are compiled, the color of those ladder blocks changes from gray to white. Saving the Project Save the created project.
  • Page 52 4.11 Resetting the CPU Module Reset the CPU module using the RUN/STOP/RESET switch located on the front of the CPU module. Procedure The following illustration is an example of the FX5U CPU module. Set the RUN/STOP/RESET switch (1) to the RESET position for a second or longer.
  • Page 53 4.13 Monitoring the Program Monitor the program operation using the engineering tool. Monitoring on the monitor status bar The LED status of the CPU module and the scan time can be monitored on the monitor status bar. Select [Online]  [Monitor]  [Start Monitoring] on the menu bar.
  • Page 54 Monitoring on the ladder editor The on/off states of contacts and coils and the current values of word devices and labels can be monitored on the ladder editor. (1) The on/off states of the contacts and coils are displayed. (2) The current value of the word/double word type data is displayed.
  • Page 55 Reconnect the modules and wire one by one to identify the cause. If the PWR LED still does not turn on even after the items shown above are checked, there may be a hardware issue. Consult your local Mitsubishi Electric representative. Checking the BAT LED If the BAT LED is turned on, check the following items.
  • Page 56 Troubleshooting using the engineering tool Check the error or history using the engineering tool, and identify the error cause. More detailed information on the error as well as the error cause and action to be taken can be checked by using the engineering tool. The engineering tool has the following functions for troubleshooting.
  • Page 59 6.1.1 Forced on/off of the device (Y) Set the CPU module to the STOP state before this operation. Select the "Y170" cell on the ladder editor and click [Debug] → [Modify Value] from the menu. Clicking the menu forcibly turns on or off "Y170". Click! Checking with the demonstration machine Check that clicking the menu switches the on/off status of Y170 and the LED of Y170 on the demonstration machine also...
  • Page 60 Editing a Ladder Program 2.9.1 Modifying a part of a ladder program Operating procedure This section describes how to modify a part of the A ladder program to be created ladder program shown on the left. (OUT Y171 → OUT Y172) X102 X100 Y170...
  • Page 61 (From the previous page) The device can be modified. Modify the device to "Y172", and press the  key. Correct the output number and press the Enter key! The ladder program after the modification is displayed. To change only the device number, click the F2 key.
  • Page 62 Online Change This section describes how to change a program while the CPU module is in the RUN state. This function allows users to write a program even while the CPU module is in the RUN state. Set the CPU module to the RUN state before this operation. Change the device! Change the ladder.
  • Page 63 2.9.2 Drawing a line Operating procedure This section describes how to draw a line in the A ladder program to be created ladder program shown on the left. X102 X100 Y170 Y170 Y173 X103 Y172 Move the mouse pointer close to the exiting line, and click the displayed icon.
  • Page 64 (From the previous page) Click on the toolbar and enter "Y173". Click! Click the [OK] button. Click and enter the I/O number! The added symbol ( ) is displayed. Y173 The symbol is displayed! Click [Convert] → [Convert] () from the menu to convert the ladder program.
  • Page 65 2.9.3 Deleting a line Operating procedure This section describes how to delete a line in the A ladder program to be created ladder program shown on the left. X102 X100 Y170 Y170 Y173 X103 Y172 Move the mouse pointer close to the exiting line, and click the displayed icon.
  • Page 66 2.9.4 Inserting a row Operating procedure This section describes how to insert a row in the A ladder program to be modified ladder program shown on the left. X107 Y177 X102 X100 Y170 Y170 X103 Y172 Click and move the cursor on the row (desired position on the row) where a new row is inserted above.
  • Page 67 (From the previous page) A new row is inserted above the row. A new row is inserted! Click on the toolbar to open the ladder input window, and enter "X107". Click! Click the [OK] button to confirm the entry. Click and enter the I/O number! X107...
  • Page 68 2.9.5 Deleting a row Operating procedure This section describes how to delete a row in the A ladder program to be modified ladder program shown on the left. X107 Y177 X102 X100 Y170 Y170 X103 Y172 Click and move the cursor on the row (desired Click and move position on the row) to be deleted.
  • Page 69 2.9.6 Cutting or copying a ladder Operating procedure This section describes how to cut or copy a part of A ladder program to be modified the ladder program shown on the left and paste the X107 cut part or the copy of the part to any desired Y177 location in the ladder.
  • Page 70 (From the previous page) Click and the move the cursor to the position where a part of the ladder program is to be copied. Click and move the cursor! Drag the mouse to specify the copy range. The color of the specified range is highlighted. To easily specify the range in units of ladder blocks, Drag to specify click the position where a step number is displayed...
  • Page 71 2.10 Verifying Data This section describes how to verify the currently-opened project and the data stored in the CPU module. Perform this operation to check whether the projects are identical or to check changes in a program. Operating procedure Click [Online] → [Verify with PLC] from the menu.
  • Page 72 (From the previous page) Detailed results are displayed. Displayed! 2 OPERATING GX Works3 2 - 53 2.10 Verifying Data...
  • Page 73 Differences Between [OUT] and [SET]/[RST] This section describes the OUT and SET/RST instructions and the operation of a self-holding ladder. 4.2.1 [OUT] (Coil output) Project name RB-1 Program name MAIN X100 Y170 The OUT instruction turns on a specified device when the input condition turns on, and turns off the device when the condition turns off.
  • Page 74 4.2.2 [SET]/[RST](Setting/resetting devices) Project name RB-2 Program name MAIN X100 Y170 X101 Y170 The SET instruction turns on a specified device when the input condition turns on, and holds the on state of the device even though the condition turns off. To turn off the device, use the RST instruction.
  • Page 75 2.4 Self-holding Ladder A self-holding ladder holds the operation status of the coil by its contact. By configuring the sequence, the output status can be held or canceled. [Example of ladder diagram] [List program] Step Instruction Self-holding [Timing chart] [Sequence] When the input X0 is on and X1 is off, the output Y10 turns on.
  • Page 76 Measuring Timers (Timer, High-speed Timer, Retentive Timer) • This section describes how to input a timer. • This section describes the parameter setting for using a retentive timer. • This section describes the operation differences of various timers. Project name RB-3 Program name MAIN...
  • Page 77: Table Of Contents

    Appendix 4 Program Examples Appendix 4.1 Flip-flop ladder When X100 turns on, Y170 turns on. When X101 turns on, Y170 turns off. X100 Y170 X101 Y170 When X102 turns on, Y171 turns off if Y170 is on, or turns on if Y170 is off. This flip-flop operation is repeated. Project name RA-16 Program name...
  • Page 78 How to use retentive timers When an input condition turns on, the coil turns on and the value of a retentive timer starts increasing. When the current value becomes equal to a set value, the retentive timer goes timeout and the contact turns on. When the input condition turns off during the addition, the coil turns off but the current value is held.
  • Page 79: Appendix 5

    Appendix 5 Timer, Counter Appendix 5.1 Timer Function RCPU Low-speed timer Measurement • 100ms (default) unit The unit can be changed within the range of 1 to 100ms in parameters. Specification method High-speed timer Measurement • 10ms (default) unit The unit can be changed within the range of 1 to 100ms in parameters. Specification High-speed timer method...
  • Page 80 Counting with a Counter • This section describes how to input a counter. • This section describes the words "rise (rising edge)" and "fall (falling edge)". Project name RB-4 Program name MAIN Counter setting value X101 Y172 X107 *OUT C is a 4-step instruction. 4 SEQUENCE INSTRUCTIONS AND BASIC INSTRUCTIONS -PART 1- 4 - 9 4.4 Counting with a Counter...
  • Page 81 ■Timing chart • A counter counts at the rising edge of an input signal. Contact X101 • After counting is up, the counter does not count at the rising edges of the subsequent input signals. Coil C20 • Once counting is up, the contact status and the current value (count value of (Current counter value) the counter) do not change until the...
  • Page 82: App

    Appendix 4.3 Long-time timer Arrange timers in series to obtain necessary time. X102 K30000 3000.0 seconds K20000 2000.0 seconds Y172 Turn on this device after the time limit elapses. X102 Normally open contact T9 Normally open contact T10 2000 3000 seconds Y172 seconds 5000 seconds...
  • Page 83 [PLS] (Turning on a Specified Device for One Scan at the Rising Edge of an Input Condition) [PLF] (Turning on a Specified Device for One Scan at the Falling Edge of an Input Condition) • This section describes the concept of one scan. •...
  • Page 84: Y170

    Application • These instructions can be used in a standby program that waits for an operation condition. Execution command X100 Y170 Execution condition OUT T0 ■Timing chart X100 (Command) Y170 (Operation) 5 seconds Time to wait for conditions to be satisfied Execution condition 4 SEQUENCE INSTRUCTIONS AND BASIC INSTRUCTIONS -PART 1-...
  • Page 85: Set Y170

    • These instructions can be used in a program that detects the passage of moving objects. The program detects that products have passed through and starts the next processing for the products. X100 Y170 Product Detector Y170 Detector (Detection of input from X100) Conveyor ■Timing chart X100...
  • Page 86 Useful application of the PLS/PLF instructions (Part 2) These instructions can be used in a program that executes a repetitive operation such as switching the on/off status every time a push button switch (snap switch) is pressed. (If the PLS instruction is used in the program, the program is executed at the rising edge caused when the push button switch is pressed.
  • Page 89 Appendix 4.5 On delay timer (momentary input) An on delay timer of a programmable controller operates easily with a continuous input. The internal relay (M) is used with a momentary input. Project name RA-19 Program name MAIN X101 X102 The timer starts when X101 turns on.
  • Page 90 4.4.2 Sequence control example with self-holding function and PLF When executing a control target (process: JOB1) in sequence control, create "Operation memory 1" and create an actual control program with the condition of "Operation memory 1". "Operation memory 1"of the actual control program is reset with "Completed PLS1". To proceed to the next process, create "Next process PLF", which is a falling signal, to turn off "Operation memory 1"...
  • Page 91 4.6.3 Output to device (additional) Add auxiliary relays according to the device outputs. RY1 Conveyor leftward relay output RY1 leftward operation command M110 Conveyor leftward operation RY2 Conveyor rightward relay output RY2 rightward operation command M200 Conveyor rightward operation PL1 ON output PL1 ON command (for manual leftward operation) PL1 ON command...
  • Page 92 BASIC INSTRUCTIONS -PART 2- Notation of Values (Data) • This section describes decimal, binary, and hexadecimal notations. • This section describes a method of interconversion. The programmable controller CPU converts all information into on or off signals (logical 1 or 0) to store and process them. Thus, the programmable controller executes numerical operations using the numerical values stored as logical 1 or 0 (binary numbers = BIN).
  • Page 93 Binary (BIN) • A binary value consists of two symbols, 0 and 1, which represent the order and size (amount). After a digit reaches 1, an increment resets it to 0, causing an increment of the next digit to the left. One digit of 0 or 1 is called a bit. Binary Decimal 1000...
  • Page 94 Hexadecimal • A hexadecimal value consists of 16 symbols, 0 to 9 and A to F, which represent the order and size (amount). After a digit reaches F, an increment resets it to 0, causing an increment of the next digit to the left. Decimal Hexadecimal Binary...
  • Page 95 Binary-coded decimal (BCD) • The binary-coded decimal system uses a binary value to represent each digit of a decimal value. The decimal value 157, for example, is expressed as follows. ← Digit number ← Decimal (100) (10) ← Power of digit 0001 0101 0111...
  • Page 96 Numerical values used by the MELSEC iQ-R series programmable controller • Usually, 8 bits are called one byte, and 16 bits (two bytes) are called one word. 1 bit 1 byte 1 word (2 bytes) • Registers of each word device in the MELSEC iQ-R series programmable controller consist of 16 bits. •...
  • Page 97 Binary-coded decimal Binary Decimal Hexadecimal (BCD) (BIN) 00000000 00000000 00000000 00000000 0000 00000000 00000001 00000000 00000001 0001 00000000 00000010 00000000 00000010 0002 00000000 00000011 00000000 00000011 0003 00000000 00000100 00000000 00000100 0004 00000000 00000101 00000000 00000101 0005 00000000 00000110 00000000 00000110 0006 00000000 00000111 00000000 00000111...
  • Page 98 Transfer Instructions 5.2.1 [MOV(P)] (Transferring 16-bit data) • This section describes that data at the (s) side remains with the instruction for transferring data from the (s) side to the (d) side. • This section describes the operation differences between the instructions with P and the one without P. Project name RB-11 Program name...
  • Page 99 • When the input condition turns on, the hexadecimal value 4A9D is converted into a binary value and transferred into the data register D103. H4A9D Hexadecimal D103 Binary Bit weight ↑ Sign bit Differences between MOV and MOVP The P in the MOVP instruction stands for a pulse. Input condition Data is transferred at every scan while the input condition is on.
  • Page 100 Items to be checked CPU module: RUN Inputs X102, X103, X104, X105, and X107: On • Monitor the values in the data register (D100 to D103). After writing data to the programmable controller, click [Online] → [Monitor] → [Device/Buffer Memory Batch Monitor]. The "Device/Buffer Memory Batch Monitor"...
  • Page 101 Current values of a timer and counter are monitored. (The values change.) This value indicates that a decimal number 157 (K157) has been stored. This value indicates the decimal number of the hexadecimal number 4A9D. Word devices are expressed with the on/off states of bits. : Off (0 in binary) : On (1 in binary) Hexadecimal...
  • Page 102 • Click on the toolbar or select [View] → [Display Format Detailed Setting] from the menu. The "Display Format" dialog box appears. • Change the display of the numerical values being monitored to the hexadecimal notation. Select "HEX" for "Value" in the "Device Format" dialog box. ["Device/Buffer Memory Batch Monitor"...
  • Page 103 K1M0 • A word device D (data register), T (current value of a timer), or C (current value of a counter) consists of 16 bits (one word), and data is basically transferred in one device. • With 16 bit devices (such as X, Y, and M), data of the same size as a word device can be handled. The device numbers allocated to the bit devices must be in consecutive order.
  • Page 108 Comparison Operation Instructions This section describes how to compare numerical values. Project name RB-15 Program name MAIN <> > Size comparison >= < <= X102 X103 (s1) (s2) Y170 > Y171 <= Y172 <> Y173 > < Y174 Y175 <= >= •...
  • Page 109 Arithmetic Operation Instructions 5.4.1 [+(P)] (Addition of 16-bit binary data) [-(P)] (Subtraction of 16-bit binary data) • This section describes addition or subtraction. • This section describes the differences between the instructions with P and the one without P. Project name RB-16 Program name MAIN...
  • Page 110: 5.4 Arithmetic Operation Instructions

    The following two instructions work on the same principle in the addition or subtraction processing. (Addition) K1 D100 INCP D100 (Subtraction) D102 DECP D102 Project name RB-17 Program name MAIN X104 MOVP K1000 D102 X105 D102 (s1) (s2) X106 D102 D103 Every time the input condition turns on, the value in the device specified in (s) is subtracted from the value in the device specified in (d), and the result is stored in the device specified in (d).
  • Page 111: Project Name

    5.4.2 [*(P)] (Multiplication of 16-bit binary data) [/(P)] (Division of 16-bit binary data) • This section describes multiplication or division. • This section describes the concept of two words. Project name RB-18 Program name MAIN X100 MOVP D100 (s1) (s2) X102 K600 D100...
  • Page 112: Example

    When the input condition turns on, the value in the device specified in (s1) is divided by the value in the device specified in (s2), and the result is stored in the device specified in (d). Values after the decimal point of the division result are ignored.
  • Page 113 6.1.3 Current value change of the device (T) (D20) Set the CPU module to the RUN state before this operation. Select the "T0" cell on the ladder editor and click [Online] "D20" → [Watch] → [Register to Watch Window] → [Watch Click! Window 1].
  • Page 114 Watch Window This section describes the "Watch" window where devices can be checked at once. This section describes how to register multiple devices or labels in one window and to monitor them at the same time. Click [View] → [Docking Window] → one of [Watch 1] to [Watch 4] from the menu.
  • Page 115 How to monitor 32-bit integer data When the operation result of the multiplication instruction is outside the range of 0 to 32767, the result cannot be properly displayed even though the value is regarded as a 16-bit integer and the values in the lower registers are monitored in ladder.
  • Page 116 5.4.3 32-bit data instructions and their necessities • This section describes the concept of two words. • This section describes the differences between a one-word instruction and two-word instruction. • The unit of the data memory of the MELSEC iQ-R series programmable controller is one word that consists of 16 bits. Thus, data is typically processed in units of one word at the transfer processing, comparison, and arithmetic operation.
  • Page 117 • Whether data is processed as two-word (32-bit) data or not depends on the size of the data. In the following cases, use two-word instructions. (1) When the data size exceeds the range (-32768 to 32767) in which data can be processed as one word DMOV K50000 D100...
  • Page 118 System clock The special relay about system clock is shown below. R: Read only, R/W: Read/Write Name Description SM400 Always ON SM401 Always OFF SM402 After RUN, ON for one scan only 1 scan SM403 After RUN, OFF for one scan only 1 scan SM409 0.01 second clock...
  • Page 119 CLOCK FUNCTION The CPU module has an internal clock and is used to manage time in functions performed by the system such as dates of the event history function and the data logging function. Time Setting Time operation continues with the large internal capacitor in the CPU module even though the power in the CPU module is turned OFF or the power failure exceeds the allowable momentary power failure time.
  • Page 120 System information The special registers for system information are shown below. R: Read only, R/W: Read/Write Name Description SD200 Switch Status This register stores the CPU switch status. 0: RUN 1: STOP SD201 LED Status This register stores the LED status. b0: STOP b4: RUN b5: PAUSE...
  • Page 121 How to Create Comments This section describes how to create comments (device comments, statements, and notes) in a program. Project name REX15 Program name MAIN Example of a printed ladder program with comments Timer 0.6s 0.3s timer No.1 0.3s timer Timer 0.6s No.1 0.9s flicker...
  • Page 122 Creating comments Click [Device] → [Device Comment] in the "Project" view and double-click [Common Device Comment] to display the "Device Comment" window. Double-click! Click "Device Name" and enter "X100" in the list box. Press the  key. Enter! Click each of comment areas and enter comments as shown on the left.
  • Page 123 (From the previous page) Click "Device Name" and enter "M1" in the list box. Press the  key. Enter! Click a comment area and enter a comment as shown on the left. Enter a comment! Click "Device Name" and enter "T0" in the list box. Press the ...
  • Page 124 Saving comments Click [Project] → [Save As] from the menu. Click! The "Save as" dialog box appears. Specify the save destination and a project name and click the [Save] button. Click! 6 HOW TO USE OTHER FUNCTIONS 6 - 19 6.6 How to Create Comments...
  • Page 125 Displaying a ladder with comments in windows of GX Works3 Click [View] → [Comment Display] from the menu. Click! The ladder program is displayed with comments. (When comments are not displayed) (When comments are displayed) 6 HOW TO USE OTHER FUNCTIONS 6 - 20 6.6 How to Create Comments...
  • Page 126 As well as device comments, statements and notes can be created in a ladder. • Statement: A comment that describes the function or application of a ladder block • Note: A comment that describes the function or application of an output or instruction Note Statement •...

Table of Contents