Image not available
Illustrative purposes only
FX5-232-ADP
COMMUNICATION ADAPTER, RS232C, PLC, 15M
⚠️ Reference pricing provided. In case of supply shortages, we will connect you with our trusted procurement partners to ensure your project's continuity.
- Manufacturer: MITSUBISHI
- Product type: Controller Accessories
- SVHC: No SVHC (15-Jan-2018)
- Product Range: MELSEC iQ-F FX5
- Current Rating: 30mA
| Delivery and price | |
|---|---|
| Units per pack | 1 |
| Price | 149.58 € |
| Current stock | 10+ |
| Lead time | 30 days |
**==> picture [160 x 64] intentionally omitted <==** # MELSEC iQ-F FX5 User's Manual (MODBUS Communication) ## **SAFETY PRECAUTIONS** (Read these precautions before use.) Before using this product, please read this manual and the relevant manuals introduced in this manual carefully and pay attention to safety in order to handle the product correctly. This manual classifies the safety precautions into two categories: [ WARNING] and [ CAUTION]. ## **WARNING** Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury. ## **CAUTION** Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage. Depending on the circumstances, procedures indicated by [ CAUTION] may also cause severe injury. It is important to follow all precautions for personal safety. Store this manual in a safe place so that it can be read whenever necessary. Always forward it to the end user. ## [DESIGN PRECAUTIONS] ## **WARNING** - Make sure to set up the following safety circuits outside the PLC to ensure safe system operation even during external power supply problems or PLC failure. Otherwise, malfunctions may cause serious accidents. - (1) Note that when the CPU module detects an error, such as a watchdog timer error, during selfdiagnosis, all outputs are turned off. Also, when an error that cannot be detected by the CPU module occurs in an input/output control block, output control may be disabled. External circuits and mechanisms should be designed to ensure safe machine operation in such a case. - Construct an interlock circuit in the program so that the whole system always operates on the safe side before executing the control (for data change) to the PLC in operation. - Read the manual thoroughly and ensure complete safety before executing other controls (for program change, parameter change, forcible output and operation status change) of the PLC in operation. Otherwise, the machine may be damaged and accidents may occur due to erroneous operations. **1** ## [WIRING PRECAUTIONS] ## **WARNING** - Make sure to cut off all phases of the power supply externally before attempting installation or wiring - work. Failure to do so may cause electric shock or damage to the product. - Make sure to attach the terminal cover, provided as an accessory, before turning on the power or - initiating operation after installation or wiring work. Failure to do so may cause electric shock. - The temperature rating of the cable should be 80 or more. - Make sure to properly wire to the terminal block (European type) in accordance with the following - precautions. Failure to do so may cause electric shock, equipment failures, a short-circuit, wire breakage, malfunctions, or damage to the product. - The disposal size of the cable end should follow the dimensions described in the manual. - Tightening torque should follow the specifications in the manual. - Twist the ends of stranded wires and make sure that there are no loose wires. - Do not solder-plate the electric wire ends. - Do not connect more than the specified number of wires or electric wires of unspecified size. - Affix the electric wires so that neither the terminal block nor the connected parts are directly stressed. ## [WIRING PRECAUTIONS] ## **CAUTION** - Install module so that excessive force will not be applied to terminal blocks, power connectors, I/O connectors, communication connectors, or communication cables. Failure to do so may result in wire damage/breakage or PLC failure. - Make sure to observe the following precautions in order to prevent any damage to the machinery or accidents due to malfunction of the PLC caused by abnormal data written to the PLC due to the effects of noise. - (1) Do not bundle the power line, control line and communication cables together with or lay them close to the main circuit, high-voltage line, load line or power line. As a guideline, lay the power line, control line and communication cables at least 100 mm (3.94") away from the main circuit, high-voltage line, load line or power line. - (2) Ground the shield of the shielded wire or shielded cable at one point on the PLC. However, do not use common grounding with heavy electrical systems. ## [STARTUP AND MAINTENANCE PRECAUTIONS] ## **WARNING** - Do not touch any terminal while the PLC's power is on. Doing so may cause electric shock or malfunctions. - Before cleaning or retightening terminals, cut off all phases of the power supply externally. Failure to do so in the power ON status may cause electric shock. - Before modifying the program in operation, forcible output, running or stopping the PLC, read through this manual carefully, and ensure complete safety. An operation error may damage the machinery or cause accidents. - Do not change the program in the PLC from two or more peripheral equipment devices at the same time. (i.e. from an engineering tool and a GOT) Doing so may cause destruction or malfunction of the PLC program. **2** ## [STARTUP AND MAINTENANCE PRECAUTIONS] ## **CAUTION** - Do not disassemble or modify the PLC. Doing so may cause fire, equipment failures, or malfunctions. For repair, contact your local Mitsubishi Electric representative. - Turn off the power to the PLC before connecting or disconnecting any extension cable. Failure to do so may cause equipment failures or malfunctions. - Turn off the power to the PLC before attaching or detaching the following devices. Failure to do so may cause equipment failures or malfunctions. - Peripheral devices, expansion board and expansion adapter - Extension modules, bus conversion module and connector conversion module - Battery **3** ## **INTRODUCTION** This manual contains text, diagrams and explanations which will guide the reader in the correct installation, safe use and operation of the FX5 MODBUS Serial Communication and should be read and understood before attempting to install or use the unit. It should be read and understood before attempting to install or use the unit. Store this manual in a safe place so that you can read it whenever necessary. Always forward it to the end user. ## **Regarding use of this product** - This product has been manufactured as a general-purpose part for general industries, and has not been designed or manufactured to be incorporated in a device or system used in purposes related to human life. - Before using the product for special purposes such as nuclear power, electric power, aerospace, medicine or passenger movement vehicles, consult Mitsubishi Electric. - This product has been manufactured under strict quality control. However when installing the product where major accidents or losses could occur if the product fails, install appropriate backup or failsafe functions in the system. ## **Note** - If in doubt at any stage during the installation of the product, always consult a professional electrical engineer who is qualified and trained in the local and national standards. If in doubt about the operation or use, please consult the nearest Mitsubishi Electric representative. - Since the examples indicated by this manual, technical bulletin, catalog, etc. are used as a reference, please use it after confirming the function and safety of the equipment and system. Mitsubishi Electric will accept no responsibility for actual use of the product based on these illustrative examples. - This manual content, specification etc. may be changed, without a notice, for improvement. - The information in this manual has been carefully checked and is believed to be accurate; however, if you notice a doubtful point, an error, etc., please contact the nearest Mitsubishi Electric representative. When doing so, please provide the manual number given at the end of this manual. **4** ## **MEMO** **5** ## **CONTENTS** |**CONTENTS**|**CONTENTS**|**CONTENTS**| |---|---|---| |SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1||| |INTRODUCTION. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4||| |RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8||| |TERMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8||| |**CHAPTER 1 OUTLINE**<br>**10**||| |**1.1**||**Outline of Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10**| |**1.2**||**Procedure for Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11**| |**CHAPTER 2 CONFIGURATION**<br>**12**||| |**2.1**||**System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12**| |**CHAPTER 3 SPECIFICATIONS**<br>**14**||| |**3.1**||**Communication Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14**| |**3.2**||**Link Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15**| |**CHAPTER 4 MODBUS COMMUNICATION SPECIFICATIONS**<br>**18**||| |**4.1**||**MODBUS Protocol. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18**| |||Frame mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19| |||List of supported MODBUS standard functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19| |**CHAPTER 5 WIRING**<br>**20**||| |**5.1**||**Wiring Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20**| |**5.2**||**Selecting Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20**| |||For RS-232C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20| |||For RS-485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20| |||Connecting cables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21| |||Termination resistor setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22| ||**5.3**|**Connection Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23**| |||Connection diagram for RS-232C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23| |||Connection diagram for RS-485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23| |**5.4**||**Grounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24**| |**CHAPTER 6 COMMUNICATION SETTING**<br>**25**||| |**6.1**||**Setup Method for MODBUS Serial Communication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25**| |||Using the CPU module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25| |||Using an Extended board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26| |||Using an Expansion adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27| |||Contents of parameter setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27| |**CHAPTER 7 FUNCTION**<br>**30**||| |**7.1**||**Master Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30**| |**7.2**||**Slave Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33**| |**7.3**||**Related Devices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33**| |||List of related devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33| |||Details of Related Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35| **6** **==> picture [596 x 34] intentionally omitted <==** |**CHAPTER 8 CREATING PROGRAMS**<br>**41**| |---| |**8.1**<br>**Creating Programs for the Master Station . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41**| |**8.2**<br>**Cautions on Program Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41**| |**APPENDIX**<br>**42**| |**Appendix 1 Troubleshooting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42**| |**Appendix 2 Error code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43**| |**Appendix 3 The frame specifications of RTU mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45**| |Procedure for generating of CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45<br>MODBUS protocol data unit formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47<br>**Appendix 4 Initial values of MODBUS device allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55**<br>**INDEX**<br>**57**<br>REVISIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58| |WARRANTY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59| |TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60| **7** ## **RELEVANT MANUALS** ## **User's manuals for the applicable modules** ~~SS~~ |**Manual name <manual number>**|**Description**| |---|---| |MELSEC iQ-F FX5 User's Manual (Startup)<br><JY997D58201>|Performance specifications, procedures before operation, and troubleshooting of the<br>CPU module.| |MELSEC iQ-F FX5U User's Manual (Hardware)<br><JY997D55301>|Describes the details of hardware of the FX5U CPU module, including input/output<br>specifications, wiring, installation, and maintenance.| |MELSEC iQ-F FX5UC User's Manual (Hardware)<br><JY997D61401>|Describes the details of hardware of the FX5UC CPU module, including input/output<br>specifications, wiring, installation, and maintenance.| |MELSEC iQ-F FX5 User's Manual (Application)<br><JY997D55401>|Describes basic knowledge required for program design, functions of the CPU<br>module, devices/labels, and parameters.| |MELSEC iQ-F FX5 Programming Manual (Program Design)<br><JY997D55701>|Describes specifications of ladders, ST, FBD/LD, and other programs and labels.| |MELSEC iQ-F FX5 Programming Manual (Instructions, Standard<br>Functions/Function Blocks)<br><JY997D55801>|Describes specifications of instructions and functions that can be used in programs.| |MELSEC iQ-F FX5 User's Manual (Serial Communication)<br><JY997D55901>|Describes N:N network, MELSEC Communication protocol, inverter communication,<br>non-protocol communication, and predefined protocol support.| |MELSEC iQ-F FX5 User's Manual (MODBUS Communication)<br><JY997D56101> (This manual)|Describes MODBUS serial communication.| |MELSEC iQ-F FX5 User's Manual (Ethernet Communication)<br><JY997D56201>|Describes the functions of the built-in Ethernet port communication function.| |MELSEC iQ-F FX5 User's Manual (SLMP)<br><JY997D56001>|Explains methods for the device that is communicating with the CPU module by<br>SLMP to read and write the data of the CPU module.| |MELSEC iQ-F FX5 User's Manual (Positioning Control)<br><JY997D56301>|Describes the built-in positioning function.| |MELSEC iQ-F FX5 User's Manual (Analog Control)<br><JY997D60501>|Describes the analog function.| |GX Works3 Operating Manual<br><SH-081215ENG>|System configuration, parameter settings, and online operations of GX Works3.| ## **TERMS** Unless otherwise specified, this manual uses the following terms. • indicates a variable part to collectively call multiple models or versions. (Example) FX5U-32MR/ES, FX5U-32MT/ES FX5U-32M/ES • For details on the FX3 devices that can be connected with the FX5, refer to FX5 User’s Manual (Hardware). |**Terms**<br>■Devices<br>~~LT~~|**Description**| |---|---| |FX5|Generic term for FX5U and FX5UC PLCs| |FX3|Generic term for FX3S, FX3G, FX3GC, FX3U, and FX3UC PLCs| |FX5 CPU module|Generic term for FX5U CPU module and FX5UC CPU module| |FX5U CPU module|Generic term for FX5U-32MR/ES, FX5U-32MT/ES, FX5U-32MT/ESS, FX5U-64MR/ES, FX5U-64MT/ES,<br>FX5U-64MT/ESS, FX5U-80MR/ES, FX5U-80MT/ES, and FX5U-80MT/ESS| |FX5UC CPU module|Generic term for FX5UC-32MT/D and FX5UC-32MT/DSS| |Extension module|Generic term for FX5 extension modules and FX3 function modules| |• FX5 extension module|Generic term for I/O modules, FX5 extension power supply module, and FX5 intelligent function module| |• FX3 extension module|Generic term for FX3 extension power supply module and FX3 intelligent function module| |Extension module (extension cable type)|Input modules (extension cable type), Output modules (extension cable type), Bus conversion module<br>(extension cable type), and Intelligent function modules| |Extension module (extension connector type)|Input modules (extension connector type), Output modules (extension connector type), Input/output<br>modules, Bus conversion module (extension connector type), and Connector conversion module (extension<br>connector type)| |I/O module|Generic term for input modules, output modules, Input/output modules, and powered input/output modules| |Input module|Generic term for Input modules (extension cable type) and Input modules (extension connector type)| **8** |**Terms**|**Description**| |---|---| |• Input module (extension cable type)|Generic term for FX5-8EX/ES and FX5-16EX/ES| |• Input module (extension connector type)|Generic term for FX5-C32EX/D and FX5-C32EX/DS| |Output module|Generic term for output modules (extension cable type) and output modules (extension connector type)| |• Output module (extension cable type)|Generic term for FX5-8EYR/ES, FX5-8EYT/ES, FX5-8EYT/ESS, FX5-16EYR/ES, FX5-16EYT/ES, and<br>FX5-16EYT/ESS| |• Output module (extension connector type)|Generic term for FX5-C32EYT/D and FX5-C32EYT/DSS| |Input/output modules|Generic term for FX5-C32ET/D and FX5-C32ET/DSS| |Powered input/output module|Generic term for FX5-32ER/ES, FX5-32ET/ES, and FX5-32ET/ESS| |Extension power supply module|Generic term for FX5 extension power supply module and FX3 extension power supply module| |• FX5 extension power supply module|Different name for FX5-1PSU-5V| |• FX3 extension power supply module|Different name for FX3U-1PSU-5V| |Intelligent module|The abbreviation for intelligent function modules| |Intelligent function module|Generic term for FX5 intelligent function modules and FX3 intelligent function modules| |• FX5 intelligent function module|Generic term for FX5 intelligent function modules| |• FX3 intelligent function module|Different name for FX3 special function blocks| |Simple motion module|Different name for FX5-40SSC-S| |Expansion board|Generic term for board for FX5U CPU module| |• Communication board|Generic term for FX5-232-BD, FX5-485-BD, and FX5-422-BD-GOT| |Expansion adapter|Generic term for adapter for FX5 CPU module| |• Communication adapter|Generic term for FX5-232ADP and FX5-485ADP| |• Analog adapter|Generic term for FX5-4AD-ADP and FX5-4DA-ADP| |Bus conversion module|Generic term for FX5-CNV-BUS and FX5-CNV-BUSC| |Battery|Different name for FX3U-32BL| |Peripheral device|Generic term for engineering tools and GOTs| |GOT|Generic term for Mitsubishi Graphic Operation Terminal GOT1000 and GOT2000 series| |■Software packages|| |Engineering tool|The product name of the software package for the MELSEC programmable controllers| |GX Works3|The product name of the software package, SWnDND-GXW3, for the MELSEC programmable controllers<br>(The 'n' represents a version.)| |■Manuals|| |User's manual|Generic term for separate manuals| |• User's manual (Startup)|Abbreviation of MELSEC iQ-F FX5 User's Manual (Startup)| |• FX5 User's manual (Hardware)|Generic term for MELSEC iQ-F FX5U User's Manual (Hardware) and MELSEC iQ-F FX5UC User's Manual<br>(Hardware)| |• FX5U User's manual (Hardware)|Abbreviation of MELSEC iQ-F FX5U User's Manual (Hardware)| |• FX5UC User's manual (Hardware)|Abbreviation of MELSEC iQ-F FX5UC User's Manual (Hardware)| |• User's manual (Application)|Abbreviation of MELSEC iQ-F FX5 User's Manual (Application)| |Programming manual (Program Design)|Abbreviation of MELSEC iQ-F FX5 Programming Manual (Program Design)| |Programming manual (Instructions, Standard<br>Functions/Function Blocks)|Abbreviation of MELSEC iQ-F FX5 Programming Manual (Instructions, Standard Functions/Function Blocks)| |Communication manual|Generic term for MELSEC iQ-F FX5 User's Manual (Serial Communication), MELSEC iQ-F FX5 User's<br>Manual (MODBUS Communication), MELSEC iQ-F FX5 User's Manual (Ethernet Communication), and<br>MELSEC iQ-F FX5 User's Manual (SLMP)| |• Serial communication manual|Abbreviation of MELSEC iQ-F FX5 User's Manual (Serial Communication)| |• MODBUS communication manual|Abbreviation of MELSEC iQ-F FX5 User's Manual (MODBUS Communication)| |• Ethernet communication manual|Abbreviation of MELSEC iQ-F FX5 User's Manual (Ethernet Communication)| |• SLMP manual|Abbreviation of MELSEC iQ-F FX5 User's Manual (SLMP)| |■Communication-related|| |Built-in RS-485 port|CPU module built-in RS-485 port| |Serial port|Generic name for FX5 CPU module built-in RS-485 port (CH1), communication board (CH2),<br>communication adapter 1 (CH3), communication adapter 2 (CH4) (4 ports)| **9** **1 OUTLINE** This chapter explains the FX5 MODBUS serial communication. - When predefined protocol support function is used, refer to the MELSEC iQ-F FX5 User's manual (Serial communication). ## **1.1 Outline of Function** The FX5 MODBUS serial communication function can control 32 slaves for RS-485 communication and one slave for RS232C communication by a single master. - The master function and slave function are supported and the master and slave can be used simultaneously by a single FX5. (Only one channel for the master) - Up to 4 channels can be used for MODBUS serial communication function by one CPU module. - The master uses a PLC command dedicated to MODBUS serial communication and controls the slave. - The communication protocol supports the RTU mode. ## System ## <RS-485> **==> picture [412 x 256] intentionally omitted <==** **----- Start of picture text -----**<br> 1200 m (3937' 0") (50 m (164' 0") or shorter when other than the FX5-485ADP is included in the system)<br>FX5 FX5 FX5<br>master station slave station 1 slave station n<br>• • •<br>Built-in RS-485 port Built-in RS-485 port Built-in RS-485 port<br>etc etc etc<br><RS-232C><br>15 m (49' 2")<br>FX5 FX5<br>master station slave station 1<br>RS-232C communication RS-232C communication<br>equipment equipment<br>**----- End of picture text -----**<br> The slave station No. can be arbitrarily assigned. - If FX5 is used as the master station, slave station No 1 to 32 can be addressed. - If FX5 is used as a slave station, 1 to 247 can be set for the slave station No. 1 OUTLINE **10** 1.1 Outline of Function **1.2 Procedure for Operation** **1** The flow chart below shows the procedure for setting up a MODBUS serial communication network: _**1.**_ Check communication specifications Refer to Page 14 SPECIFICATIONS or Page 18 MODBUS COMMUNICATION SPECIFICATIONS - Communication Specifications Link Time - MODBUS Serial Communication Specifications MODBUS Serial Communication Protocol, Details of MODBUS Standard Functions _**2.**_ System configuration and selection - Refer to Page 12 CONFIGURATION - System Configuration Selection of communication equipment ## _**3.**_ Wiring - Refer to Page 20 WIRING - Wiring procedure Wiring example ## _**4.**_ Communication settings - Refer to Page 25 COMMUNICATION SETTING - Communication setting using GX Works3 *1 For details on the connection method or operation method to the PLC of GX Works3, refer to the following manual. GX Works3 Operating Manual ## _**5.**_ Program creation - Refer to Page 30 FUNCTION or Page 41 CREATING PROGRAMS • Function Master Function, Slave Function, Related special device - MODBUS serial communication program Example of creating programs of the master using ADPRW instruction 1 OUTLINE 1.2 Procedure for Operation **11** **2 CONFIGURATION** This chapter explains the configuration of RS-485 and RS-232C communication of the FX5. ## **2.1 System Configuration** This section outlines the system configuration required to use MODBUS serial communication. ## **FX5U CPU module** In FX5U CPU module, up to four communication port channels can be connected to a CPU module using built-in RS-485 port, communication board, and communication adapter. The communication channel assignments are fixed to the following numbers, regardless of the system configuration. **==> picture [434 x 177] intentionally omitted <==** **----- Start of picture text -----**<br> CH4: Communication CH3: Communication<br>adapter 2 adapter 1 CH2: Communication<br>yA board<br>3 (OOO O |<br>E I 0<br>(9) =<br>ates @ os<br>fs Sooo<br>SY h o TS<br>f Oo, o GO<br>SP iz<br>CH1: Built-in RS-485 port<br>**----- End of picture text -----**<br> |**Communication**<br>**port**|**Communication**<br>**port**|**Communication**<br>**port**|**Important point in selection**|**Total extension**<br>**distance**| |---|---|---|---|---| |Built-in RS-485 port<br>CH1||CH1|Since it is built-into the CPU module, there is no need to add<br>equipment|50 m (164' 0") or less| |Communication<br>board|FX5-485-BD<br>CH2<br>FX5-232-BD|CH2|Mounted on top of the CPU module, there is no change in the<br>installation space requirements|50 m (164' 0") or less| |||||15 m (49' 2") or less| |Communication<br>adapter|FX5-485ADP<br>CH3, CH4<br>FX5-232ADP|CH3, CH4*1|Mount the communication adapter to the left of the CPU module|1200 m (3937' 0") or less| |||||15 m (49' 2") or less| - *1 Assigned to CH3 or CH4 in order of proximity to CPU module. 2 CONFIGURATION 2.1 System Configuration **12** **2** ## **FX5UC CPU module** In FX5UC CPU module, up to three communication port channels can be connected to a CPU module using built-in RS-485 port, and communication adapter. The communication channel assignments are fixed to the following numbers, regardless of the system configuration. CH4: Communication adapter-2 CH3: Communication adapter-1 CH1: Built-in RS-485 port ||**Communication**<br>**port**|**Important point in selection**| |---|---|---| ||CH1|Since it is built-into the CPU module, there is no need to add<br>equipment| |Communication<br>FX5-485ADP<br>FX5-232ADP|CH3, CH4*1|Mount the communication adapter to the left of the CPU module| - *1 Assigned to CH3 or CH4 in order of proximity to CPU module. 2 CONFIGURATION 2.1 System Configuration **13** **3 SPECIFICATIONS** This chapter explains the specifications of MODBUS serial communication. ## **3.1 Communication Specifications** MODBUS serial communication is executed within the specifications shown in the table below. The baud rate, etc. can be changed in the parameter settings of GX Works3. |**Item**|**Item**|**Specifications**|**Specifications**|**Remarks**| |---|---|---|---|---| |||**Built-in RS-485 port**<br>**FX5-485-BD**<br>**FX5-485ADP**|**FX5-232-BD**<br>**FX5-232ADP**|| |Number of connectable units||Up to 4 Channel<br>(Only one channel for the master)||The channel can be used as<br>master or slave.| |Communication<br>specifications|Communication<br>interface|RS-485|RS-232C|| ||Baud rate|300/600/1200/2400/4800/9600/19200/38400/57600/115200 bps||| ||Data length|8 bit||| ||Stop bit|1 bit/2 bit||| ||Transmission distance|1200 m (3937' 0") or less for the<br>system configured with FX5-485ADP<br>only<br>50 m (164' 0") or less for the system<br>configured with devices other than<br>above|15 m (49' 2") or less|The transmission distance<br>varies depending on<br>communication equipment<br>type.| ||Communication<br>protocol|RTU||| |Master function|Number of<br>connectable slaves|32 slaves|1 slave|The number of slaves varies<br>depending on communication<br>equipment type.| ||Number of functions|8 (No diagnosis function)||| ||Number of<br>simultaneous sending<br>messages|1 message||| ||Maximum number of<br>writes|123 words or 1968 coils||| ||Maximum number of<br>reads|125 words or 2000 coils||| |Slave function|Number of functions|8 (No diagnosis function)||| ||Number of messages<br>which can be received<br>simultaneously|1 message||| ||Station number|1 to 247||| 3 SPECIFICATIONS 3.1 Communication Specifications **14** **3** ## **3.2 Link Time** The link time indicates the cycle time in which a master module completes a single instruction with a slave, as illustrated by the diagram below. **==> picture [474 x 138] intentionally omitted <==** **----- Start of picture text -----**<br> X0<br>SET M0<br>M0<br>ADPRW ** ** ** ** ** **<br>SM8029<br>RST M0<br>Instruction execution complete flag<br>M0<br>**----- End of picture text -----**<br> SM8029 **==> picture [482 x 391] intentionally omitted <==** **----- Start of picture text -----**<br> Master processing time (Tm)<br>T1 T2 T3<br>Master Message<br>to Message<br>Delay<br>Command<br>T4 Creation<br>Request Sending<br>Slave Delay<br>Response Receiving<br>3.5<br>character<br>T5 wait<br>Processing<br>T6 T7 T8 T9 T10<br>T11 T12 T13<br>Request Receiving<br>Slave Message to<br>Message Delay<br>Processing<br>T14 T15<br>Response Sending<br>Slave processing time (Ts)<br>**----- End of picture text -----**<br> 3 SPECIFICATIONS 3.2 Link Time **15** The master processing time (Tm) can be calculated in milliseconds (ms) as follows. "INT(n)" indicates an integer obtained by truncating decimal places of "n". Character length (bits): Start bit (1 bit) + Data Length (8 bit) + Parity bit (0 bit or 1 bit) + Stop bit (1 bit or 2 bit) Tm = T1 + T2 + T3 T4 T1 = INT +1 Max. Scan Time Max. Scan Time T4 = SD8864, SD8874, SD8884, or SD8894 (depending on the communication channel) T5 T2 = INT +1 Max. Scan Time Max. Scan Time T5 = T6 + T7 + T8 + T9 + T10 T6 = less than 1 ms T7 = Number of Bytes in Request Character Length (bits) 1000 (ms) + 1 ms Baud Rate (bps) T8 = Slave delay time (depending on the slave) Number of Bytes in Response Character Length (bits) T9 = 1000 (ms) + 1 ms Baud Rate (bps) T10 = 3.5 Characters Character Length (bits) 1000 (ms) + 1 ms Baud Rate (bps) T3 = less than 1 ms The slave processing time (Ts) can be calculated in milliseconds (ms) as follows. Character length (bits): Start bit (1 bit) + Data Length (8 bit) + Parity bit (0 bit or 1 bit) + Stop bit (1 bit or 2 bit) Ts = T11 + T12 + T13 T11 = T14 + T15 + Max. Scan Time Number of Bytes in Request Character Length (bits) T14 = 1000 (ms) + 1 ms Baud Rate (bps) T15 = SD8864, SD8874, SD8884, or SD8894 (depending on the communication channel) T12 = less than 1 ms T13 = Number of Bytes in Response Character Length (bits) 1000 (ms) + 1 ms Baud Rate (bps) 3 SPECIFICATIONS **16** 3.2 Link Time **3** Example link time calculations: ## Master processing time (Tm) SD8864 = 5 ms Max. scan time = 5 ms Function = Read holding registers 0 to 9 (function code: 03H) Frame mode = RTU mode Number of bytes in request = 8 bytes (1 byte Address, 5 byte Frame, 2 byte CRC) Number of bytes in response = 25 bytes (1 byte Address echo, 22 byte Frame, 2 byte CRC) Character length = 10 bits (1 bit Start bit, 8 bit Data length, 0 bit Parity bit, 1 bit Stop bit) Baud rate = 19.2 kbps Slave delay time = 10 ms T4 = 5 ms **==> picture [213 x 135] intentionally omitted <==** **==> picture [177 x 30] intentionally omitted <==** Tm = 5 ms + 35 ms + 1 ms = 41 ms Slave processing time (Ts) Function = Read holding registers 0 to 9 (function code: 03H) Frame mode = RTU mode Number of bytes in request = 8 bytes (1 byte Address, 5 byte Frame, 2 byte CRC) Number of bytes in response = 25 bytes (1 byte Address echo, 22 byte Frame, 2 byte CRC) Character length = 10 bits (1 bit Start bit, 8 bit Data length, 0 bit Parity bit, 1 bit Stop bit) Baud rate = 19.2 kbps SD8864 = 5 ms Max. scan time = 5 ms T14 = 8 Bytes 10 Bits 1000 (ms) + 1 ms 5.2 ms 19200 bps T15 = 5 ms T11 = 5.2 ms + 5 ms + 5 ms = 15.2 ms T12 1 ms T13 = 25 Bytes 10 Bits 1000 (ms) + 1 ms 14.0 ms 19200 bps Ts = 15.2 ms + 1 ms + 14.0 ms = 30.2 ms 3 SPECIFICATIONS 3.2 Link Time **17** **4 MODBUS COMMUNICATION SPECIFICATIONS** This chapter explains the details of MODBUS Protocol for MODBUS communication and the MODBUS standard functions supported by the FX5. • For the list of supported MODBUS standard functions, refer to Page 19 List of supported MODBUS standard functions. • For usage of the supported MODBUS standard functions, refer to Page 30 FUNCTION. ## **4.1 MODBUS Protocol** The following shows the frame specifications for the MODBUS protocol. |Address field|Function code|Data|Error check| |---|---|---|---| ||MODBUS Protocol Data Section*1||| *1 For details of the MODBUS protocol data section, refer to Page 55. The following table details the frame specifications for the MODBUS Protocol. |**Area name**|**Description**| |---|---| |Address field|[When the master sends a request message to a slave]<br>0: Sends a request message to all the slaves. (Broadcast)<br>1 to 247: Sends a request to a specific Slave number.<br>Note: 247 is the MODBUS maximum address number. When using the FX5 as master, stations 1 to 32 can be addressed.<br>[When the slave sends a response message to the master]<br>The host station number is stored when sending a response message.| |Function code|[When the master sends a request message to a slave]<br>The master specifies the function code to the slave.<br>[When the slave sends a response message to the master]<br>The requested function code is stored in the case of normal completion. The most significant bit turns ON in the case of abnormal<br>end.| |Data|[When the master sends a request message to a slave]<br>The information needed to execute the action specified by a function code is stored.<br>[When the slave sends a response message to the master]<br>The execution result of the action specified by a function code is stored. An exception code is stored when failed.| |Error check|The node (master or slave) adds the check code automatically to all transmitted messages and recalculates the check code for any<br>received message. The received message is discarded if it has an error.| Refer to Page 19 Frame mode for the data size of each area. 4 MODBUS COMMUNICATION SPECIFICATIONS 4.1 MODBUS Protocol **18** **4** ## **Frame mode** For the FX5, the following frame modes are available. If the frame mode of the FX5 differs from the one of the target device, it cannot be used. ## **Available frame modes** ~~SS~~ ## ■ **RTU mode** In this mode, frames are received or sent in binary codes. The frame specifications are compliant with the MODBUS protocol specifications. |Start<br>3.5 character<br>time or more|3.5 character<br>|Address field<br>1 byte<br>|Function code<br>1 byte<br>|0 to 252 bytes<br>|Data<br>0 to 252 bytes<br>|2 bytes<br>Error check<br>||3.5 character<br>time or more<br>END<br>(Start)|Address field<br>1 byte| |---|---|---|---|---|---|---|---|---| ||~~ee~~|~~ee~~|~~ee~~|~~ee~~|~~ee~~|~~ee~~|||| ||~~ee~~|Error check calculation range<br>~~ee~~|||~~ee~~|~~ee~~|||| The error check in the RTU mode is conducted by CRC (Cyclic Redundancy Check). The CRC field is two bytes, containing a 16 bit binary value. The CRC value is calculated by the transmitting device, which appends the CRC to the message. The device that receives recalculates a CRC during receipt of the message, and compares the calculated value to the actual value it received in the CRC field. If the two values are not equal, an error occurs. (For procedure for generating of CRC, refer to Page 45 The frame specifications of RTU mode) ## **List of supported MODBUS standard functions** The following table lists the MODBUS standard functions supported by the FX5. |**Function code**|**Function Name**|**Details**|**Accessible devices per**<br>**message**|**Broadcast**|**Reference**| |---|---|---|---|---|---| |01H|Read coils|Read binary (R/W) devices|1 to 2000 points||Page 48| |02H|Read inputs|Read binary (RO) devices|1 to 2000 points||Page 49| |03H|Read holding registers|Read 16 bit (R/W) registers|1 to 125 points||Page 50| |04H|Read input registers|Read 16 bit (RO) registers|1 to 125 points||Page 51| |05H|Write single coil|Write single binary device|1 point||Page 52| |06H|Write single register|Write single 16 bit register device|1 point||Page 52| |0FH|Write multiple coils|Write multiple binary (R/W) devices|1 to 1968 points||Page 53| |10H|Write multiple registers|Write multiple 16 bit (R/W) registers|1 to 123 points||Page 54| :Applicable, :Not applicable 4 MODBUS COMMUNICATION SPECIFICATIONS **19** 4.1 MODBUS Protocol ## **5 WIRING** This chapter explains the wiring. ## **5.1 Wiring Procedure** _**1.**_ Preparing for wiring Prepare cables required for wiring. (Page 20 Selecting Connection) _**2.**_ Turning off the power to the PLC Before wiring, make sure that the power of the PLC is off. _**3.**_ Wiring communication equipment Connect RS-485 or RS-232C communication equipment. (Page 23 Connection Diagram) ## **5.2 Selecting Connection** Select cables using the procedure described below. ## **For RS-232C** Use an RS-232C cable of the RS-232 standard within 15 m (49' 2"). ## **For RS-485** Use shielded twisted pair cables for connecting RS-485 communication equipment. |**Item**|**Description**| |---|---| |Cable type|Shielded cable| |Number of pairs|2p, 3p| |Conductor resistance (20)|88.0/km or less| |Insulation resistance|10000 M-km or more| |Dielectric strength|500 V DC, 1 minute| |Electrostatic capacitance (1 kHz)|60 nF/km or less as an average| |Characteristic impedance (100 kHz)|11010| ■ **Cable structural drawing (reference)** Pair Shield ~~KF~~ S ~~a~~ y e ~~s~~ ) ~~ZN~~ Example of two-pair cable structural drawing Example of three-pair cable structural drawing 5 WIRING 5.1 Wiring Procedure **20** With regard to the cable end treatment, use a stranded cable or solid cable as is, or use a wire ferrule with insulating sleeve. ## **Connectin cables g** The table below shows applicable cables and tightening torques. ||**Number of connected**<br>**electric wires per terminal**|**Cable size**|**Cable size**|**Tightening**<br>**torque**| |---|---|---|---|---| |||**Solid wire, Stranded wire**|**Wire ferrule with insulating sleeve**|| |FX5U CPU module<br>built-in RS-485 port|1-wire connection|0.2 to 0.5 mm2(AWG24 to 20)|0.2 to 0.5 mm2(AWG24 to 20)|0.22 to 0.25 N·m| ||2-wire connection|0.2 mm2(AWG24)||| |FX5UC CPU module<br>built-in RS-485 port<br>FX5-485-BD<br>FX5-485ADP|1-wire connection|0.3 to 0.5 mm2(AWG22 to 20)|0.3 to 0.5 mm2(AWG22 to 20)|| ||2-wire connection|0.3 mm2(AWG22)||| Precautions Do not tighten terminal screws with torque beyond the specified range. Otherwise it may cause equipment failure or malfunction. **5 Wire end treatment** ~~ee~~ ## ■ **When using a stranded cable or solid cable as is** • Twist the end of stranded wire and make sure that there are no loose wires. • Please do not solder plate the ends of the wires. **Dimension of the wire end FX5U CPU module built-in RS-485 port FX5UC CPU module built-in RS-485 port, FX5-485-BD, FX5-485ADP** 5 mm (0.2") 9 mm (0.36") ■ **When using a wire ferrule with insulating sleeve** ~~=~~ Because it is difficult to insert a cable into the insulating sleeve depending on the thickness of the cable sheath, select the proper cable according to the outline drawing. **==> picture [492 x 188] intentionally omitted <==** **----- Start of picture text -----**<br> FX5U CPU module built-in RS-485 port FX5UC CPU module built-in RS-485 port, FX5-485-BD, FX5-485ADP<br>Insulating sleeve Contact portion Insulating sleeve Contact portion<br>(Crimp area) (Crimp area)<br>6 mm 8 mm<br>(0.23") (0.31")<br>2 to 2.5 mm 10.5 to 12 mm 2.6 mm (0.1") 14 mm (0.55")<br>(0.07" to 0.09") (0.41" to 0.47")<br><Reference><br>Manufacturer Model name Crimping tool<br>FX5U CPU module built-in RS-485 port Phoenix Contact GmbH & Co. KG AI 0.5-6WH CRIMPFOX 6<br>CRIMPFOX 6T-F<br>FX5UC CPU module built-in RS-485 port AI 0.5-8WH<br>FX5-485-BD<br>FX5-485ADP<br>■ Tool<br>—<br>**----- End of picture text -----**<br> For tightening the terminal, use a commercially available small screwdriver with straight tip that is not widened toward the end as shown below. toward the end as shown below. ■ Precautions With straight tip If the diameter of the screwdriver tip is too small, the required tightening torque cannot be achieved. To achieve the appropriate tightening torque shown in the previous page, use the following screwdriver or its equivalent (grip diameter: approximately 25 mm (0.98")). 0.4 mm 2.5 mm ~~Vii~~ (0.01") (0.09") <Reference> **Manufacturer Model** Phoenix Contact GmbH & Co. KG SZS 0.42.5 ~~SS~~ 5 WIRING 5.2 Selecting Connection **21** ## **Termination resistor setting** Make sure to provide a termination resistor at each end of a line. Built-in RS-485 port, FX5-485-BD, and FX5-485ADP have a built-in termination resistor. Set the termination resistor selector switch accordingly. |**g**|**Termination resistor selector switch**| |---|---| |air wiring|330| |air wiring|110| - FX5U CPU module built-in RS-485 port - FX5UC CPU module built-in RS-485 port **==> picture [294 x 405] intentionally omitted <==** **----- Start of picture text -----**<br> Termination<br>resistor<br>selector switch<br> • FX5-485-BD<br>Termination<br>resistor selector<br>switch<br> • FX5-485ADP<br>Termination<br>resistor<br>selector switch<br>**----- End of picture text -----**<br> **==> picture [149 x 94] intentionally omitted <==** **----- Start of picture text -----**<br> Termination<br>resistor selector<br>switch<br>**----- End of picture text -----**<br> 5 WIRING 5.2 Selecting Connection **22** **5** ## **5.3 Connection Diagram** Representative wiring examples are shown in this section. When pin numbers in the counterpart equipment are different, wire the pins as shown below. ## **Connection dia ram for RS-232C g** **==> picture [498 x 458] intentionally omitted <==** **----- Start of picture text -----**<br> PLC External equipment operating in<br>FCrrr—Y ET accordance with RS-232C<br>FX5-232-BD Using CS and RS Using DR and ER<br>Name FX5-232ADP Name Name<br>D-Sub D-Sub D-Sub D-Sub<br>eee 9-pin D-Sub [ 9-pin | 25-p | in L[| 9-pin 25-pin<br>FG - FG - 1 FG - 1<br>aaa<br>a RD (RXD) 2 RD (RXD) 2 3 RD (RXD) 2 3<br>SD (TXD) 3 SD (TXD) 3 2 SD (TXD) 3 2<br>ER (DTR) 4 RS (RTS) 7 4 ER (DTR) 4 20<br>pt SG (GND) 5 SG (GND) 5 7 SG (GND) 5 7<br>*1<br>a DR (DSR) A 6 CS (CTS) 8 5 DR (DSR) 6 6<br>*1 For third-party external equipment requiring the control signal, connect these pins.<br>The FX5-232-BD, FX5-232ADP does not require these pins to be connected.<br>Connection dia ram for RS-485<br>g<br>One-pair wiring<br>Master Slave Slave Slave<br>built-in RS-485 port built-in RS-485 port built-in RS-485 port built-in RS-485 port<br>FX5-485-BD FX5-485-BD FX5-485-BD FX5-485-BD<br>FX5-485ADP FX5-485ADP FX5-485ADP FX5-485ADP<br>SDA SDA SDA SDA<br>(TXD+) (TXD+) (TXD+) (TXD+)<br>SDB SDB SDB SDB<br>Termination (TXD-) (TXD-) (TXD-) (TXD-) Termination<br>resistor: resistor:<br>110 Se RDA d RDA ed RDA 1ect RDA — 110 <br>*2 (RXD+) (RXD+) (RXD+) (RXD+) *2<br>am RDB RDB RDB i l RDB a<br>(RXD-) (RXD-) (RXD-) (RXD-)<br>SG SG SG SG<br>Class-D grounding Class-D grounding Class-D grounding<br>(resistance: 100 or less) [*1] (resistance: 100 or less) [*1] (resistance: 100 or less) [*1]<br>**----- End of picture text -----**<br> ## **Connection dia ram for RS-485 g** ## **One-pair wiring** - *1 Make sure to perform Class-D grounding on the shield of the twisted pair cable to be connected. - *2 Make sure to provide a termination resistor at each end of a line. Set the selector switch to 110 when the termination resistor is built in. 5 WIRING 5.3 Connection Diagram **23** ## **Two-pair wiring** **==> picture [493 x 229] intentionally omitted <==** **----- Start of picture text -----**<br> Master Slave Slave Slave<br>built-in RS-485 port built-in RS-485 port built-in RS-485 port built-in RS-485 port<br>FX5-485-BD FX5-485-BD FX5-485-BD FX5-485-BD<br>FX5-485ADP FX5-485ADP FX5-485ADP FX5-485ADP<br>SDA SDA SDA SDA<br>(TXD+) (TXD+) (TXD+) (TXD+)<br>*2<br>SDB SDB SDB SDB<br>*2<br>(TXD-) (TXD-) (TXD-) (TXD-)<br>RDA RDA RDA RDA<br>(RXD+) (RXD+) (RXD+) (RXD+)<br>Fae ee *2<br>RDB RDB RDB RDB<br>*2<br>Termination (RXD-) (RXD-) (RXD-) (RXD-) Termination<br>resistor: resistor:<br>330 L 2 SG OKfoc SG SG bor SG 330 2 <br>Class-D grounding Class-D grounding Class-D grounding<br>(resistance: 100 or less) [*1] (resistance: 100 or less) [*1] (resistance: 100 or less) [*1]<br>*1 Make sure to perform Class-D grounding on the shield of the twisted pair cable to be connected.<br>**----- End of picture text -----**<br> - *2 Make sure to provide a termination resistor at each end of a line. Set the selector switch to 330 when the termination resistor is built in. ## **5.4 Grounding** Grounding should be performed as stated below. - The grounding should be class D and the resistance should be 100 or less. - Independent grounding should be performed for best results. When independent grounding cannot be performed, perform "shared grounding" as shown in the following figure For details, refer to MELSEC iQ-F FX5U User's Manual (Hardware), MELSEC iQ-F FX5UC User's Manual (Hardware). **==> picture [311 x 63] intentionally omitted <==** **----- Start of picture text -----**<br> Other Other Other<br>PLC PLC PLC<br>equipment equipment equipment<br>St<br>Independent grounding Shared grounding Common grounding<br>(Best condition) (Good condition) (Not allowed)<br>**----- End of picture text -----**<br> - The grounding wire size should be AWG 14 (2 mm[2] ) or larger. - The grounding point should be close to the PLC, and all grounding wires should be as short as possible. 5 WIRING 5.4 Grounding **24** **6 COMMUNICATION SETTING** **6** This chapter explains the setup method for using MODBUS serial communication with an FX5. ## **6.1 Setup Method for MODBUS Serial Communication** For the MODBUS serial communication setting of the FX5, set parameters with GX Works3. Setting of parameter differs according to the module used. The procedure for each module is as follows. ## **Usin the CPU module g** "Navigation window" [Parameter] [FX5UCPU] [Module Parameter] [485 Serial Port] ## Window The following screen will be displayed if "MODBUS_RTU Communication" is set for Communication Protocol Type. ## ■ **Basic Settings** |**Item**|**Setting**|**Corresponding station**| |---|---|---| |Communication Protocol Type|MELSOFT Connection, Non-protocol Communication, MC protocol,<br>MODBUS_RTU Communication, Inverter Communication, Predefined protocol support*1|Master/Slave| |Parity Bit|None, Odd, Even|Master/Slave| |Stop Bit|1bit, 2bit|Master/Slave| |Baud Rate|300bps, 600bps, 1200bps, 2400bps, 4800bps, 9600bps, 19200bps, 38400bps,<br>57600bps, 115200bps|Master/Slave| - *1 When using MODBUS serial communication, select "MODBUS_RTU Communication". ## ■ **Fixed Setting** |**Item**<br>|**Setting**<br>~~PO~~|**Corresponding station**| |---|---|---| |Host Station No.*1<br>~~PO~~|0 to 247 (Master station: 0, Slave station: 1 to 247)<br>~~PO~~<br>~~PO~~|Master/Slave| |Slave Response Timeout<br>~~PO~~|1 to 32767 ms<br>~~PO~~|Master/Slave| |Broadcast Delay*2<br>~~PO~~|1 to 32767 ms<br>~~POPe~~|Master/Slave| |Message to Message Delay|1 to 16382 ms|Master/Slave| |Timeout Retry Count Setting|0 to 20<br>~~PO~~|Master/Slave| - *1 When set to "Latch" by SM/SD Setting, setting values of the Host Station No. can be changed through special registers. (Page 29 Latch Setting) When other than 0 is set for the special register of a channel that is already set as a master station (station number: 0) by parameter, the channel does not function as a slave station. In addition, when 0 is set for the special register of a channel that is already set as a slave station (station number: 1 to 247) by parameter, the channel does not function as a master station. - *2 Set master station side broadcast delay as equal to one or more scan times of the slave station. 6 COMMUNICATION SETTING 6.1 Setup Method for MODBUS Serial Communication **25** ## ■ **Modbus Device Assigned** |**Item**|**Setting**|**Corresponding station**| |---|---|---| |Device Assigned|Page 27|Slave| ## ■ **SM/SD Setting** |**Item**<br>|**Setting**<br>|**Corresponding station**| |---|---|---| |Advanced Settings<br><br>~~PR~~|Do Not Latch<br>~~Pe~~<br>~~PR~~|| |Host Station No.<br>~~PR~~|Do Not Latch, Latch<br>~~PR~~|Master/Slave| |Slave Response Timeout<br>~~PR~~<br>~~PR~~|Do Not Latch<br>~~PRBR~~<br>~~PR~~|| |Broadcast Delay<br><br>~~PR~~<br>~~PR~~|Do Not Latch<br>~~BR~~<br>~~PR~~<br>~~PR~~|| |Message to Message Delay<br>~~PR~~<br>~~PR~~<br>~~PR~~|Do Not Latch<br>~~PR~~<br>~~PR~~<br>~~PR~~|| |Timeout Retry Count Setting<br>~~PR~~<br>~~PRRC~~|Do Not Latch<br>~~PR~~<br>~~PRRC~~|| |SM/SD for Compatible<br>~~PRRC~~|Disable, CH1, CH2 (Page 29)<br>~~PRRC~~|Master/Slave| For Latch Setting, refer to Page 29 Latch Setting. ## **Using an Extended board** "Navigation window" [Parameter] [FX5UCPU] [Module Parameter] [Extended Board] ## Window ~~eC~~ The following screen will be displayed, if Extended Board to be used is set up and "MODBUS_RTU Communication" is set Communication Protocol Type. ## ■ **Basic Settings** |**Item**|**Setting**|**Corresponding station**| |---|---|---| |Extended Board|None, FX5-232-BD, FX5-485-BD, FX5-422-BD-GOT*1|Master/Slave| |Communication Protocol Type|MELSOFT Connection, Non-protocol Communication, MC protocol,<br>MODBUS_RTU Communication, Inverter Communication*2|Master/Slave| - *1 MODBUS serial communication cannot be used with FX5-422-BD-GOT. - *2 When using MODBUS serial communication, select "MODBUS_RTU Communication". All screens and setting fields other than extended board are the same as "Using the CPU module". (Page 25) 6 COMMUNICATION SETTING 6.1 Setup Method for MODBUS Serial Communication **26** **6** ## **Using an Expansion adapter** When an expansion adapter is used, add expansion adapter to Module Information. ©} "Navigation window" [Parameter] [Module Information] "Right-click" [Add New Module] After adding the expansion adapter, make settings on the screen displayed from the following operation. "Navigation window" [Parameter] [Module Information] [ADP1(or ADP2)] [Module Parameter] ## Window Each setting screen is the same as "Using the CPU module". (Page 25) ## **Contents of parameter setting** The MODBUS device allocation, Latch Setting, SM/SD storage area specification which are used for parameter setting of MODBUS serial communication are as follows. ## **MODBUS device allocation** In the MODBUS device allocation, initial values are set for parameters. (Refer to Page 55 FX5 dedicated pattern) Parameter contents can be changed with following screen of GX Works3. ## Window <Detailed Setting> of "MODBUS Device Assigned" (Page 26) is double-clicked. |**Setting item**|**Description**| |---|---| |Allocation 1 to 16|Allocation of each MODBUS device can be set to 1 to 16.| |Device|Set the device type and head number of the device to be allocated.(For available devices, refer toPage 28 Available<br>devices)| |Start MODBUS Device No.|Set the start MODBUS device number.| |Allocation Points|Set the number of allocation points.| 6 COMMUNICATION SETTING 6.1 Setup Method for MODBUS Serial Communication **27** ## ■ **Available devices** The following table shows devices that can be set to coil, input, input register, and holding register. |**List of devices**|||**Allocable MODBUS device**|**Allocable MODBUS device**|**Allocable MODBUS device**|**Allocable MODBUS device**| |---|---|---|---|---|---|---| |**Device type**||**Device**|**Coil**|**Input**|**Input register**|**Holding register**| |Special relay||SM|||*1|*1| |Special register||SD||||| |Input||X|||*1|*1| |Output||Y|||*1|*1| |Internal relay||M|||*1|*1| |Latch relay||L|||*1|*1| |Annunciator||F|||*1|*1| |Link relay||B|||*1|*1| |Data register||D||||| |Link register||W||||| |Timer|Coil|TC|||*1|*1| ||Contact|TS|||*1|*1| ||Current value|TN||||| |Retentive timer|Coil|SC|||*1|*1| ||Contact|SS|||*1|*1| ||Current value|SN||||| |Counter|Coil|CC|||*1|*1| ||Contact|CS|||*1|*1| ||Current value|CN||||| |Long counter|Coil|LC|||*1|*1| ||Contact|LS|||*1|*1| ||Current value|LN|||*2|*2| |Link special relay||SB|||*1|*1| |Link special register||SW||||| |Step relay||S|||*1|*1| |Index register||Z||||| |Index register||LZ|||*2|*2| |File register||R||||| *1 Set the device number and the allocating points in multiples of 16. In the case that the number of points is not a multiple of 16, a parameter setting error occurs in GX Works3. - *2 Because MODBUS devices are long type devices, 2 points are allocated. ## Precautions - The same device cannot be set for a coil and an input. - The same device cannot be set for an input register and a holding register. - A parameter setting error occurs in GX Works3 when the total of selected head device number and the allocated points exceed the valid range for the selected PLC device. 6 COMMUNICATION SETTING 6.1 Setup Method for MODBUS Serial Communication **28** ## **Latch Setting** In latch setting, it can be set up whether the host number should operate using the GX Works3 parameter or special register. - In the case of "Do Not Latch", the host number operates using the value set by the parameter setting of GX Works3. - In the case of "Latch", special relays corresponding to each CH turn on and the host number operates using the value set by special registers. Value of special registers can be changed by program. The following table shows, special relays and special registers corresponding for each channel. |**Special relays**|**Special registers**| |---|---| |SM8861|SD8861| |SM8871|SD8871| |SM8881|SD8881| |SM8891|SD8891| Setting value of special registers or parameter are reflected when the power supply is turned from off to on or reset. Precautions **6** When the SD latch setting valid information is set to off due to memory clear and so on, while special registers are set to ~~——_ i. Y~~ s "Latch" by the parameter, the parameter setting becomes valid when the power is turned off to on or reset. ## **SM/SD for FX3 Series compatible** In the FX5, special relays of the FX3 and special registers of the FX3 can be used in the compatibility area. Channel numbers may differ between the FX3 and the FX5 depending on the configuration. Select whether to use special devices for the corresponding channel number (CH1 or CH2) in this setting. - When this setting is not configured, SM and SD for FX3 series compatibility are not used. - When this setting is configured, select CH1 or CH2 SM and SD for FX3 series compatibility. For the device for FX3 series compatible, refer to the following. - Page 33 Related Devices 6 COMMUNICATION SETTING 6.1 Setup Method for MODBUS Serial Communication **29** **7 FUNCTION** This chapter explains the function of MODBUS serial communication. ## **7.1 Master Function** In the FX5 master function, communication is executed with the slave station using the ADPRW instruction. ## **ADPRW** This instruction allows to communicate (read/write data) with the slave station by the function code which is supported by the master. **Ladder diagram Structured text** ENO:=ADPRW(EN,s1,s2,s3,s4,s5d1,d2); (s1) (s2) (s3) (s4) (s5)/(d1) (d2) ## **FBD/LD** **==> picture [51 x 76] intentionally omitted <==** **----- Start of picture text -----**<br> EN ENO<br>s1 d2<br>s2<br>s3<br>s4<br>s5d1<br>**----- End of picture text -----**<br> ## Setting data ## ■ **Descriptions, ranges, data types** |**Operand**|**Description**|**Range**|**Data type**|**Data type (label)**| |---|---|---|---|---| |(s1)|Slave node address|0 to 20H|16-bit signed binary|ANY16| |(s2)|Function code (Refer toPage 31)|01H to 06H, 0FH, 10H|16-bit signed binary|ANY16| |(s3)|Function parameter depending on the function code<br>(Refer toPage 31)|0 to FFFFH|16-bit signed binary|ANY16| |(s4)|Function parameter depending on the function code<br>(Refer toPage 31)|1 to 2000|16-bit signed binary|ANY16| |(s5)/(d1)|Function parameter depending on the function code<br>(Refer toPage 31)||Bit/16-bit signed binary|ANY_ELEMENTARY| |(d2)*1|Start bit device number to which communication execution<br>status is output||Bit|ANYBIT_ARRAY<br>(Number of elements: 3)| - *1 Three devices are occupied from the device specified in (d2). Make sure that these devices are not used in other controls. ## ■ **Available devices** |**Operand**|**Bit**|**Bit**|**Bit**|**Word**|**Word**|**Word**|**Double word**|**Double word**|**Indirect**<br>**specification**|**Constant**|**Constant**|**Constant**|**Others**| |---|---|---|---|---|---|---|---|---|---|---|---|---|---| ||**X, Y, M, L,**<br>**SM, F, B, SB**|**U****\G**|**T, ST,**<br>**C, LC**|**T, ST, C, D,**<br>**W, SD, SW, R**|**U****\G**|**Z**|**LC**|**LZ**||**K, H**|**E**|**$**|| |(s1)||||*1|||||||||| |(s2)||||*1|||||||||| |(s3)||||*1|||||||||| |(s4)||||*1|||||||||| |(s5)/(d1)||||*1|||||||||| |(d2)||||*1|||||||||| *1 T, ST, C cannot be used. 7 FUNCTION 7.1 Master Function **30** **7** ## Processing details - Function code (s2) is operated on slave node address (s1) according to parameters (s3), (s4), and (s5)/(d1). Use 0 as the slave node address (s1) for broadcast commands. (Refer to Page 31 Function code and function parameters.) - The communication execution status (d2) is output according to each status of the ADPRW instruction such as communicating/completed normally/completed with an error. (Refer to Page 32 Communication execution status output device.) ## ■ **Function code and function parameters** The following table shows the parameter allocation of (s3), (s4), and (s5)/(d1) for each function code (s2). |**(s2): Function**<br>**code**|**(s3): MODBUS address**|**(s4): Device count**|**(s5)/(d1): Start device storing data**|**(s5)/(d1): Start device storing data**| |---|---|---|---|---| ||**Applicable device:****(Refer to the following**<br>**applicable devices.)**|||| |01H<br>Read coils|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 2000|Start device storing read data|| ||||Applicable device|Word device<br>(Refer to the following table of the applicable devices.)<br>Bit device<br>(Refer to the following table of the applicable devices.)| ||||Number of<br>occupied points|Word device<br>((s4) + 15)16 points*1<br>Bit device<br>(s4) points| |02H<br>Read inputs|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 2000|Start device storing read data|| ||||Applicable device|Word device<br>(Refer to the following table of the applicable devices.)<br>Bit device<br>(Refer to the following table of the applicable devices.)| ||||Occupied points|Word device<br>((s4) + 15)16 points*1<br>Bit device<br>(s4) points| |03H<br>Read holding<br>registers|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 125|Start device storing read data|| ||||Applicable device|(Refer to the following table of the applicable devices.)| ||||Occupied points|(s4) points| |04H<br>Read input<br>registers|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 125|Start device storing read data|| ||||Applicable device|(Refer to the following table of the applicable devices.)| ||||Occupied points|(s4) points| |05H<br>Write coils|MODBUS address:<br>0000H to FFFFH|0 (fixed)|Start device storing write data|| ||||Applicable<br>device*2|Word device<br>(Refer to the following table of the applicable devices.)<br>Bit device<br>(Refer to the following table of the applicable devices.)| ||||Occupied points|1 point| |06H<br>Write holding<br>registers|MODBUS address:<br>0000H to FFFFH|0 (fixed)|Start device storing write data|| ||||Applicable device|(Refer to the following table of the applicable devices.)| ||||Occupied points|1 point| |0FH<br>Write multiple<br>coils|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 1968|Start device storing write data|| ||||Applicable device|Word device<br>(Refer to the following table of the applicable devices.)<br>Bit device<br>(Refer to the following table of the applicable devices.)| ||||Occupied points|Word device<br>((s4) + 15)16 points*1<br>Bit device<br>(s4) points| |10H<br>Write multiple<br>holding registers|MODBUS address:<br>0000H to FFFFH|Device count:<br>1 to 123|Start device storing write data|| ||||Applicable device|(Refer to the following table of the applicable devices.)| ||||Occupied points|(s4) points| - *1 Fractions are rounded off. - *2 When the least significant bit is 0, the bit is off. When the least significant bit is 1, the bit is on. 7 FUNCTION 7.1 Master Function **31** Applicable device table |**No.**|**Applicable device**| |---|---| ||T, ST, C, D, R, W, SW, SD, label device| ||T, ST, C, D, R, W, SW, SD, label device, K, H| ||X, Y, M, L, B, F, SB, S, SM, label device| ## ■ **Communication execution status output device** The following shows the timing of operation of the communication execution status output device (d2) according to each communication status, and the special relays which operate at the same time. |**Operand**|**Timing of operation**|**Special relay which operates at the same time**| |---|---|---| |(d2)|Turns on while the instruction is executed and<br>turns off in the status other than while the<br>instruction is executed.|SM8800 (CH1), SM8810 (CH2), SM8820 (CH3), SM8830 (CH4)*1| |(d2) + 1*2|Turns on when the instruction is completed<br>normally and turns off when the instruction is<br>started.|SM8029| |(d2) + 2*2|Turns on when the instruction is completed<br>with an error and turns off when the instruction<br>is started.|SM8029| - *1 SM8401 (CH1) or SM8421 (CH2) turn on, when SM/SD for FX3 compatible is set. - *2 (d2) + 1 turns on when the instruction is completed normally and (d2) + 2 turns on when the instruction is completed with an error, so that whether the instruction is completed normally or with an error can be judged. ## Precautions - The channel which uses the ADPRW instruction must be set to the master station by the GX Works3. (Page 25 Fixed Setting) When it is not set, the device does not operate even though the ADPRW instruction is executed. (Also no error occurs.) - If the program stops due to error, the device value is turned off if a non-latch device is designated as the communication execution status output device. Specify a latch device to keep the communication state output. 7 FUNCTION **32** 7.1 Master Function ## **7.2 Slave Function** This function performs operations according to the supported function code by communication with the master station. For the supported function codes, refer to Page 19 List of supported MODBUS standard functions. ## **7.3 Related Devices** In this section, the functions of the special registers and special relays are described for MODBUS serial communication. ## **List of related devices** ## **Special relays** The table shows the special relays used for the FX5 MODBUS serial communication. ■ **Only for FX5 Device number Name Valid Details R/W CH1 CH2 CH3 CH4** SM8500 SM8510 SM8520 SM8530 Serial communication error Master/ Turns on when an error occurs during the serial R Slave communication. SM8800 SM8810 SM8820 SM8830 During MODBUS serial Master Turns on when the instruction is started until the instruction R communication execution complete flag is turned on during MODBUS **7** serial communication. SM8801 SM8811 SM8821 SM8831 Retry Master Turns on while the master sends retries when the slave R fails to respond until timeout setting time. SM8802 SM8812 SM8822 SM8832 Timeout Master Turns on if a response timeout occurs. R SM8861 SM8871 SM8881 SM8891 Host station number latch Slave Turns on when the latch setting is set to "Latch". *1 setting valid ~~Zs~~ R: Read only, R/W: Read/Write *1 The devices become R/W when a latch is set and R when a latch is not set. ■ **For FX3 compatibility Device number Name Valid Details R/W CH1 CH2** SM8029 Instruction execution Master Turns on if the processing of an instruction is completed. R complete SM8401 SM8421 During MODBUS Master Turns on when the instruction is started until the instruction R communication execution complete flag is turned on during MODBUS serial communication. SM8402 SM8422 MODBUS communication Master Turns on when an error occurs during MODBUS serial R error communication. SM8403 SM8423 MODBUS communication Master/ Turns on once an error occurs during MODBUS serial R error (latched) Slave communication. SM8063 SM8438 Serial communication error Master/ Turns on once an error occurs during MODBUS serial R Slave communication. SM8408 SM8428 Retry Master Turns on while the master sends retries when the slave R fails to respond until timeout setting time. SM8409 SM8429 Timeout Master Turns on if a response timeout occurs. R ~~==~~ R: Read only 7 FUNCTION 7.2 Slave Function **33** ## **Special registers** The table shows the special registers used for the FX5 MODBUS serial communication. ## ■ **Only for FX5** ||**Device number**|**Device number**|||**Name**|**Valid**|**Details**|**R/W**| |---|---|---|---|---|---|---|---|---| ||**CH1**|**CH2**|**CH3**|**CH4**||||| ||SD8500|SD8510|SD8520|SD8530|Serial communication error|Master/|Stores the current error code generated during serial|R| ||||||code|Slave|communication.|| ||SD8501|SD8511|SD8521|SD8531|Serial communication error|Master/|Stores current error details.|R| ||||||details|Slave||| ||SD8502|SD8512|SD8522|SD8532|Serial communication|Master/|Stores the communication properties in the CPU module.|R| ||||||setting|Slave||| ||SD8503|SD8513|SD8523|SD8533|Serial communication|Master/|Stores the mode of serial communication being executed.|R| ||||||operation mode|Slave||| ||SD8800|SD8810|SD8820|SD8830|Current retry value|Master/|Stores the current value of retries of when a|R| |||||||Slave|communication retry is executed due to slave response|| ||||||||timeout.|| ||SD8861|SD8871|SD8881|SD8891|Host station number|Master/|Stores the host station number setting value.|*1| |||||||Slave||| ||SD8862|SD8872|SD8882|SD8892|Slave response timeout|Master/|Stores the slave response timeout setting value.|R| |||||||Slave||| ||SD8863|SD8873|SD8883|SD8893|Broadcast delay|Master/|Stores the broadcast delay setting value.|R| |||||||Slave||| ||SD8864|SD8874|SD8884|SD8894|Message to message delay|Master/|Stores the message to message delay setting value.|R| |||||||Slave||| ||SD8865|SD8875|SD8885|SD8895|Timeout retry count|Master/|Stores the timeout retry count setting value.|R| |||||||Slave||| ||R: Read, R/W: Read/Write|||||||| ||*1<br>The devices vary depending on the Latch Setting. The device becomes R when the Latch setting is "Do not Latch", and R/W when the|The devices vary depending on the Latch Setting. The device becomes R when the Latch setting is "Do not Latch", and R/W when the|||||The devices vary depending on the Latch Setting. The device becomes R when the Latch setting is "Do not Latch", and R/W when the|| ||Latch setting is "Latch".|||||||| ||■**For FX3 compatibility**|||||||| ||**Device number**<br>**Name**<br>**Valid**<br>**Details**<br>**R/W**<br>**CH1**<br>**CH2**<br>SD8063<br>SD8438<br>Serial communication error<br>code<br>Master/<br>Slave<br>Stores the current error code generated during serial<br>communication.<br>R<br>SD8402<br>SD8422<br>Communication error code<br>Master/<br>Slave<br>Stores the current error code generated during serial<br>communication.<br>R<br>SD8403<br>SD8423<br>Error details<br>Master/<br>Slave<br>Stores the current error details.<br>R<br>SD8405<br>SD8425<br>Communication format<br>setting value<br>Master/<br>Slave<br>Stores the communication parameter set in the CPU<br>module.<br>R<br>SD8408<br>SD8428<br>Current retry value<br>Master/<br>Slave<br>Stores the current value of retries of when a<br>communication retry is executed due to slave response<br>timeout.<br>R<br>SD8419<br>SD8439<br>Communication operation<br>mode<br>Master/<br>Slave<br>Stores the communication operation mode in the CPU<br>module.<br>R<br>R: Read<br>~~ae~~|||||||| |**34**|7 FUNCTION<br>7.3 Related Devices|||||||| ## **Details of Related Devices** The following devices are used in MODBUS serial communication. The devices of "For FX3 compatibility" operate in the channel which specifies by the SM/SD for FX3 compatibility in communication setting. ## **Instruction execution complete** This device checks whether the execution of the instruction is completed. **Only for FX5 For FX3 compatibility Description R/W CH1 CH2 CH3 CH4 CH1 CH2** SM8029 Turns on if the processing of the instruction is completed. R ~~ST~~ R: Read SM8029 is also used as the execution completed flag for other instructions (such as positioning instructions). When using SM8029, provide the contact just under the instruction whose execution completion is to be checked. ## Precautions Do not turn ON with program or engineering tool. This device does not turn OFF even if normal communication is restored. The device is cleared when the power supply is **7** turned from off to on, reset, set from STOP to RUN, or the next ADPRW instruction is executed. **During MODBUS communication** ~~a~~ This device checks if MODBUS serial communication is being executed. |**Only for FX5**<br>~~Le~~|**Only for FX5**<br>~~Le~~|**Only for FX5**<br>~~Le~~|**Only for FX5**<br>~~Le~~|**For FX3 compatibility**<br>~~Le~~|**For FX3 compatibility**<br>~~Le~~|**Description**<br>~~Le~~|**R/W**<br>~~Le~~| |---|---|---|---|---|---|---|---| |**CH1**<br>~~Le~~|**CH2**<br>~~Le~~|**CH3**<br>~~Le~~|**CH4**<br>~~Le~~|**CH1**<br>~~Le~~|**CH2**<br>~~Le~~||| |SM8800<br>~~Le~~|SM8810<br>~~Le~~|SM8820<br>~~Le~~|SM8830<br>~~Le~~|SM8401<br>~~Le~~|SM8421<br>~~Le~~|Turns on when the instruction is started until the instruction<br>execution complete flag is turned on during MODBUS<br>serial communication.<br>~~Le~~|R<br>~~Le~~| ## Precautions Do not turn ON with program or engineering tool. The device is cleared when the power supply is turned from off to on, reset, or set from STOP to RUN. ## **MODBUS communication error** |**For FX3 compatibility**<br>~~a~~|**For FX3 compatibility**<br>~~a~~|**Description**|**R/W**| |---|---|---|---| |**CH1**<br>~~a~~|**CH2**||| |SM8402<br>~~a~~|SM8422|Turns on when an error occurs during MODBUS serial<br>communication.|R| ## Precautions Do not turn ON with program or engineering tool. This device does not turn OFF even if normal communication is restored. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, SM50 (Error Detection Reset Completion) is turned on, or the next ADPRW instruction is executed. 7 FUNCTION 7.3 Related Devices **35** ## **MODBUS communication error (latched)** This device checks if an error occurs during MODBUS serial communication. **For FX3 compatibility Description R/W CH1 CH2** SM8403 SM8423 Turns on once an error occurs during MODBUS serial R communication. ~~—————~~ R: Read Precautions Do not turn ON with program or engineering tool. The device is cleared when the power supply is turned from off to on, reset, or set from STOP to RUN. ## **Serial communication error** |**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**For FX3 compatibility**|**For FX3 compatibility**|**Description**|**R/W**| |---|---|---|---|---|---|---|---| |**CH1**<br>~~a~~|**CH2**<br>~~a~~|**CH3**<br>~~a~~|**CH4**|**CH1**|**CH2**||| |SM8500<br>~~a~~|SM8510<br>~~a~~|SM8520<br>~~a~~|SM8530|SM8063|SM8438|Turns on when an error occurs during serial<br>communication.|R| ## Precautions Do not turn ON with program or engineering tool. This device do not turn OFF even if normal communication is restored. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, or SM50 (Error Detection Reset Completion) is turned on. ## **Retry** This device checks if a retry occurs during MODBUS serial communication. |**Only for FX5**<br>~~os~~|**Only for FX5**<br>~~os~~|**Only for FX5**<br>~~os~~|**Only for FX5**<br>~~os~~|**For FX3 compatibility**|**For FX3 compatibility**|**Description**|**R/W**| |---|---|---|---|---|---|---|---| |**CH1**<br>~~os~~|**CH2**|**CH3**|**CH4**|**CH1**|**CH2**||| |SM8801<br>~~os~~|SM8811|SM8821|SM8831|SM8408|SM8428|Turns on while the master sends retries when the slave<br>fails to respond in time.|R| ## Precautions Do not turn ON with program or engineering tool. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, SM50 (Error Detection Reset Completion) is turned on, or the next ADPRW instruction is executed. 7 FUNCTION **36** 7.3 Related Devices ## **Timeout** This device checks if a timeout occurs during MODBUS serial communication. ||||**For FX3 compatibility**<br>~~a~~|**For FX3 compatibility**<br>~~a~~|**Description**<br>~~a~~| |---|---|---|---|---|---| |**CH2**<br>~~a~~|**CH3**<br>~~a~~|**CH4**<br>~~a~~|**CH1**<br>~~a~~|**CH2**<br>~~a~~|| |SM8812<br>~~a~~|SM8822<br>~~a~~|SM8832<br>~~a~~|SM8409<br>~~a~~|SM8429<br>~~a~~|Turns on if a response timeout occurs.<br>~~a~~| ## Precautions Do not turn ON with program or engineering tool. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, SM50 (Error Detection Reset Completion) is turned on, or the next ADPRW instruction is executed. If the number of retries is 1 or more, the error flag (Page 43 Error flags) is not set until the set number of retries fail by timeout (or another failure). ## **Host station number SD latch setting valid** The device which set latch valid/invalid of host station number for MODBUS serial communication. |**7**<br>**Only for FX5**<br>**Description**<br>**R/W**<br>**CH1**<br>**CH2**<br>**CH3**<br>**CH4**<br>SM8861<br>SM8871<br>SM8881<br>SM8891<br>Turns on when host station number setting is "Latch" in<br>MODBUS communication parameter.<br>*1<br>R: Read, R/W: Read/Write<br>~~ee~~|**7**<br>**Only for FX5**<br>**Description**<br>**R/W**<br>**CH1**<br>**CH2**<br>**CH3**<br>**CH4**<br>SM8861<br>SM8871<br>SM8881<br>SM8891<br>Turns on when host station number setting is "Latch" in<br>MODBUS communication parameter.<br>*1<br>R: Read, R/W: Read/Write<br>~~ee~~|**7**<br>**Only for FX5**<br>**Description**<br>**R/W**<br>**CH1**<br>**CH2**<br>**CH3**<br>**CH4**<br>SM8861<br>SM8871<br>SM8881<br>SM8891<br>Turns on when host station number setting is "Latch" in<br>MODBUS communication parameter.<br>*1<br>R: Read, R/W: Read/Write<br>~~ee~~|**7**<br>**Only for FX5**<br>**Description**<br>**R/W**<br>**CH1**<br>**CH2**<br>**CH3**<br>**CH4**<br>SM8861<br>SM8871<br>SM8881<br>SM8891<br>Turns on when host station number setting is "Latch" in<br>MODBUS communication parameter.<br>*1<br>R: Read, R/W: Read/Write<br>~~ee~~| |---|---|---|---| |*1<br>The devices vary depending on the Latch Setting. The device becomes R when the Latch setting is "Do not Latch", and R/W when the|||| |Latch setting is "Latch".|||| ## Precautions Do not turn ON with program or engineering tool. The device is set when the power supply is turned from off to on or reset. ## **Serial communication error code** |**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**Only for FX5**<br>~~a~~|**For FX3 compatibility**|**For FX3 compatibility**|**Description**|**R/W**| |---|---|---|---|---|---|---|---| |**CH1**<br>~~a~~|**CH2**<br>~~a~~|**CH3**<br>~~a~~|**CH4**|**CH1**|**CH2**||| |SD8500<br>~~a~~|SD8510<br>~~a~~|SD8520<br>~~a~~|SD8530|SD8402<br>SD8063|SD8422<br>SD8438|Stores the current error code generated by serial<br>communication.|R| ## Precautions Do not change the device value using a program or an engineering tool. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, or SM50 (Error Detection Reset Completion) is turned on, only in the master. 7 FUNCTION 7.3 Related Devices **37** ## **Serial communication error details** This device stores the current error details during serial communication. (Page 43 Error code.) ||||**For FX3 compatibility**<br>~~a~~|**For FX3 compatibility**<br>~~a~~|**Description**<br>~~a~~| |---|---|---|---|---|---| |**CH2**<br>~~a~~|**CH3**<br>~~a~~|**CH4**<br>~~a~~|**CH1**<br>~~a~~|**CH2**<br>~~a~~|| |SD8511<br>~~a~~|SD8521<br>~~a~~|SD8531<br>~~a~~|SD8403<br>~~a~~|SD8423<br>~~a~~|Stores the current error details generated during serial<br>communication.<br>~~a~~| ## Precautions Do not change the device value using a program or an engineering tool. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, or SM50 (Error Detection Reset Completion) is turned on, only in the master. ## **Communication format setting value** This device stores the communication format setting value. |**Bit**|**Name**|**Description**|**Description**| |---|---|---|---| |||**0 (bit = OFF)**|**1 (bit = ON)**| |b0|<br>~~=~~|<br>~~=~~|<br>~~=~~| |b1, b2|Parity bit<br>~~=~~|(b2, b1) = (0, 0): None<br>(b2, b1) = (0, 1): Odd<br>(b2, b1) = (1, 1): Even<br>~~=~~|| |b3|Stop bit<br>~~=~~|1bit<br>~~=~~|2bit<br>~~=~~| |b4 to b7|Baud rate (bps)<br>~~|~~|(b7, b6, b5, b4) = (0, 0, 1, 1): 300<br>(b7, b6, b5, b4) = (0, 1, 0, 0): 600<br>(b7, b6, b5, b4) = (0, 1, 0, 1): 1200<br>(b7, b6, b5, b4) = (0, 1, 1, 0): 2400<br>(b7, b6, b5, b4) = (0, 1, 1, 1): 4800<br>(b7, b6, b5, b4) = (1, 0, 0, 0): 9600<br>(b7, b6, b5, b4) = (1, 0, 0, 1): 19200<br>(b7, b6, b5, b4) = (1, 0, 1, 0): 38400<br>(b7, b6, b5, b4) = (1, 0, 1, 1): 57600<br>(b7, b6, b5, b4) = (1, 1, 0, 1): 115200<br>~~|~~|| |b8 to b15|<br>~~|~~|<br>~~|~~|| ## Precautions ~~|~~ Do not change the device value using a program or an engineering tool. The setting value changes when the power supply is turned from off to on or reset. 7 FUNCTION 7.3 Related Devices **38** **7** ## **Operation mode display** This device stores the operation mode of the serial communication being executed. **Only for FX5 For FX3 compatibility Description R/W CH1 CH2 CH3 CH4 CH1 CH2** SD8503 SD8513 SD8523 SD8533 SD8419 SD8439 0: MELSOFT Connection R 2: MC protocol 3: PLC to PLC to simple link Communication 5: Non-protocol Communication 7: Inverter Communication 9: MODBUS RTU Communication 12: Predefined protocol support Other than above: Not used R: Read Precautions ~~TET~~ Do not change the device value using a program or an engineering tool. The device is cleared when ADPRW instruction is executed. **Current retry value** This device stores the current retry value. **Only for FX5 For FX3 compatibility Description R/W CH1 CH2 CH3 CH4 CH1 CH2** SD8800 SD8810 SD8820 SD8830 SD8408 SD8428 Stores the current value of retries executed by the slave R response timeout. R: Read Precautions ~~————~~ Do not change the device value using a program or an engineering tool. The device is cleared when the power supply is turned from off to on, reset, set from STOP to RUN, SM50 (Error Detection Reset Completion) is turned on, or next ADPRW instruction is executed. **Host station number** This device stores the host station number setting value. **Only for FX5 Description R/W CH1 CH2 CH3 CH4** SD8861 SD8871 SD8881 SD8891 Stores the parameters (host station number) set by a *1 program or an engineering tool. For 0: Master station For 1 to 247: Slave station (station number: 1 to 247) ~~a~~ R: Read, R/W: Read/Write - *1 The devices vary depending on the Latch Setting. The device becomes R when the Latch setting is "Do not Latch", and R/W when the Latch setting is "Latch". ## Precautions ## "Latch" The device value can be changed by the program. ## "Do Not latch" Do not change the device value using a program or an engineering tool. ## Change "Do Not Latch" to "Latch" The setting value is reflected when the power supply is turned from off to on or reset, after parameter write from an engineering tool. 7 FUNCTION 7.3 Related Devices **39** ## **Slave response timeout** This device stores the slave response timeout setting value. |**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Description**<br>~~———~~|**R/W**<br>~~———~~| |---|---|---|---|---|---| |**CH1**<br>~~———~~|**CH2**<br>~~———~~|**CH3**<br>~~———~~|**CH4**<br>~~———~~||| |SD8862<br>~~———~~|SD8872<br>~~———~~|SD8882<br>~~———~~|SD8892<br>~~———~~|Stores the parameters (slave response timeout) set by an<br>engineering tool.<br>~~———~~|R<br>~~———~~| ## Precautions The setting value is reflected when the power supply is turned from off to on, reset, or the next ADPRW instruction is executed. ## **Broadcast delay** This device stores the broadcast delay setting value. |**Only for FX5**<br>~~el~~|**Only for FX5**<br>~~el~~|**Only for FX5**<br>~~el~~|**Only for FX5**<br>~~el~~|**Description**<br>~~el~~|**R/W**<br>~~el~~| |---|---|---|---|---|---| |**CH1**<br>~~el~~|**CH2**<br>~~el~~|**CH3**<br>~~el~~|**CH4**<br>~~el~~||| |SD8863<br>~~el~~|SD8873<br>~~el~~|SD8883<br>~~el~~|SD8893<br>~~el~~|Stores the parameters (broadcast delay) set by an<br>engineering tool.<br>~~el~~|R<br>~~el~~| ## Precautions The setting value is reflected when the power supply is turned from off to on, reset, or the next ADPRW instruction is executed. ## **Message to message delay** |**Message to message delay**|**Message to message delay**||| |---|---|---|---| |This device stores the message to message delay setting value.|||| |**Only for FX5**<br>**Description**<br>**R/W**<br>**CH1**<br>**CH2**<br>**CH3**<br>**CH4**<br>SD8864<br>SD8874<br>SD8884<br>SD8894<br>Stores the parameters (message to message delay) set by<br>an engineering tool.<br>R<br>~~———~~|||| |R: Read|||| |Precautions|||| The setting value is reflected when the power supply is turned from off to on, reset, or the next ADPRW instruction is executed. ## **Timeout retry count** This stores the timeout retry count setting value. |**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Only for FX5**<br>~~———~~|**Description**<br>~~———~~|**R/W**<br>~~———~~| |---|---|---|---|---|---| |**CH1**<br>~~———~~|**CH2**<br>~~———~~|**CH3**<br>~~———~~|**CH4**<br>~~———~~||| |SD8865<br>~~———~~|SD8875<br>~~———~~|SD8885<br>~~———~~|SD8895<br>~~———~~|Stores the parameters (timeout retry count) set by an<br>engineering tool.<br>~~———~~|R<br>~~———~~| ## Precautions The setting value is reflected when the power supply is turned from off to on, reset, or the next ADPRW instruction is executed. 7 FUNCTION **40** 7.3 Related Devices **8** ## **8 CREATING PROGRAMS** This chapter explains an example of creating programs for the master in MODBUS serial communication. ## **8.1 Creating Programs for the Master Station** Programs allowing the master station to read and write slave station devices can be created as shown in the example below. For ADPRW instruction, refer to Page 30 ADPRW. For cautions on program creation, refer to Page 41 Cautions on Program Creation. **==> picture [308 x 238] intentionally omitted <==** **----- Start of picture text -----**<br> Read Coils from Slave 02H<br>M0<br>ADPRW H2 H1 K100 K8 D0 M10<br>M11<br>RST M0<br>Instruction completed normally<br>Write Multiple Registers to Slave 03H<br>M1<br>ADPRW H3 H10 K0 K4 D1000 M20<br>M21<br>RST M1<br>Instruction completed normally<br>**----- End of picture text -----**<br> Program for Reading Coils Slave address: 02H Function code: 01H MODBUS address: 100 Device count: 8 Start device storing read data: D0 8 coil device values starting at MODBUS Address 100 of Slave 02H are read to the first 8 bits in D0 of the Master. Program for Writing Multiple Registers Slave address: 03H Function code: 10H MODBUS address: 0 Device count: 4 Start device storing write data: D1000 The value of D1000 to D1003 of the Master is written to MODBUS Address 0 and onward for Slave 03H. ## **8.2 Cautions on Program Creation** - Make sure the driving contact of the ADPRW instruction does not turn off until the instruction has been completed. - When driving multiple ADPRW instructions at the same time, the next ADPRW instruction in the program is executed after the current instruction has been completed. (only one instruction will be executed at a time) - When using the Read coils function or Read inputs function in the Master with a word device (i.e. D, or R) as the destination device, only the number of bits assigned in the device count of the ADPRW instruction will be overwritten. The remaining bits of the word device will not be affected. 8 CREATING PROGRAMS 8.1 Creating Programs for the Master Station **41** ## **APPENDIX** ## **A endix 1 pp Troubleshooting** ## **Checking the communication status based on LED indication** Check the status of the "RD" and "SD" indicator LEDs provided. |**LED status**||||**Operation status**| |---|---|---|---|---| |**RD**||**SD**||| |While MODBUS serial communication is functioning normally, both LEDs are lit.<br>Lit<br>Lit<br>Unlit<br>Unlit|While MODBUS serial communication is functioning normally, both LEDs are lit.<br>Lit<br>Unlit<br>Lit<br>Unlit<br>~~||||~~||While MODBUS serial communication is functioning normally, both LEDs are lit.|While MODBUS serial communication is functioning normally, both LEDs are lit.<br>Data is being sent and received.<br>Data is received, but is not sent.<br>Data is sent, but is not received.<br>Data is neither sent nor received.| While MODBUS serial communication is functioning normally, both LEDs are lit. If they are not lit, check the wiring, communication settings, and error statuses of the master and slave stations. ## **Checking the installation and wiring** ## ■ **Mounting status** Verify that the communication equipment is securely connected with the CPU module, the expansion board or the expansion adapter. If the communication equipment is not securely connected, communication will not function correctly. For the mounting procedure, refer to the respective communication equipment manual. ## ■ **Wiring** Verify that all communication equipment is correctly wired. If the wiring is incorrect, communication will not function correctly. For the wiring check method, refer to Page 20 WIRING. ## **Checking parameters** ## ■ **Communication setting of parameters** Verify that the communication setting parameters are suitable for use. If the communication settings are not suitable for use, communication will not function correctly. After changing any parameters, make sure to turn off the CPU module power, and then the power on again, or reset. For the MODBUS communication settings, refer to Page 25 COMMUNICATION SETTING. APPENDIX **42** Appendix 1 Troubleshooting **A** ## **A endix 2 Error code pp** ## **Serial communication error** ## ■ **Error flags** |**FX5 dedicated**<br>~~——~~|**FX5 dedicated**<br>~~——~~|**FX5 dedicated**<br>~~——~~|**FX5 dedicated**<br>~~——~~|**FX3 compatible**<br>~~——~~|**FX3 compatible**<br>~~——~~|**Name**<br>~~——~~|**Description**<br>~~——~~| |---|---|---|---|---|---|---|---| |**CH1**<br>~~——~~|**CH2**<br>~~——~~|**CH3**<br>~~——~~|**CH4**<br>~~——~~|**CH1**<br>~~——~~|**CH2**<br>~~——~~||| |SM8500<br>~~——~~|SM8510<br>~~——~~|SM8520<br>~~——~~|SM8530<br>~~——~~|SM8063<br>~~——~~|SM8438<br>~~——~~|Serial communication error<br>~~——~~|Turns ON when an error occurs in serial communication.<br>~~——~~| |<br>~~——~~||||SM8402<br>~~——~~|SM8422<br>~~——~~|MODBUS communication<br>error<br>~~——~~|Turns ON when an error occurs in MODBUS<br>communication.<br>~~——~~| |||||SM8403<br>~~——~~|SM8423<br>~~——~~|MODBUS communication<br>error (latched)<br>~~——~~|Turns on once an error occurs during MODBUS serial<br>communication.<br>~~——~~| |**FX5 dedicated**|**FX5 dedicated**|**FX5 dedicated**|**FX5 dedicated**|**FX3 compatible**|**FX3 compatible**|**Name**|**Description**| |---|---|---|---|---|---|---|---| |**CH1**|**CH2**|**CH3**|**CH4**|**CH1**|**CH2**||| |SD8500|SD8510|SD8520|SD8530|SD8402<br>SD8063|SD8422<br>SD8438|Serial communication error<br>code|When a serial communication error occurs, the error<br>code is stored.| |SD8501|SD8511|SD8521|SD8531|SD8403|SD8423|Serial communication error<br>detail|When a serial communication error occurs, the error<br>detail is stored.| |**Error code**|**Error details**|**Error name and Description**|**Error station**| |---|---|---|---| |7001H||When used by the communication other than MODBUS<br>communication|Slave| |7010H||Parity, overrun (rx register) or framing error|Master/Slave| |7302H|SD number where an error occurred is stored|Invalid MODBUS communication parameter setup<br>(Invalid SD setting)|Master/Slave| |7304H||CRC error|Master/Slave| |7305H||Bus character overrun<br>The received data amount is 256 bytes or more|Master/Slave| |7306H|<br>~~——~~|Data length mismatch<br>The number of bytes received does not match with the specified<br>number of bytes<br>~~——~~|Master/Slave| |7307H|<br>~~——~~|Unsupported function code error<br>~~——~~|Slave| |7308H|<br>~~——~~|Invalid device address<br>~~——~~|Slave| |7309H|<br>~~——~~|Slave response timeout<br>A slave does not respond within the time set in the time-out time<br>setting of the communication parameter<br>~~——~~|Master| |730AH|The following "response message formats" are set.<br>Exception function code: High-order byte<br>Exception code: Low-order byte<br>(Page 44 When the processing is completed in<br>error at the slave)<br>~~——~~|Exception response error<br>Slave answers by exception response<br>~~——~~|Master| |730BH|The following "response message formats" are set.<br>Request station number: High-order byte<br>Response station number: Low-order byte<br>~~——~~|Slave node address mismatch<br>The slave node address of the response does not match the slave<br>node address of the request<br>~~——~~|Master| |730CH|The following "response message formats" are set.<br>Request function code: High-order byte<br>Response function code: Low-order byte|Function code mismatch<br>The function code of the response does not match the function<br>code of the request|Master| |730DH|Response function code is stored.|Illegal broadcast command<br>The read command is a broadcast command.|Slave| |730EH||Illegal data value in request<br>A value outside the valid range is included in a request message|Slave| APPENDIX Appendix 2 Error code **43** ## ■ **When the processing is completed in error at the slave** When a master receives an exception response from a slave, the following "response message formats" are set. b15 to b8 b7 to b0 Exception function code Exception code (high-order byte) (low-order byte) The following table outlines the exception function codes (high-order byte). |**Exception**<br>**function code**|**Function name**|**Details**| |---|---|---| |81H|Read coils|Completed with an error by read binary (R/W) devices| |82H|Read discrete inputs|Completed with an error by read binary (RO) devices| |83H|Read holding registers|Completed with an error by read 16 bit (R/W) register| |84H|Read input registers|Completed with an error by read 16 bit (RO) register| |85H|Write single coil|Completed with an error by write single binary device| |86H|Write single register|Completed with an error by write single 16 bit register device| |8FH|Write multiple coils|Completed with an error by write multiple binary (R/W) devices| |90H|Write multiple registers|Completed with an error by write multiple 16 bit (R/W) registers| The following table outlines the exception codes (low-order byte). |**Exception code**|**Exception code name**|**Details**| |---|---|---| |01H|Illegal function code|Unsupported function code was received| |02H|Illegal device address|MODBUS address to which device is not allocated was accessed| |03H|Illegal data value|An error occurred in the data area of the request message| |04H|Failure during processing|An unrecoverable error occurred and processing was suspended while the slave was processing<br>the request| ## **Operation error** ## ■ **Error flags** The operation error flag turns ON when an operation error occurs in the ADPRW instruction. Verify that the device specified in the table below is ON. **FX5 dedicated Name Description CH1 CH2 CH3 CH4** SM0 Latest self-diagnostic error Turns ON when an operation error occurs. (Including the annunciator ON) SM1 Latest self-diagnostic error (Not including the annunciator ON) SM56, SM8067 Operation error ~~—_——~~ ■ **Error codes** When the operation error flag turns ON, the error code (hexadecimal) is stored in the operation error code (SD0/SD8067). The error codes stored in the device are shown as follows. **Error code Description Details Error station** 1810H Channel double use Channel used by the instruction is used by another instruction. Master/Slave 3600H Invalid parameter setup The instruction is used in Slave mode. Slave 2822H A device was specified that cannot be Wrong operand set for the instruction. Master specified with the instruction. 3405H Data was entered outside of the range that The operand device number range or data value set for the Master can be specified. instruction is out of range. 2820H A device or label was beyond the range that The operand corresponding device set for the instruction is out of Master can be specified with the instruction. range. ~~==~~ APPENDIX **44** Appendix 2 Error code **A** ## **A endix 3 pp The frame specifications of RTU mode** ## **Procedure for eneratin of CRC g g** The error check in the RTU mode is conducted by CRC (Cyclic Redundancy Check). A procedure for generating a CRC is: _**1.**_ Load the register whose 16 bits are all "1". Call this the CRC register. _**2.**_ Exclusive OR the first 8 bit byte of the message with the low-order byte of the 16 bit CRC register, putting the result in the CRC register. _**3.**_ Shift the CRC register one bit to the right (toward the Least Significant Bit), zero-filling the MSB (Most Significant bit). _**4.**_ Check the carry flag. - (If the carry flag was 0): Repeat Step 3 (another shift). - (If the carry flag was 1): Exclusive OR the CRC register with the value A001H (1010 0000 0000 0001). _**5.**_ Repeat Steps 3 and 4 until 8 shifts have been executed. When this is done, a complete 8 bit byte will have been processed. _**6.**_ Repeat Steps 2 through 5 for the next 8 bit byte of the message. Continue doing this until all bytes have been processed. _**7.**_ The final content of the CRC register is the CRC value. _**8.**_ When the CRC is placed in the message, the upper 8 bits is put in after the lower 8 bits. APPENDIX Appendix 3 The frame specifications of RTU mode **45** The following is a calculation example in the case where function code 05H is sent to station No. (address field) 2. |CRC error check procedure|16-bit register|16-bit register|Carry Flag| |---|---|---|---| |(Load the register whose 16 bits are all "1")<br>02H (Station No.)<br>Exclusive OR (XOR)|1111<br>1111<br>1111<br>0000<br>0000<br>1111|1111<br>0000<br>1111<br>1111<br>0010<br>1101|| |Shift 1<br>Generator value<br>Exclusive OR (XOR)|0111<br>1010<br>1101<br>1111<br>0000<br>1111|1111<br>0000<br>1111<br>1110<br>0001<br>1111|1| |Shift 2<br>Generator value<br>Exclusive OR (XOR)|0110<br>1010<br>1100<br>1111<br>0000<br>1111|1111<br>0000<br>1111<br>1111<br>0001<br>1110|1| |Shift 3<br>Shift 4<br>Generator value<br>Exclusive OR (XOR)|0110<br>0011<br>1010<br>1001<br>0111<br>0011<br>0000<br>0011|1111<br>1111<br>0000<br>1111<br>1111<br>1111<br>0001<br>1110|0<br>1| |Shift 5<br>Shift 6<br>Generator value<br>Exclusive OR (XOR)|0100<br>0010<br>1010<br>1000<br>1001<br>0100<br>0000<br>0100|1111<br>1111<br>0000<br>1111<br>1111<br>1111<br>0001<br>1110|0<br>1| |Shift 7<br>Shift 8<br>Generator value<br>Exclusive OR (XOR)|0100<br>0010<br>1010<br>1000<br>0010<br>0001<br>0000<br>0001|0111<br>0011<br>0000<br>0011<br>1111<br>1111<br>0001<br>1110|0<br>1| |05H (Function code)<br>Exclusive OR (XOR)|1000<br>0001<br>0000<br>0000|0000<br>0011<br>0101<br>1011|| |Shift 1<br>Generator value<br>Exclusive OR (XOR)|0100<br>1010<br>1110<br>0000<br>0000<br>0000|1001<br>0000<br>1001<br>1101<br>0001<br>1100|1| |Shift 2<br>Generator value<br>Exclusive OR (XOR)<br>Shift 3<br>Shift 4|0111<br>1010<br>1011<br>0000<br>0000<br>1100<br>0011<br>1000<br>0001<br>1100|0100<br>0000<br>0001<br>1110<br>0001<br>0010<br>0010<br>0111<br>0001<br>0011|0<br>0<br>1| |Shift 5<br>Generator value<br>Exclusive OR (XOR)<br>Shift 6|0101<br>1010<br>1000<br>1110<br>0000<br>1111<br>0010<br>1111|0000<br>0000<br>0000<br>1001<br>0001<br>0101<br>0000<br>0100|0<br>1| |Shift 7<br>Generator value<br>Exclusive OR (XOR)|0100<br>1010<br>1110<br>0111<br>0000<br>0111|1000<br>0000<br>1000<br>0010<br>0001<br>0011|1| |Shift 8|0111<br>0011|1100<br>0001|1| |CRC value|73H|C1H|| |Address field|Function code|CRC (Error check)|CRC (Error check)| |---|---|---|---| |(02H)|(05H)|(C1H)|(73H)| APPENDIX Appendix 3 The frame specifications of RTU mode **46** **MODBUS protocol data unit formats** **A** This section explains MODBUS protocol data unit formats of the MODBUS standard functions. The MODBUS protocol data unit contains request messages sent from the master to a slave and response messages sent from the slave to the master. ## **How to see the request/response message formats** ## ■ **Request/Response message format diagram** The following shows how to see the request/response message format diagrams provided in Page 48 Read coils to Page 54 Write multiple registers. **==> picture [450 x 110] intentionally omitted <==** **----- Start of picture text -----**<br> Area name —> Function code Data<br>Frame contents > Function Head coil number Read points<br>code (0000H to FFFFH) (0001H to 07D0H)<br>[For request message format] (01H)<br>Setting range<br>(H) (L) (H) (L)<br>[For response message format]<br>Value stored to the response SE When a single data is expressed by 2 bytes, set the upper<br>message 1 byte 1 byte byte (8 bits) as (H) and the lower byte (8 bits) as (L).<br>(8 bits) (8 bits) Note: no switching of the high and low byte takes place (big<br>endian).<br>**----- End of picture text -----**<br> ## ■ **Response message format** The response message formats issued from the slave to the master differs depending on whether the slave has normally completed or failed to handle the requested processing (read/write, diagnosis etc.). The formats for normal and error completions are shown in Page 48 Read coils to Page 54 Write multiple registers. ## Precautions ## ■ **When the slave receives a broadcast request message** Although the processing requested by the request message is performed, no response message is sent to the master. ## ■ **When the processing is completed with error at the slave** When the processing (read/write, diagnosis etc.) requested by the request message is completed with error, an exception code is sent to the master. Refer to "Response message formats (when completed with an error)" in Page 48 Read coils to Page 54 Write multiple registers. ## ■ **Storage location of exception code and error code** Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **47** ## **Read coils** Reads the status (ON/OFF) of one or more coils. ## ■ **Request message format (Master** **Slave)** **==> picture [242 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function code Head coil number Read points<br>(01H) (0000H to FFFFH) (0001H to 07D0H)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> ## ■ **Response message format (Slave** **Master)** (When completed normally) **==> picture [321 x 258] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function code Number of Device data Device data<br>(01H) read bytes 1 n<br>n<br>(Number of read bytes n)<br>(Device data 1 to n)<br>b7 b6 b5 b4 b3 b2 b1 b0<br>Device data 1<br>Bit device<br>storage order<br>Device data n<br>0: OFF<br>1: ON<br> The read coil statuses are stored in order from low-order to high-order bits.<br>pe<br>**----- End of picture text -----**<br> (When completed with an error) **==> picture [98 x 52] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*1]<br>(81H)<br>**----- End of picture text -----**<br> - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **48** **A** a ## **Read inputs** Reads the status (ON/OFF) of one or more inputs. ## ■ **Request message format (Master** **Slave)** **==> picture [242 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Head input number Read points<br>code (0000H to FFFFH) (0001H to 07D0H)<br>(02H)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> ## ■ **Response message format (Slave** **Master)** (When completed normally) **==> picture [323 x 267] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Number of Device data Device data<br>code read bytes 1 n<br>(02H) n<br>(Number of read bytes n)<br>ati<br>(Device data 1 to n)<br>b7 b6 b5 b4 b3 b2 b1 b0<br>Device data 1<br>Bit device<br>storage order<br>Device data n<br>0: OFF<br>1: ON<br>The read input statuses are stored in order from low-order to high-order bits.<br>ld<br>**----- End of picture text -----**<br> (When completed with an error) **==> picture [97 x 51] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*1]<br>(82H)<br>**----- End of picture text -----**<br> - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **49** ## **Read holding registers** Reads the values of one or more holding registers. ## ■ **Request message format (Master** **Slave)** **==> picture [243 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Head holding Read points<br>code register number (0001H to 007DH)<br>(03H) (0000H to FFFFH)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> ## ■ **Response message format (Slave** **Master)** (When completed normally) **==> picture [347 x 104] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Number of read Device data . . . Device data<br>code bytes 1 n<br>(03H) m = n 2 [*1]<br>(H) (L) (H) (L)<br>e e (Number of read bytes n e 2) e<br>**----- End of picture text -----**<br> *1 For example, if n = 4, the number of bytes is calculated as 4 2 = 8 bytes. (When completed with an error) **==> picture [97 x 52] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*2]<br>(83H)<br>**----- End of picture text -----**<br> - *2 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **50** **A** al ## **Read input registers** Reads the values of one or more input registers. ## ■ **Request message format (Master** **Slave)** **==> picture [244 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Head input register number Read points<br>code (0000H to FFFFH) (0001H to 007DH)<br>(04H)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> ## ■ **Response message format (Slave** **Master)** (When completed normally) **==> picture [347 x 99] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Number of read Device data 1 . . . Device data n<br>code bytes<br>(04H) m = n 2 [*1]<br>(H) (L) (H) (L)<br>p e (Number of read bytes n 2)<br>**----- End of picture text -----**<br> *1 For example, if n = 4, the number of bytes is calculated as 4 2 = 8 bytes. (When completed with an error) **==> picture [97 x 52] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*2]<br>(84H)<br>**----- End of picture text -----**<br> - *2 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **51** ## **Write single coil** Writes a value (ON/OFF) to one coil. ■ **Request message format (Master** **Slave)** **==> picture [268 x 77] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Coil number ON/OFF specification<br>code (0000H to 0000H: OFF<br>(05H) FFFFH) FF00H: ON<br>Sire (H) (L) (H) (L)<br>**----- End of picture text -----**<br> ■ **Response message format (Slave** **Master)** (When completed normally) The slave returns the request message received from the master without change. (When completed with an error) **==> picture [97 x 52] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*1]<br>(85H)<br>**----- End of picture text -----**<br> - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. ## **Write single register** Writes a value to one holding register. ## ■ **Request message format (Master** **Slave)** **==> picture [245 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Holding register number Write data<br>code (0000H to FFFFH) (0000H to FFFFH)<br>(06H)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> ## ■ **Response message format (Slave** **Master)** (When completed normally) The slave returns the request message received from the master without change. (When completed with an error) **==> picture [97 x 52] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*1]<br>(86H)<br>**----- End of picture text -----**<br> - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **52** **A** ## **Write multiple coils** Writes values (ON/OFF) to multiple coils. ## ■ **Request message format (Master** **Slave)** **==> picture [407 x 227] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Head coil number Write points [*1] Number of Device data Device data<br>code (0000H to FFFFH) (0001H to 07B0H) bytes n [*1] 1 n<br>(0FH) (0001H to<br>00F6H)<br>(H) (L) (H) (L)<br>_—= (Number of bytes n) Z<br>ao 7<br>Leo 4<br>eo 4<br>aa a<br>(Device data 1 to n)<br>b7 b6 b5 b4 b3 b2 b1 b0<br>Device data 1<br>e<br>e Data storage order<br>Device data n<br>0: OFF<br>1: ON<br>**----- End of picture text -----**<br> The values (ON/OFF) stored into the device data 1 to n are written to the coils in order from low-order to high-order bits of the device data. - *1 The number of the specified write points must be matched with the number of bits specified as the number of bytes. For example, when the write points are set to 16, set the number of bytes to 2 bytes (= 16 bits). ## ■ **Response message format (Slave** **Master)** (When completed normally) |Function code|Data|Data| |---|---|---| |Function<br>code<br>(0FH)|(L)<br>(H)<br>Head coil number<br>(The same head coil number<br>value as in the request<br>message is stored.)|(L)<br>(H)<br>Write points<br>(The same write points<br>value as in the request<br>message is stored.)| (When completed with an error) |Function code|Data| |---|---| |Function|Exception| |code|code*1| |(8FH)|| - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX Appendix 3 The frame specifications of RTU mode **53** ## **Write multiple registers** Writes values to multiple holding registers. ## ■ **Request message format (Master** **Slave)** **==> picture [448 x 104] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Head holding register Write points n [*1] Number of Device data Device data<br>code number (0000H to (0001H to 007BH) bytes 1 n<br>(10H) FFFFH) n 2 [*1]<br>(0002H to<br>(H) (L) (H) (L) 00F6H) (H) (L) (H) (L)<br>(Number of bytes n 2)<br>0en<br>**----- End of picture text -----**<br> - *1 The number of the specified write points must match the number of bytes. ## ■ **Response message format (Slave** **Master)** (When completed normally) **==> picture [251 x 69] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Head holding register number Write points<br>Function (The same head holding (The same write points<br>code register value as in the value as in the request<br>(10H) request message is stored.) message is stored.)<br>(H) (L) (H) (L)<br>**----- End of picture text -----**<br> (When completed with an error) **==> picture [97 x 51] intentionally omitted <==** **----- Start of picture text -----**<br> Function code Data<br>Function Exception<br>code code [*1]<br>(90H)<br>**----- End of picture text -----**<br> - *1 Exception and error codes are stored in special registers in the case of error completion. Refer to Page 33 Related Devices for the storage location, confirmation methods, and other detailed contents. APPENDIX **54** Appendix 3 The frame specifications of RTU mode ## **Initial values of MODBUS device Appendix 4 allocation A** ~~__]jj~~ **Parameter initial value of MODBUS device allocation** FEE“te®TLCLULLULDLDLvLvEEEEeeeeee The FX5 dedicated pattern and the FX3U compatible pattern are provided for the parameter initial values. ## ■ **FX5 dedicated pattern** |**MODBUS address**|**FX5 device**|| |---|---|---| |**<Bit device>**|**Coil (read/write)**|**Input (read only)**| |0000H to 03FFH|Y0 to 1023<br>~~pO~~|X0 to 1023| |0400H to 1FFFH|<br>~~pO~~|| |2000H to 3DFFH|M0 to 7679<br>~~pO~~|| |3E00H to 4FFFH|<br>~~pO~~|| |5000H to 57FFH|SM0 to 2047<br>~~pO~~|| |5800H to 75FFH|L0 to 7679<br>~~pO~~|| |7600H to 77FFH|<br>~~pO~~|| |7800H to 78FFH|B0 to 255<br>~~pO~~|| |7900H to 97FFH|<br>~~pO~~|| |9800H to 987FH|F0 to 127<br>~~pO~~|| |9880H to 9FFFH|<br>~~pO~~|| |A000H to A0FFH|SB0 to 255<br>~~pO~~|| |A100H to AFFFH|<br>~~pO~~|| |B000H to BFFFH|S0 to 4095<br>~~pO~~|| |C000H to CFFFH|<br>~~pO~~|| |D000H to D1FFH|TC0 to 511<br>~~pO~~|| |D200H to D7FFH|<br>~~pO~~|| |D800H to D9FFH|TS0 to 511<br>~~pO~~|| |DA00H to DFFFH|<br>~~pO~~|| |E000H to E00FH|SC0 to 15<br>~~pO~~|| |E010H to E7FFH|<br>~~pO~~|| |E800H to E80FH|SS0 to 15<br>~~pO~~|| |E810H to EFFFH|<br>~~pO~~|| |F000H to F0FFH|CC0 to 255<br>~~pO~~|| |F100H to F7FFH|<br>~~pO~~|| |F800H to F8FFH|CS0 to 255<br>~~pO~~|| |F900H to FFFFH|<br>~~pO~~|| |||| |**MODBUS address**|**FX5 device**|| |**<Word device>**|**Input register (read only)**|**Holding register (read/write)**| |0000H to 1F3FH|<br>~~pO~~|D0 to 7999| |1F40H to 4FFFH|<br>~~pO~~|| |5000H to 770FH|<br>~~pO~~|SD0 to 9999| |7710H to 77FFH|<br>~~pO~~|| |7800H to 79FFH|<br>~~pO~~|W0 to 512| |7A00H to 9FFFH|<br>~~pO~~|| |A000H to A0FFH|<br>~~pO~~|SW0 to 512| |A100H to CFFFH|<br>~~pO~~|| |D000H to D1FFH|<br>~~pO~~|TN0 to 511| |D200H to DFFFH|<br>~~pO~~|| |E000H to E00FH|<br>~~pO~~|SN0 to 15| |E010H to EFFFH|<br>~~pO~~|| |F000H to F0FFH|<br>~~pO~~|CN0 to 255| |F100H to FFFFH|<br>~~pO~~|| APPENDIX **55** Appendix 4 Initial values of MODBUS device allocation ## ■ **FX3U compatible pattern** |**MODBUS address**|**FX5 device**|| |---|---|---| |**<Bit device>**|**Coil (read/write)**|**Input (read only)**| |0000H to 1DFFH|M0 to 7679|| |1E00H to 1FFFH|SM8000 to 8511|| |2000H to 2FFFH|S0 to 4095|| |3000H to 31FFH|TS0 to 511|| |3200H to 32FFH|CS0 to 255|| |3300H to 33FFH|Y0 to 377|| |3400H to 34FFH||X0 to 377| |3500H to FFFFH||| |**MODBUS address**<br>**<Bit device>**|**FX5 device**|**FX5 device**| |---|---|---| ||**Coil (read/write)**|**Input (read only)**| |0000H to 1DFFH|M0 to 7679|| |1E00H to 1FFFH|SM8000 to 8511|| |2000H to 2FFFH|S0 to 4095|| |3000H to 31FFH|TS0 to 511|| |3200H to 32FFH|CS0 to 255|| |3300H to 33FFH|Y0 to 377|| |3400H to 34FFH||X0 to 377| |3500H to FFFFH||| |**MODBUS address**<br>**<Word device>**|**FX5 device**|| ||**Input register (read only)**|**Holding register (read/write)**| |0000H to 1F3FH||D0 to 7999| |1F40H to 213FH||SD8000 to 8511| |2140H to A13FH||R0 to 32767| |A140H to A33FH||TN0 to 511| |A340H to A407H||CN0 to 199| |A408H to A477H||LN0 to 55| |A478H to A657H||M0 to 7679| |A658H to A677H||SM8000 to 8511| |A678H to A777H||S0 to 4095| |A778H to A797H||TS0 to 511| |A798H to A7A7H||CS0 to 255| |A7A8H to A7B7H||Y0 to 377| |A7B8H to A7BCH|X0 to 377|LS0 to 63| |A7BDH to A7C7H||| |A7C8H to FFFFH||| APPENDIX Appendix 4 Initial values of MODBUS device allocation **56** **I** ## **INDEX** **A** Address field . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Available devices . . . . . . . . . . . . . . . . . . . . . . . 28 **B** Broadcast delay . . . . . . . . . . . . . . . . . . . . . . . . 40 **C** Communication execution status output device . . 32 Communication format setting value . . . . . . . . . . 38 Communication specifications . . . . . . . . . . . . . . 14 Current retry value . . . . . . . . . . . . . . . . . . . . . . 39 **D** Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 During MODBUS communication . . . . . . . . . . . . 35 **E** Error check. . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 **F** Frame mode. . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Function code. . . . . . . . . . . . . . . . . . . . . . . . . . 18 Function code and function parameters . . . . . . . . 31 **H** Host station number . . . . . . . . . . . . . . . . . . . . . 39 Host station number SD latch setting valid . . . . . . 37 **I** Instruction execution complete . . . . . . . . . . . . . . 35 **L** Latch setting. . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Link time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 List of related devices . . . . . . . . . . . . . . . . . . . . 33 List of supported MODBUS standard functions. . . 19 ## **O** Operation error. . . . . . . . . . . . . . . . . . . . . . . . . .44 Operation mode display. . . . . . . . . . . . . . . . . . . .39 **P** Parameter initial value. . . . . . . . . . . . . . . . . . . . .55 Procedure for operation. . . . . . . . . . . . . . . . . . . .11 **R** Read coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 Read holding registers . . . . . . . . . . . . . . . . . . . .50 Read input registers . . . . . . . . . . . . . . . . . . . . . .51 Read inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 RS-232C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 RS-485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 ## **S** Serial communication error . . . . . . . . . . . . . . 36,43 Serial communication error code . . . . . . . . . . . . .37 Serial communication error details . . . . . . . . . . . .38 Slave function . . . . . . . . . . . . . . . . . . . . . . . . . .33 Slave processing time . . . . . . . . . . . . . . . . . . . . .16 Slave response timeout . . . . . . . . . . . . . . . . . . . .40 SM/SD for FX3 Series compatible . . . . . . . . . . . .29 System configuration. . . . . . . . . . . . . . . . . . . . . .12 ## **T** Termination resistor selector switch . . . . . . . . . . .22 Termination resistor setting . . . . . . . . . . . . . . . . .22 Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Timeout retry count. . . . . . . . . . . . . . . . . . . . . . .40 ## **W** Write multiple coils . . . . . . . . . . . . . . . . . . . . . . .53 Write multiple registers . . . . . . . . . . . . . . . . . . . .54 Write single coil . . . . . . . . . . . . . . . . . . . . . . . . .52 Write single register . . . . . . . . . . . . . . . . . . . . . .52 ## **M** Master function . . . . . . . . . . . . . . . . . . . . . . . 14,30 Master processing time . . . . . . . . . . . . . . . . . . . 16 Message to message delay . . . . . . . . . . . . . . . . 40 MODBUS communication error. . . . . . . . . . . . . . 35 MODBUS communication error (latched) . . . . . . . 36 MODBUS protocol data unit formats . . . . . . . . . . 47 ## **N** Number of connectable units . . . . . . . . . . . . . . . 14 **57** ## **REVISIONS** |**Revision date**|**Revision**|**Description**| |---|---|---| |October 2014|A|First Edition| |January 2015|B|■Added new model<br>FX5UC CPU| |April 2015|C|A part of the cover design is changed.| 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. - © 2014 MITSUBISHI ELECTRIC CORPORATION **58** ## **WARRANTY** Please confirm the following product warranty details before using this product. **1. 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. However, if repairs are required onsite at domestic or overseas location, expenses to send an engineer will be solely at the customer's discretion. Mitsubishi shall not be held responsible for any re-commissioning, maintenance, or testing on-site that involves replacement of the failed module. ## **[Gratis Warranty Term]** The gratis warranty term of the product shall be for one year after the date of purchase or delivery to a designated place. Note that after manufacture and shipment from Mitsubishi, the maximum distribution period shall be six (6) months, and the longest gratis warranty term after manufacturing shall be eighteen (18) months. The gratis warranty term of repair parts shall not exceed the gratis warranty term before repairs. ## **[Gratis Warranty Range]** - 1) The range shall be limited to normal use within the usage state, usage methods and usage environment, etc., which follow the conditions and precautions, etc., given in the instruction manual, user's manual and caution labels on the product. - 2) Even within the gratis warranty term, repairs shall be charged for in the following cases. - a) Failure occurring from inappropriate storage or handling, carelessness or negligence by the user. Failure caused by the user's hardware or software design. - b) Failure caused by unapproved modifications, etc., to the product by the user. - c) When the Mitsubishi product is assembled into a user's device, Failure that could have been avoided if functions or structures, judged as necessary in the legal safety measures the user's device is subject to or as necessary by industry standards, had been provided. - d) Failure that could have been avoided if consumable parts (battery, backlight, fuse, etc.) designated in the instruction manual had been correctly serviced or replaced. - e) Relay failure or output contact failure caused by usage beyond the specified life of contact (cycles). - f) Failure caused by external irresistible forces such as fires or abnormal voltages, and failure caused by force majeure such as earthquakes, lightning, wind and water damage. - g) Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. - h) Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user. ## **2. Onerous repair term after discontinuation of production** - 1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued. Discontinuation of production shall be notified with Mitsubishi Technical Bulletins, etc. - 2) Product supply (including repair parts) is not available after production is discontinued. ## **3. Overseas service** Overseas, repairs shall be accepted by Mitsubishi's local overseas FA Center. Note that the repair conditions at each FA Center may differ. ## **4. Exclusion of loss in opportunity and secondary loss from warranty liability** Regardless of the gratis warranty term, Mitsubishi shall not be liable for compensation of damages caused by any cause found not to be the responsibility of Mitsubishi, loss in opportunity, lost profits incurred to the user or third person by failure of Mitsubishi products, special damages and secondary damages whether foreseeable or not, compensation for accidents, and compensation for damages to products other than Mitsubishi products, replacement by the user, maintenance of on-site equipment, start-up test run and other tasks. ## **5. Changes in product specifications** The specifications given in the catalogs, manuals or technical documents are subject to change without prior notice. ## **6. Product application** - 1) In using the Mitsubishi MELSEC programmable controller, the usage conditions shall be that the application will not lead to a major accident even if any problem or fault should occur in the programmable controller device, and that backup and fail-safe functions are systematically provided outside of the device for any problem or fault. - 2) The Mitsubishi programmable controller has been designed and manufactured for applications in general industries, etc. Thus, applications in which the public could be affected such as in nuclear power plants and other power plants operated by respective power companies, and applications in which a special quality assurance system is required, such as for railway companies or public service purposes shall be excluded from the programmable controller applications. In addition, applications in which human life or property that could be greatly affected, such as in aircraft, medical applications, incineration and fuel devices, manned transportation, equipment for recreation and amusement, and safety devices, shall also be excluded from the programmable controller range of applications. However, in certain cases, some applications may be possible, providing the user consults their local Mitsubishi representative outlining the special requirements of the project, and providing that all parties concerned agree to the special circumstances, solely at the user's discretion. **59** ## **TRADEMARKS** Microsoft[] and Windows[] are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Ethernet is a trademark of Xerox Corporation. MODBUS[] is a registered trademark of Schneider Electric SA. The company name and the product name to be described in this manual are the registered trademarks or trademarks of each company. **60** Manual number: JY997D56101C Model: FX5-U-MB-E Model code: 09R542 When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN Specifications are subject to change without notice.
Updated at April 10, 2026
About Novapart
Novapart is a B2B electronic component broker specialising in stock shortages and cost reduction. We source hard-to-find parts and identify compliant alternatives across a catalogue of 540,000+ components from 500+ manufacturers.
Learn more →Stock Shortage Specialist
When a component is unavailable, discontinued or has an unacceptable lead time, we tap into our network of vetted European and Asian distributors to source what you need — without compromising on quality or traceability.
Request a quote →Compliant Alternatives
We identify pin-to-pin, electrically equivalent substitutes that meet the same certifications (RoHS, AEC-Q100, REACH) as your original specification — validated against datasheets, not just part numbers. Often at a lower cost.
BOM Analysis service →