Mitsubishi FX3U Series User Manual

Mitsubishi FX3U Series User Manual

Hide thumbs Also See for FX3U Series:
Table of Contents

Advertisement

USER'S MANUAL - MODBUS Serial Communication Edition
FX
SERIES PROGRAMMABLE CONTROLLERS
3U

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi FX3U Series

  • Page 1 USER'S MANUAL - MODBUS Serial Communication Edition SERIES PROGRAMMABLE CONTROLLERS...
  • Page 3 Safety Precautions (Read these precautions before use.) Before installing, operating, maintenance or inspecting this product, thoroughly read and understand this manual and the associated manuals. Also pay careful attention to handle the module properly and safety. This manual classifies the safety precautions into two categories: Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
  • Page 4 • Do not disassemble or modify the PLC. Doing so may cause failures, malfunctions or fire. For repair, contact your local Mitsubishi Electric distributor. • Before connecting or disconnecting any extension cable, turn off power. Failure to do so may cause unit failure or malfunctions.
  • Page 5: Safety Precautions

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

    Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Table of Contents Table of Contents SAFETY PRECAUTIONS ....................(1) Related manuals........................6 Generic Names and Abbreviations Used in Manuals ............7 1. Outline 1.1 Outline of System..........................8 1.2 Major Procedures until Operation ....................9 1.3 PLC Communication Type Applicability ..................
  • Page 8 Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Table of Contents 6. Related Devices and Communication Status 6.1 Special Data Registers........................32 6.2 Communication setting for MODBUS.................... 37 6.3 Special Auxiliary Relays........................ 38 6.4 Communication status........................40 7. MODBUS Standard Commands 7.1 MODBUS Standard Commands Support List ................
  • Page 9 Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Table of Contents 9. Slave Specification 9.1 MODBUS Slave Command Code List................... 84 9.2 MODBUS device address allocation ..................... 85 9.3 MODBUS device address allocation (Default Values) ..............85 9.4 User defined MODBUS Device Address Assignment ..............87 9.4.1 Format of the user defined device allocation.................
  • Page 10: Related Manuals

    Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Related manuals Related manuals For a detailed explanation of the MODBUS serial communication network in FX PLCs, refer to this manual. For hardware information and instructions on the PLC main unit, other special function units/blocks, etc., refer to the appropriate manuals.
  • Page 11: Generic Names And Abbreviations Used In Manuals

    Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Generic Names and Abbreviations Used in Manuals Generic Names and Abbreviations Used in Manuals Abbreviation/generic name Name Programmable controllers Series Generic name of FX Series PLCs PLC or main unit Generic name of FX Series PLC main units Expansion boards...
  • Page 12: Outline

    Series Programmable Controllers 1 Outline User’s Manual - MODBUS Serial Communication Edition 1.1 Outline of System Outline This chapter outlines the MODBUS serial communication network. Outline of System The MODBUS serial communication network allows up to 16 slaves to be controlled by one master in accordance with RS-485 to link devices, or one directly linked slave in accordance with RS-232C.
  • Page 13: Major Procedures Until Operation

    Series Programmable Controllers 1 Outline User’s Manual - MODBUS Serial Communication Edition 1.2 Major Procedures until Operation Major Procedures until Operation The flow chart below shows the procedure for setting up the MODBUS serial communication network: MODBUS Serial Communication Refer to Chapter 1. Outline of system Outline •...
  • Page 14: Plc Communication Type Applicability

    Series Programmable Controllers 1 Outline User’s Manual - MODBUS Serial Communication Edition 1.3 PLC Communication Type Applicability PLC Communication Type Applicability 1.3.1 Applicable versions The communication type is applicable in the following versions. : Applicable (If applicable versions are limited, they are described inside ( ).) —: Not applicable Applicability (applicable version) Remarks Series...
  • Page 15: Programming Tool Applicability

    Series Programmable Controllers 1 Outline User’s Manual - MODBUS Serial Communication Edition 1.4 Programming Tool Applicability Programming Tool Applicability 1.4.1 For applicable versions The programming tool is applicable for each FX Series from the following version: 1. Japanese versions : Applicable (If applicable versions are limited, they are described inside ( ).) —: Not applicable Model name (Media model Applicability Remarks...
  • Page 16: Specifications

    Series Programmable Controllers 2 Specifications User’s Manual - MODBUS Serial Communication Edition 2.1 Communication Specifications Specifications This chapter explains the communication specifications and performance. Communication Specifications MODBUS Serial Communication can be implemented according to the specifications shown in the table below with the corresponding special adapter attached to the PLC, either the FX -232ADP-MB or FX 485ADP-MB.
  • Page 17: Link Time

    Series Programmable Controllers 2 Specifications User’s Manual - MODBUS Serial Communication Edition 2.2 Link Time Link Time The link time indicates the cycle time in which a Master module completes a single command with a Slave, as illustrated by the diagram below. SET M0 ADPRW******* M8029...
  • Page 18 Series Programmable Controllers 2 Specifications User’s Manual - MODBUS Serial Communication Edition 2.2 Link Time The Master processing time (Tm) can be calculated in milliseconds (ms) as follows, where INT (n) indicates the concatenation of any remaining decimal values. Character Length (bits): Start bit (1bit) + Data Length (7bit or 8bit) + Parity (0bit or 1bit) + Stop bit (1bit or 2bit) Tm = T1 + T2 + T3 Scan...
  • Page 19 Series Programmable Controllers 2 Specifications User’s Manual - MODBUS Serial Communication Edition 2.2 Link Time Example Link Time Calculations: Master processing time (Tm) D8411 = 5ms Max Scan Time = 5ms Command = Read Holding Registers 0-9 (Command Code 0x03) Frame Mode = RTU Mode Bytes in Request...
  • Page 20: System Configuration

    Series Programmable Controllers 3 System Configuration User’s Manual - MODBUS Serial Communication Edition 3.1 System Configuration System Configuration This section explains the configuration of communication equipment operating in accordance with RS-485 and RS-232C and the selection of equipment required by FX PLCs.
  • Page 21: Applicable Fx Plc And Communication Equipment

    Series Programmable Controllers 3 System Configuration User’s Manual - MODBUS Serial Communication Edition 3.2 Applicable FX PLC and Communication Equipment Applicable FX PLC and Communication Equipment Select the most suitable combination of (optional) communication equipment from the table below, and put a check mark in the "Check"...
  • Page 22 Series Programmable Controllers 3 System Configuration User’s Manual - MODBUS Serial Communication Edition 3.2 Applicable FX PLC and Communication Equipment For communication in accordance with RS-485 Total extension FX Series Communication equipment (option) Check distance When using channel 1 (ch 1) 500 m (1640' 5") -CNV-BD...
  • Page 23: Limitation When Channel 1 And Channel 2 Are Used At The Same Time

    Series Programmable Controllers 3 System Configuration User’s Manual - MODBUS Serial Communication Edition 3.3 Limitation when Channel 1 and Channel 2 are used at the Limitation when Channel 1 and Channel 2 are used at the same time When using Channel 1 (ch1) and Channel 2 (ch2) at the same time, the available communication type combinations are limited.
  • Page 24: Wiring

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.1 Wiring Procedure Wiring This chapter explains the wiring. WIRING PRECAUTIONS • Cut off all phases of the power supply externally before installation or wiring work in order to avoid damage to the product or electric shock.
  • Page 25: Selecting Connection Method

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.2 Selecting Connection Method Selecting Connection Method When using MODBUS serial communication, communication can be achieved in accordance with MODBUS RS-232C or RS-485. For the FX , only one channel can be used for MODBUS serial communication, Master or Slave.
  • Page 26: Selecting Cables And Terminal Resistors (Modbus Rs-485)

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.3 Selecting Cables and Terminal Resistors (MODBUS RS- Selecting Cables and Terminal Resistors (MODBUS RS-485) Select cables using the procedure described below. 4.3.1 Twisted pair cable Use shielded twisted pair cables for connecting communication equipment operating in accordance with MODBUS RS-485.
  • Page 27: Connecting Cables

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.3 Selecting Cables and Terminal Resistors (MODBUS RS- 4.3.2 Connecting cables 1. European type terminal block Use shielded twisted pair cables for connecting communication equipment operating in accordance with MODBUS RS-485.
  • Page 28: Connection Diagram For Modbus Rs-232C

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.4 Connection Diagram for MODBUS RS-232C Connection Diagram for MODBUS RS-232C Representative wiring examples are shown in this section. When pin numbers in the counterpart equipment are different, wire the pins as shown below. 4.4.1 Connection diagram between FX PLC and MODBUS RS-232C equipment External equipment operating in accordance...
  • Page 29: Connection Diagram For Modbus Rs-485

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.5 Connection Diagram for MODBUS RS-485 Connection Diagram for MODBUS RS-485 4.5.1 One-pair wiring -485ADP-MB -485ADP-MB -485ADP-MB -485ADP-MB Master Slave Slave Slave Terminal Terminal resistor: resistor: 110 Ω 110 Ω...
  • Page 30: Grounding

    Series Programmable Controllers 4 Wiring User’s Manual - MODBUS Serial Communication Edition 4.6 Grounding Grounding Grounding should be performed as stated below. • The grounding resistance should be 100 Ω or less. • Independent grounding should be performed for best results. When independent grounding can not be performed, perform "shared grounding"...
  • Page 31: Communication Setup

    Series Programmable Controllers 5 Communication Setup User’s Manual - MODBUS Serial Communication Edition 5.1 Setup method for MODBUS serial communication Communication Setup This chapter explains the setup method for using the MODBUS protocol with an FX PLC and MODBUS Communication ADP. Setup method for MODBUS serial communication MODBUS communication is setup via the PLC program using GX Developer.
  • Page 32 Series Programmable Controllers 5 Communication Setup User’s Manual - MODBUS Serial Communication Edition 5.2 Example of communication setup The ladder code for setting the Master parameters can be expressed as follows: Program for setting up a MODBUS Master MODBUS Serial Communication Setup 0001 0000 1001 0111 The communication...
  • Page 33 Series Programmable Controllers 5 Communication Setup User’s Manual - MODBUS Serial Communication Edition 5.2 Example of communication setup Parameters for a Slave using Channel 1: Device Name Description D8400 Communication Format D8401 Protocol D8411 Message to Message Delay For Descriptions, refer to Chapter 6. D8414 Slave Node Address D8415...
  • Page 34: Simultaneous N:n Networking And Modbus Communication

    Series Programmable Controllers 5 Communication Setup User’s Manual - MODBUS Serial Communication Edition 5.3 Simultaneous N:N Networking and MODBUS Simultaneous N:N Networking and MODBUS Communication When MODBUS communication and N:N Network are used simultaneously, N:N Networking must be setup first (at program step 0). After which it is possible to program the MODBUS communication setup, as shown below.
  • Page 35: Cautions On Communication Setup

    Series Programmable Controllers 5 Communication Setup User’s Manual - MODBUS Serial Communication Edition 5.4 Cautions on Communication Setup Cautions on Communication Setup 1. Timing of Communication Parameters Though the MODBUS communication parameters are setup using the PLC program, the parameters become effective only after the PLC power is switched from OFF to ON.
  • Page 36: Related Devices And Communication Status

    Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.1 Special Data Registers Related Devices and Communication Status In this section the device numbers and functions of the special data registers and special auxiliary relays are described for MODBUS serial communication.
  • Page 37 Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.1 Special Data Registers Special Data Register Name Valid Detailed description R / W Communication D8405 D8425 Format M, S This device stores the communication format set in the PLC. Display Displays the End Of Message character used in ASCII mode.
  • Page 38 Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.1 Special Data Registers Special Data Register Name Valid Detailed description R / W The turnaround delay defines the minimum delay time that the master has to wait after the transmission of a broadcast message before transmitting the next request.
  • Page 39 Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.1 Special Data Registers Special Data Register Name Valid Detailed description R / W Defines the device range that is used to store the communication state (event &...
  • Page 40 Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.1 Special Data Registers Special Data Register Name Valid Detailed description R / W Displays the protocol that the serial port is currently using: 0: Programming Port Protocol 1: Programming Port Modem Mode 2: Computer Link...
  • Page 41: Communication Setting For Modbus

    Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.2 Communication setting for MODBUS Communication setting for MODBUS The following devices are used in the communication setting. When using the communication port (Ch1), set D8400. When using the communication port (Ch2), set D8420.
  • Page 42: Special Auxiliary Relays

    Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.3 Special Auxiliary Relays Special Auxiliary Relays The table shows the Special Auxiliary Relays used for MODBUS serial communication. Special Device Name Valid Detailed Description R / W LD M8411 can be used to trigger a set of subsequent MODBUS...
  • Page 43 Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.3 Special Auxiliary Relays Special Device Name Valid Detailed Description R / W Set while the master sends retries when the slave fails to respond in time. Special clear conditions: 1) Power on M8408...
  • Page 44: Communication Status

    Series Programmable Controllers 6 Related Devices and Communication Status User’s Manual - MODBUS Serial Communication Edition 6.4 Communication status Communication status The event and error counters will occupy ten devices beginning from the device defined by (D8415 / D8435) and (D8416/D8436). PLC destination devices are latched, therefore the Master's devices will be cleared at power ON and when the PLC is switched from STOP to RUN.
  • Page 45: Modbus Standard Commands

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.1 MODBUS Standard Commands Support List MODBUS Standard Commands The following chapter explains in detail MODBUS Communication. For standard use of the FX MODBUS Serial function please refer to Chapter 8 (Master Specification) or Chapter 9 (Slave Specification). MODBUS Standard Commands Support List The following table indicates a list of the MODBUS standard functions supported by the FX-Series MODBUS Communication ADP.
  • Page 46 Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.1 MODBUS Standard Commands Support List Accessible Command Subcommand Command Name Details Devices per Broadcast Reference Code Code Message Read number of Return Bus detected Subsection ✘...
  • Page 47: Frame Specifications

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.2 Frame Specifications Frame Specifications The following shows the frame specifications for the MODBUS protocol. Address field Function code Data Error check MODBUS Protocol Data Section Section 7.3 to section 7.18 The following table details the frame specification for the MODBUS Protocol.
  • Page 48: Frame Mode

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.2 Frame Specifications 7.2.1 Frame mode For the FX-Series MODBUS Communication ADP, the following frame modes are available. The frame mode of the FX-Series MODBUS Communication ADP must be consistent with that of the target device.
  • Page 49 Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.2 Frame Specifications The following is a calculation example in the case where function code 07H is sent to station No. 2. CRC error check procedure 16-bit register (MSB) Carry Flag...
  • Page 50 Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.2 Frame Specifications b) ASCII mode In this mode, frames are received or sent in units of 2 characters 2 bytes of ASCII codes. The frame specifications are compliant with the MODBUS protocol specifications. Start Address field Function code...
  • Page 51 Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.2 Frame Specifications The following are calculation examples in the case where function code 01H is sent to station No. 2. The following table illustrates the LRC calculation procedure (when sending a request message): LRC in request message transmission Station No.
  • Page 52: Protocol Data Unit Formats By Commands

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.3 Protocol Data Unit Formats by Commands Protocol Data Unit Formats by Commands This section describes MODBUS protocol data unit formats used by the FX-Series MODBUS Communication ADP.
  • Page 53 Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.3 Protocol Data Unit Formats by Commands 3) How to see the request/response message formats provided in Section 7.4 to 7.18: a) Request/Response message format diagram The following shows how to see the request/response message format diagrams provided in Section 7.4 to 7.18.
  • Page 54: Read Coils (Command Code: 0X01)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.4 Read Coils (Command Code: 0x01) Read Coils (Command Code: 0x01) Reads the status (ON/OFF) of one or more coils. 1) Request message format (Master → Slave) Function code Data Head coil number...
  • Page 55: Read Discrete Inputs (Command Code: 0X02)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.5 Read Discrete Inputs (Command Code: 0x02) Read Discrete Inputs (Command Code: 0x02) Reads the status (ON/OFF) of one or more inputs. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 56: Read Holding Registers (Command Code: 0X03)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.6 Read Holding Registers (Command Code: 0x03) Read Holding Registers (Command Code: 0x03) Reads the values of one or more holding registers. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 57: Read Input Registers (Command Code: 0X04)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.7 Read Input Registers (Command Code: 0x04) Read Input Registers (Command Code: 0x04) Reads the values of one or more input registers. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 58: Write Single Coil (Command Code: 0X05)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.8 Write Single Coil (Command Code: 0x05) Write Single Coil (Command Code: 0x05) Writes a value (ON/OFF) to one coil. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 59: Write Single Register (Command Code: 0X06)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.9 Write Single Register (Command Code: 0x06) Write Single Register (Command Code: 0x06) Writes a value to one holding register. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 60: Read Exception Status (Command Code: 0X07)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.10 Read Exception Status (Command Code: 0x07) 7.10 Read Exception Status (Command Code: 0x07) Reads error status. 1) Request message format (Master → Slave) Function code Function code 2) Response message format (Slave →...
  • Page 61: Diagnostics (Command Code: 0X08)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11 Diagnostics (Command Code: 0x08) Executes the various diagnostics and checks the FX-Series MODBUS Communication ADP. 7.11.1 Return query data (sub-comand code: 0x00) Returns the contents of the request message without change.
  • Page 62: Restart Communications Option (Sub-Command Code: 0X01)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.2 Restart communications option (sub-command code: 0x01) Initializes the communication port of the receiving channel side and restarts the slave function. Restart is performed after returning the response message corresponding to a request message.
  • Page 63: Return Diagnostic Register (Sub-Command Code: 0X02)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.3 Return diagnostic register (sub-command code: 0x02) Reads out the diagnostic register of the remote node to the master. 1) Request message format (Master → Slave) Function code Sub-function code Data...
  • Page 64: Change Ascii Input Delimiter (Sub-Command Code: 0X03)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.4 Change ASCII input delimiter (sub-command code: 0x03) Changes the 2nd byte (LF(0AH)) of the end code in the ASCII mode to a specified data. The specified data is stored in D8406/D8426.
  • Page 65: Force Listen Only Mode (Sub-Command Code: 0X04)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.5 Force listen only mode (sub-command code: 0x04) Places a slave into the offline mode. Used when disconnecting a slave from the network. When FX-Series MODBUS Communication ADP is set in the listen only mode, the status is as follows: •...
  • Page 66: Clear Counters And Diagnostic Register (Sub-Command Code: 0X0A)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.6 Clear counters and diagnostic register (sub-command code: 0x0A) Clears counters (e.g. message count). The following counters will be cleared. (Refer to Chapter 6) •...
  • Page 67: Return Bus Message Count (Sub-Command Code: 0X0B)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.7 Return bus message count (sub-command code: 0x0B) Reads out the number of messages detected on the line to the master. 1) Request message format (Master →...
  • Page 68: Return Bus Communication Error Count (Sub-Command Code: 0X0C)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.8 Return bus communication error count (sub-command code: 0x0C) Reads out the number of error messages detected on the line to the master. 1) Request message format (Master →...
  • Page 69: Return Bus Exception Error Count (Sub-Command Code: 0X0D)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.9 Return bus exception error count (sub-command code: 0x0D) Reads out the number of exception errors to the master. 1) Request message format (Master → Slave) Function code Sub-function code Data...
  • Page 70: Return Slave Message Count (Sub-Command Code: 0X0E)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.10 Return slave message count (sub-command code: 0x0E) Reads out the number of messages processed by the slave to the master. (Including broadcast messages) 1) Request message format (Master →...
  • Page 71: Return Slave No Response Count (Sub-Command Code: 0X0F)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.11 Return slave no response count (sub-command code: 0x0F) Reads to out the number of broadcast request messages received to the master. 1) Request message format (Master →...
  • Page 72: Return Slave Nak Count (Sub-Command Code: 0X10)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.12 Return slave NAK count (sub-command code: 0x10) Reads out the number of NAK responses to the master. The FX-Series MODBUS Communication ADP always returns "0". 1) Request message format (Master →...
  • Page 73: Return Slave Busy Count (Sub-Command Code: 0X11)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.13 Return slave busy count (sub-command code: 0x11) Reads out the number of busy responses to the master. The FX-Series MODBUS Communication ADP always returns "0". 1) Request message format (Master →...
  • Page 74: Return Bus Character Overrun Count (Sub-Command Code: 0X12)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.11 Diagnostics (Command Code: 0x08) 7.11.14 Return bus character overrun count (sub-command code: 0x12) Reads out the number of times the request message size exceeds the upper limit to the master. 1) Request message format (Master →...
  • Page 75: Get Communications Event Counter (Command Code: 0X0B)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.12 Get Communications Event Counter (Command Code: 7.12 Get Communications Event Counter (Command Code: 0x0B) Acquires the number of messages whose requested actions (read/write, diagnostics, etc.) have been normally completed.
  • Page 76: Get Communications Event Log (Command Code: 0X0C)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.13 Get Communications Event Log (Command Code: 0x0C) 7.13 Get Communications Event Log (Command Code: 0x0C) Acquires the communications event log of the FX-Series MODBUS Communication ADP into the master. 1) Request message format (Master →...
  • Page 77: Write Multiple Coils (Command Code: 0X0F)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.14 Write Multiple Coils (Command Code: 0x0F) 7.14 Write Multiple Coils (Command Code: 0x0F) Writes values (ON/OFF) to multiple coils. 1) Request message format (Master → Slave) Function code Data Function...
  • Page 78: Write Multiple Registers (Command Code: 0X10)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.15 Write Multiple Registers (Command Code: 0x10) 7.15 Write Multiple Registers (Command Code: 0x10) Writes values to multiple holding registers. 1) Request message format (Master → Slave) Data Function code Number of...
  • Page 79: Report Slave Id (Command Code: 0X11)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.16 Report Slave ID (Command Code: 0x11) 7.16 Report Slave ID (Command Code: 0x11) Acquires the information of the slave (FX-Series MODBUS Communication ADP) mounted station into the master.
  • Page 80: Mask Write Register (Command Code: 0X16)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.17 Mask Write Register (Command Code: 0x16) 7.17 Mask Write Register (Command Code: 0x16) Masks the values stored in a single holding register with AND or OR and writes the value. The masked values written to the holding register are as shown below.
  • Page 81: Read/Write Multiple Registers (Command Code: 0X17)

    Series Programmable Controllers 7 MODBUS Standard Commands User’s Manual - MODBUS Serial Communication Edition 7.18 Read/Write Multiple Registers (Command Code: 0x17) 7.18 Read/Write Multiple Registers (Command Code: 0x17) Reads from and writes to multiple holding registers. Writing is executed first and reading is then executed. 1) Request message format (Master →...
  • Page 82: Master Specification

    Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.1 MODBUS Master Command List Master Specification This chapter explains the MODBUS Master functions supported by the FX-Series MODBUS Communication ADP. MODBUS Master Command List Command Subcommand Command Name Details Code...
  • Page 83: Fnc 276 - Modbus Read/Write Instruction

    Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.2 FNC 276 - MODBUS Read/Write Instruction FNC 276 - MODBUS Read/Write Instruction 8.2.1 Outline This instruction allows the MODBUS Master to communicate (read/write data) with its associated Slaves. 1) Instruction Format FNC 276 Mnemonic...
  • Page 84: Adprw Command Parameters

    Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.3 ADPRW Command Parameters ADPRW Command Parameters The following table shows the required command parameters for each command code. Device Address/ Device Count/Sub-command :Source Data / Command Sub-command Code Data/AND Mask Destination PLC Device/OR Mask...
  • Page 85 Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.3 ADPRW Command Parameters Device Address/ Device Count/Sub-command :Source Data / Command Sub-command Code Data/AND Mask Destination PLC Device/OR Mask Code Applicable Devices: D • R • indexing • K • H Sub-function: 1H Sub-function Data: (Slave response: echo of...
  • Page 86 Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.3 ADPRW Command Parameters Device Address/ Device Count/Sub-command :Source Data / Command Sub-command Code Data/AND Mask Destination PLC Device/OR Mask Code Applicable Devices: D • R • indexing • K • H PLC Destination Device (head address) Sub-function: 10H Applicable...
  • Page 87 Series Programmable Controllers 8 Master Specification User’s Manual - MODBUS Serial Communication Edition 8.3 ADPRW Command Parameters Device Address/ Device Count/Sub-command :Source Data / Command Sub-command Code Data/AND Mask Destination PLC Device/OR Mask Code Applicable Devices: D • R • indexing • K • H OR Mask: MODBUS Address: AND Mask:...
  • Page 88: Slave Specification

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.1 MODBUS Slave Command Code List Slave Specification This chapter explains the configuration of the slave for MODBUS Serial Communication. MODBUS Slave Command Code List Subcommand Command Code Command Name Details Code...
  • Page 89: Modbus Device Address Allocation

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.2 MODBUS device address allocation Subcommand Command Code Command Name Details Code Get Communication Event 0x0B Read communication event counter Counter Get Communication Event 0x0C Read communication event log 0x0F Write Multiple Coils Write multiple binary (R/W) devices...
  • Page 90 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.3 MODBUS device address allocation (Default Values) Word device: MODBUS Word Device Address Device Input-Register (Read Only) Holding-Register (Read / Write) 0x0000-0x1F3F 0x0000-0x1F3F D0-D7999 0x1F40-0x213F 0x1F40-0x213F D8000-D8511 0x2140-0xA13F 0x2140-0xA13F R0-R32767...
  • Page 91: User Defined Modbus Device Address Assignment

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment User defined MODBUS Device Address Assignment Up to eight PLC device ranges can be mapped to the MODBUS Device Address range in a user defined order.
  • Page 92: Format Of The User Defined Device Allocation

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment 9.4.1 Format of the user defined device allocation The user defined device allocation affects only the RW areas - "Coils" and "Holding Register". The mapping of the Read Only (RO) areas "discrete inputs"...
  • Page 93 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment Size (12bit): 1 to 2048 blocks. The size of 1 block is defined for the PLC devices as follows: Bit device ( is 0H to BH): 1 word (16 bit devices) D and R register (...
  • Page 94: Example Of User Defined Device Allocation

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment 9.4.2 Example of user defined device allocation The following table provides an example of a valid user defined device allocation. Device Block Size / Number of PLC Head Device...
  • Page 95 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment Program for Setting up MODBUS Slave MODBUS Serial Communication Setup M8411 For more details on the Communication Setup H1097 D8400 Parameters, refer to Section 5.2 of this manual D8401 D8414...
  • Page 96 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment The following tables provide the values for MODBUS address allocation for Bit devices and word devices for the example stated above: Bit device: Coils (Read / Write) Device...
  • Page 97 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.4 User defined MODBUS Device Address Assignment The following tables provide the default values for MODBUS address allocation for Bit devices and word devices for the example stated above: Bit device: Coils (Read / Write) Device...
  • Page 98: Communication Event Log

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.5 Communication Event log Communication Event log This section details the communication event log details for the MODBUS slave device. 9.5.1 Communications event log 1. Communications event log information in the communication status area If configured in D8415/D8435 and D8416/D8436 the event log data is displayed in the communication status area.
  • Page 99: Communication Event Log Timing And Storage Format

    Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.5 Communication Event log 9.5.2 Communication event log timing and storage format 1) When receiving a request message: The slave (FX-Series MODBUS Communication ADP) stores this kind of event to the communications event log before executing the processing of the request message.
  • Page 100 Series Programmable Controllers 9 Slave Specification User’s Manual - MODBUS Serial Communication Edition 9.5 Communication Event log 4) When processing restart communications option: The slave (FX-Series MODBUS Communication ADP) stores this kind of event to the communications event log when processing the restart communications option. 00H is stored to the communications event log.
  • Page 101: 10. Creating Programs

    Series Programmable Controllers 10 Creating Programs User’s Manual - MODBUS Serial Communication Edition 10.1 Checking Contents of Related Devices 10. Creating Programs This chapter explains how to setup FX MODBUS Serial Communication and how to create programs for the Master and Slave stations. 10.1 Checking Contents of Related Devices For a full description of the PLC devices used by FX MODBUS Serial Communication, please refer to Chapter...
  • Page 102: Creating Programs For The Slave Station

    Series Programmable Controllers 10 Creating Programs User’s Manual - MODBUS Serial Communication Edition 10.3 Creating Programs for the Slave Station Program for Restarting Communication Restart Communication with Slave 0x0A Slave Address: 0x0A Command Code: 0x08 ADPRW H0FF00 Subcommand Code: 0x01 Subcommand Parameter: 0xFF00 (Reset Event Log) Command Complete Flag...
  • Page 103: Cautions On Program Creation

    Series Programmable Controllers 10 Creating Programs User’s Manual - MODBUS Serial Communication Edition 10.4 Cautions on Program Creation 10.4 Cautions on Program Creation 1. MODBUS Configuration Request Flag (M8411) When setting up FX MODBUS Serial Communication on either Channel 1 or 2, be sure to use Special Auxiliary Relay M8411 as shown in Chapter 5 of this manual.
  • Page 104: 11. Practical Program Examples

    Series Programmable Controllers 11 Practical Program Examples User’s Manual - MODBUS Serial Communication Edition 11.1 Setting Program for Master Station 11. Practical Program Examples This chapter gives practical program examples of how FX MODBUS Serial Communication can be used. 11.1 Setting Program for Master Station The FX MODBUS Master station can be used to execute a sequence of MODBUS commands in a cycle as shown in the following program.
  • Page 105 Series Programmable Controllers 11 Practical Program Examples User’s Manual - MODBUS Serial Communication Edition 11.1 Setting Program for Master Station Read Holding Registers Command ADPRW Command Complete Processing M8029 M8402 CALL When Error Flag is ON, call Error Handing Routine Reset Read Holding Registers Command Set Next Command in Sequence ADPRW...
  • Page 106: Setting Program For Slave Station

    Series Programmable Controllers 11 Practical Program Examples User’s Manual - MODBUS Serial Communication Edition 11.2 Setting Program for Slave Station 11.2 Setting Program for Slave Station After MODBUS Communication Setup, the FX MODBUS Slave station can be used to execute any User Program while the Master station reads and writes devices.
  • Page 107: 12. Troubleshooting

    Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.1 Checking the FX3U PLC Version Applicability 12. Troubleshooting This chapter explains troubleshooting. 12.1 Checking the FX PLC Version Applicability Verify that the FX Series PLC main unit is an applicable version. →...
  • Page 108: Checking Setting Contents And Errors

    Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.5 Checking Setting Contents and Errors 2. Communication setting using parameters Verify that the communication setting parameters are suitable for use. If the communication setting parameters are not suitable for use, communication will not function correctly. After changing any setting, make sure to reboot the PLC's power.
  • Page 109 Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.5 Checking Setting Contents and Errors Device Name Description Channel 2 MODBUS D8420 Communication Format D8421 Channel 2 MODBUS Protocol Channel 2 MODBUS D8429 Slave Response Timeout Channel 2 MODBUS D8430 Turn Around Delay Channel 2 MODBUS...
  • Page 110: Modbus Error Code List

    Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.6 MODBUS Error Code List 2) Error codes When a communication error occurs while using MODBUS communication, the corresponding communication error flag turns ON, and the MODBUS error code is stored in the corresponding data register.
  • Page 111 Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.6 MODBUS Error Code List MODBUS Master Error Error Name and Details Related Devices:(M & D) Corrective Action / Slave Code Check Bit-level Error Communication Master 0204 See above Format data register / Slave Parity, overrun (rx register) or framing error...
  • Page 112 Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.6 MODBUS Error Code List MODBUS Master Error Error Name and Details Related Devices:(M & D) Corrective Action / Slave Code Verify that the MODBUS Device Address Allocation of Invalid Device Address the Slave is set correctly.
  • Page 113 Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.6 MODBUS Error Code List MODBUS Master Error Error Name and Details Related Devices:(M & D) Corrective Action / Slave Code Illegal Data Value See Corrective Data value does not match MODBUS 0216 Slave See above...
  • Page 114 Series Programmable Controllers 12 Troubleshooting User’s Manual - MODBUS Serial Communication Edition 12.6 MODBUS Error Code List 1. Exception codes supported by FX MODBUS Slave The following table outlines the exception codes supported by the MODBUS slave device. Exception Exception name Details code Illegal Function...
  • Page 115: Warranty

    Anyother failure found not to be the responsibility controller range of applications. of Mitsubishi or that admitted not to be so by the However, in certain cases, some applications may be user.
  • Page 116: Revised History

    Series Programmable Controllers User’s Manual - MODBUS Serial Communication Edition Revised History Revised History Date Revision Discription 4/2007 First Edition...
  • Page 118 USER'S MANUAL - MODBUS Serial Communication Edition SERIES PROGRAMMABLE CONTROLLERS HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN JY997D26201A Effective Apr. 2007 (MEE) Specifications are subject to change without notice.

Table of Contents