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.
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.
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.................
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.
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...
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.
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 •...
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...
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...
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.
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...
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.
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...
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.
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.
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.
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.
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.
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...
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"...
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...
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.
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.
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...
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.
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...
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.
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 ✘...
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.
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.
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.
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...
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...
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...
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...
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...
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...
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 →...
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.
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.
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...
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.
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: •...
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) •...
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 →...
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 →...
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...
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 →...
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 →...
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 →...
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 →...
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 →...
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.
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 →...
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.
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.
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 →...
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...
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...
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.
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 (...
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...
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.
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.
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...
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...
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.
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...
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.
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. →...
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...
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...
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.
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.