Truyen Thong Modbus FX3U PDF
Truyen Thong Modbus FX3U PDF
Truyen Thong Modbus FX3U PDF
USER'S MANUAL
MODBUS Serial Communication Edition
Safety Precautions
(Read these precautions before use.)
Before installation, operation, maintenance or inspection of this product, thoroughly read through and
understand this manual and all of the associated manuals. Also, take care to handle the module properly and
safety.
This manual classifies the safety precautions into two categories:
and
1. DESIGN PRECAUTIONS
Make sure to have the following safety circuits outside of the PLC to ensure safe system operation even during
external power supply problems or PLC failure.
Otherwise, malfunctions may cause serious accidents.
1) Most importantly, have the following: an emergency stop circuit, a protection circuit, an interlock circuit for
opposite movements (such as normal vs. reverse rotation), and an interlock circuit (to prevent damage to the
equipment at the upper and lower positioning limits).
2) Note that when the PLC CPU detects an error, such as a watchdog timer error, during self-diagnosis, all
outputs are turned off. Also, when an error that cannot be detected by the PLC CPU occurs in an input/output
control block, output control may be disabled.
External circuits and mechanisms should be designed to ensure safe machinery operation in such a case.
3) Note that the output current of the service power supply for sensors varies depending on the model and the
absence/presence of extension blocks. If an overload occurs, the voltage automatically drops, inputs in the
PLC are disabled, and all outputs are turned off.
External circuits and mechanisms should be designed to ensure safe machinery operation in such a case.
4) Note that when an error occurs in a relay, triac or transistor output device, the output could be held either on or
off.
For output signals that may lead to serious accidents, external circuits and mechanisms should be designed to
ensure safe machinery operation in such a case.
Do not bundle the main circuit line together with or lay it close to the main circuit, high-voltage line or load line.
Otherwise, noise disturbance and/or surge induction are likely to take place. As a guideline, lay the control line at
least 100mm (3.94") or more away from the main circuit or high-voltage lines.
Install module so that excessive force will not be applied to the built-in programming port, power connectors, I/O
connectors, communication connectors, or communication cables.
Failure to do so may result in wire damage/breakage or PLC failure.
(1)
Safety Precautions
(Read these precautions before use.)
2. WIRING PRECAUTIONS
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, offered as an accessory, before turning on the power or initiating operation
after installation or wiring work.
Failure to do so may cause electric shock.
Make sure to observe the following precautions in order to prevent any damage to the machinery or accidents due
to abnormal data written to the PLC under the influence of noise:
1) Do not bundle the main circuit line together with or lay it close to the main circuit, high-voltage line or load line.
Otherwise, noise disturbance and/or surge induction are likely to take place. As a guideline, lay the control line
at least 100mm (3.94") or more away from the main circuit or high-voltage lines.
2) Ground the shield wire or shield of the shielded cable at one point on the PLC. However, do not use common
grounding with heavy electrical systems.
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 end of strand wire 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.
(2)
Manual number
JY997D26201
Manual revision
Date
7/2012
Foreword
This manual explains the "MODBUS serial communication" provided in FX3G/FX3U/FX3GC/FX3UC Series
Programmable Controllers and should be read and understood before attempting to install or use the unit.
Store this manual in a safe place so that you can take it out and read it whenever necessary. Always forward
it to the end user.
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.
Outline Precautions
This manual provides information for the use of the FX3G/FX3U/FX3GC/FX3UC Series MODBUS serial
communication. The manual has been written to be used by trained and competent personnel. The
definition of such a person or persons is as follows:
1) Any engineer who is responsible for the planning, design and construction of automatic equipment
using the product associated with this manual should be of a competent nature, trained and qualified
to the local and national standards required to fulfill that role. These engineers should be fully aware of
all aspects of safety with regards to automated equipment.
2) Any commissioning or service engineer must be of a competent nature, trained and qualified to the
local and national standards required to fulfill that job. These engineers should also be trained in the
use and maintenance of the completed product. This includes being completely familiar with all
associated documentation for the said product. All maintenance should be carried out in accordance
with established safety practices.
3) All operators of the completed equipment should be trained to use that product in a safe and
coordinated manner in compliance to established safety practices. The operators should also be
familiar with documentation which is connected with the actual operation of the completed equipment.
Note:
The term 'completed equipment' refers to a third party constructed device which contains or uses
the product associated with this manual
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 with 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.
When combining this product with other products, please confirm the standard and the code, or regulations
with which the user should follow. Moreover, please confirm the compatibility of this product to the system,
machine and apparatus which a user is using.
If in doubt at any stage during the installation of the product, always consult a professional electrical
engineer who is qualified and trained to the local and national standards. If in doubt about the operation or
use, please consult your local 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
have noticed a doubtful point, a doubtful error, etc., please contact your local Mitsubishi Electric
representative.
Registration
MODBUS is a registered trademark of Schneider Electric S.A.
The company name and the product name to be described in this manual are the registered trademarks or
trademarks of each company.
Table of Contents
Table of Contents
SAFETY PRECAUTIONS .................................................................................................. (1)
Related manuals........................................................................................................................ 6
Generic Names and Abbreviations Used in Manuals ............................................................ 8
1. Outline
2. Specifications
14
3. System Configuration
19
4. Wiring
27
5. Communication Setup
5.1
5.2
5.3
5.4
34
Table of Contents
39
48
7.12
7.13
7.14
7.15
7.16
7.17
7.18
8. Master Specification
86
9. Slave Specification
9.1
9.2
9.3
9.4
Table of Contents
92
106
110
12. Troubleshooting
12.1
12.2
12.3
12.4
12.5
12.6
113
Warranty................................................................................................................................. 121
Revised History ..................................................................................................................... 122
Related manuals
Related manuals
For a detailed explanation of the MODBUS serial communication network in FX3G/FX3U/FX3GC/FX3UC 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.
For acquiring required manuals, contact the distributor from where your product was purchased.
~Essential manual
{Manual required depending on application
UManual with additional manual for detailed explanation
Manual name
Manual
number
Contents
Model
name code
Supplied
with
product
FX3G Series
Hardware Manual
Additional
Manual
FX3G Series
Users Manual
- Hardware Edition
09R521
Supplied
with
product
FX3U Series
Hardware Manual
Additional
Manual
FX3U Series
Users Manual
- Hardware Edition
09R516
Supplied
with
product
FX3GC Series
Hardware Manual
Additional
Manual
FX3GC Series
Users Manual
- Hardware Edition
09R533
Supplied
with
product
FX3UC-32MT-LT-2
Hardware Manual
Additional
Manual
FX3UC Series
Users Manual
- Hardware Edition
09R519
Related manuals
Manual
number
Contents
Model
name code
Programming
Additional
Manual
FX3G/FX3U/FX3GC/FX3UC
Items related to programming in PLCs
Series Programming
including explanation of basic instructions,
Manual JY997D16601
applied instructions and various devices in
Basic & Applied Instruction
FX3G/FX3U/FX3GC/FX3UC PLCs.
Edition
Additional
Manual
MELSEC-Q/L/F Structured
Programming Manual
(Fundamentals)
Additional
Manual
FXCPU Structured
Programming Manual
[Device & Common]
JY997D26001
09R925
Additional
Manual
FXCPU Structured
Programming Manual
[Basic & Applied
Instruction]
JY997D34701
09R926
Additional
Manual
FXCPU Structured
Programming Manual
[Application Functions]
JY997D34801
09R927
SH-080782
09R517
13JW06
FX3U-232ADP-MB
Installation Manual
Supplied
with
product
FX3U-485ADP-MB
Installation Manual
Additional
Manual
FX3G/FX3U/FX3GC/FX3UC
Series Users Manual MODBUS Serial
Communication Edition
(this manual)
JY997D26201
Supplied
with
product
09R626
Manual for N:N link, parallel link, computer link and non- protocol communication by RS instructions/FX2N-232IF
{
Additional
Manual
JY997D16901
09R715
Name
Programmable controllers
FX3G Series
FX3G PLC or main unit
FX3U Series
FX3U PLC or main unit
FX3GC Series
FX3GC PLC or main unit
FX3UC Series
FX3UC PLC or main unit
Expansion boards
Expansion board
Special adapters
Special adapter
Generic name of special high speed I/O adapters, special communication adapters, CF
card special adapters, and special analog adapters
Connectable equipment may vary depending on the main unit. For connectable equipment,
refer to the Users Manual - Hardware Edition of the main unit.
Generic name of special high speed I/O adapters (The models shown below):
FX3U-2HSY-ADP and FX3U-4HSX-ADP
Special communication
adapter
Generic name of special adapter connection conversion adapter (The models shown below):
FX3G-CNV-ADP
Peripheral equipment
Peripheral equipment
Generic name of programming software, handy programming panels, and display units
Programming tools
Programming tool
Programming software
GX Works2
GX Developer
Manuals
FX3G Hardware Edition
Programming Manual
FX-30P Manual
1 Outline
1
Outline
1.
Outline
Specifications
1.1
Outline of System
33 units
FX PLC
Slave station No. 32 (20H)
.......
.......
Communication
equipment operating
in accordance with .......
MODBUS RS-485
....... Chapter 4.
MODBUS
Standard
Commands
Communication
equipment operating
in accordance with
MODBUS RS-232C
Slave
Specification
Communication
equipment operating
in accordance with
MODBUS RS-232C
FX PLC
Slave station No. 1 (01H)
Master
Specification
FX PLC
Master station
6
Related
Devices and
Comm. Status
Communication
equipment operating
in accordance with
MODBUS RS-485
Communication
Setup
FX PLC
Slave station No. 1 (01H)
Wiring
Communication
equipment operating
in accordance with
MODBUS RS-485
System
FX PLC
Master station
3
System
Configuration
The MODBUS serial communication network allows up to 32 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.
1) Up to 32 slaves can be controlled by one FX3G/FX3U/FX3GC/FX3UC MODBUS Master
2) Master and Slave functionality
3) RTU and ASCII mode (The ASCII mode is available only in FX3U and FX3UC PLCs)
4) One channel per PLC can be used for MODBUS serial communication (1 MODBUS Master
channel or 1 MODBUS Slave channel)
5) Transmission speed up to 115.2 kbps
6) The MODBUS Master function uses a new PLC command dedicated to MODBUS serial
communication
10
Note
Creating
Programs
1 Outline
1.2
Outline
Refer to Chapter 2.
Check communication specifications.
Communication specifications
Communication protocol
Number of Slaves
Refer to Chapter 3.
Determine system configuration and selection.
System configuration
Select communication equipment
Refer to Chapter 4.
Perform wiring.
Wiring procedure
Wiring example
Programming tool
Connect PLC.*1
Turn ON power.
Refer to Chapter 5.
Refer to Chapter 6.
Communication
Check related special data registers and
auxiliary relays.
10
For the corresponding programming tool to PLC connection method, refer to the "Programming
Communication" Chapter of the FX Series User's Manual - Data Communication Edition, or the
corresponding programming tool manual.
For details on operating procedures, refer to the corresponding programming tool manual.
1 Outline
1.3.1
Applicable versions
Outline
1.3
FX3U Series
Remarks
FX3GC Series
FX3UC Series
Specifications
PLC
FX3G Series
The D8001/D8101 (decimal) special data register contains information for determining the PLC version.
D8001/D8101
Wiring
1.4
The year and month of production of the special adapter can be checked from the manufacturer's serial
number "S/N" indicated on the label adhered to the left side of the product.
Communication
Setup
Example: FX3U-485ADP-MB
(manufacture's serial number: 1010001)
Related
Devices and
Comm. Status
Left side
S/N
System
Configuration
1. Version check
1010001
MODBUS
Standard
Commands
Control number
Control number
Month (Example: Jan.):
1 to 9 = January to September,
X = October, Y = November, Z = December
Year (Example: 2010): Last two digit of year
9
Slave
Specification
Master
Specification
10
Creating
Programs
11
1 Outline
1.5
1.5.1
It is not possible to create programs in FX3G, FX3U and FX3UC PLCs using programming tools of inapplicable
versions.
It is possible to create programs in FX3GC PLC using programming tools of inapplicable versions by selecting
"FX3G" as the alternative model as far as such programming tools are applicable to FX3G PLC.
The following programming tools and versions are applicable for the FX3G/FX3U/FX3GC/FX3UC series.
1. Japanese versions
Model name (Media model
name is shown below.)
Applicable version
Remarks
GX Developer
SWD5C(F)-GPPW-J
FX-30P
FX3G PLC
GX Works2
SWDNC-GXW2-J
GX Developer
SWD5C(F)-GPPW-J
FX-30P
FX3GC PLC
GX Works2
SWDNC-GXW2-J
FX-30P
12
*1.
Select "FX3G" in model selection for GX Works2 earlier than Ver. 1.77F.
*2.
Select "FX3G" in model selection for the offline mode in FX-30P earlier than Ver. 1.30.
1 Outline
Applicable version
Outline
2. English versions
Remarks
GX Developer
SWD5C(F)-GPPW-E
FX-30P
2
Specifications
GX Works2
SWDNC-GXW2-E
FX3G PLC
Ver. 1.08J or later
GX Developer
SWD5C(F)-GPPW-E
FX-30P
*1
System
Configuration
GX Works2
SWDNC-GXW2-E
GX Works2
SWDNC-GXW2-E
FX-30P
Wiring
FX3GC PLC
Ver. 1.77F or later
Ver. 1.30 or later
Select "FX3G" in model selection for GX Works2 earlier than Ver. 1.77F.
*2.
Select "FX3G" in model selection for the offline mode in FX-30P earlier than Ver. 1.30.
5
Communication
Setup
*1.
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
13
2 Specifications
2.
Specifications
This chapter explains the communication specifications and performance.
2.1
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 FX3U-232ADP-MB or FX3U485ADP-MB. The communication format, protocol, etc. are determined by the communication setup using a
sequence program, as described in Chapter 5.
Item
Specifications
FX3U-232ADP-MB
Transmission Speed
Data Length
RS-232C
Communication Protocol
Number of Slaves
Master Function
Number of Functions
Number of Simultaneously
Executable Instructions
Maximum Write Data
*1.
RTU or ASCII
16 Slaves,
32 Slaves*1
1 Slave
Number of Functions
Weight
1 Instruction
External Dimensions
Station Number
Special Adapter
Number of Simultaneous
Acceptable Request
Messages
Slave Function
RS-485
Stop Bit
Transmission Distance
Remarks
Either 1 MODBUS Master or 1
MODBUS Slave channel
1 Channel
Communication Interface
Transmission
Specifications
FX3U-485ADP-MB
1 Request Message
1 to 247
90 (H) x 17.6 (W) 74 (D) [mm]
80g
Caution
When you set the baud rate to 38400 bps or more in a FX3G/FX3GC Series PLC, please set D8411 (D8431) to
be 3ms or more. When D8411 (D8431) is set at less than 3ms, it may not be able to communicate normally.
14
2 Specifications
2.1 Communication Specifications
This table details the specifications when using MODBUS communication. The FX3U-485ADP-MB and FX3U232ADP-MB also features FX3U-485ADP and FX3U-232ADP functionality respectively. Therefore the
following communication types are also available when using the following modules:
N:N network, Parallel link, Computer link, Non-protocol
communication and Inverter communication.
FX3U-232ADP
For further information on the communication types and please refer to the FX Series User's Manual - Data
Communication Edition.
Specifications
FX3U-485ADP
Outline
Note
3
System
Configuration
4
Wiring
5
Communication
Setup
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
15
2 Specifications
2.2
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.
X0
M0
FNC276
ADPRW
**
SET
M0
**
**
RST
M0
**ADPRW*******
**
M8029
Instruction execution complete flag
M0
M8029
T2
T3
Command
Creation
T4
Request Sending
Slave Delay
Response
Receiving
3.5 character
wait
T5
T6
T7
processing
T8
T11
T9
T13
T12
Request Receiving
Slave Message to
Message Delay
T14
T15
processing
Response Sending
16
T10
2 Specifications
T4
Max Scan Time
Specifications
Tm = T1 + T2 + T3
T1 = INT
T5
Max Scan Time
3
System
Configuration
T2 = INT
T5 = T6 + T7 + T8 + T9 + T10
Wiring
T7 =
5
Communication
Setup
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
T14 =
8
Master
Specification
T13 =
1
Outline
The Master processing time (Tm) can be calculated in milliseconds (ms) as follows, where INT (n) indicates
the concatenation of any remaining decimal values.
9
Slave
Specification
10
Creating
Programs
17
= 5ms
= 5ms
= Read Holding Registers 0-9 (Command Code 0x03)
= RTU Mode
= 8bytes (1byte Address, 5byte Frame, 2byte CRC)
= 25bytes (1byte Address Echo, 22byte Frame, 2byte CRC)
= 10bits (1bit Start, 8bit Data Length, 0bit Parity, 1bit Stop)
= 19.2Kbps
= 10ms
T4 = 5ms
T1 = INT
5ms
5ms
T6 1ms
T7 =
8 Bytes in Request
10bits
19200bps
T8 = 10ms
T9 =
25 Bytes in Response
T10 =
10bits
19200bps
3.5 Characters * 10bits
19200bps
T2 = INT
33ms
5ms
T3 1ms
Tm = 5ms + 35ms + 1ms = 41ms
Slave processing time (Ts)
Command
Frame Mode
Bytes in Request
Bytes in Response
Character Length
Baud Rate
D8411
Max Scan Time
T14 =
8 Bytes in Request
10bits
19200bps
T15 = 5ms
T11 = 5.2ms + 5ms + 5ms = 15.2ms
T12 1ms
T13 =
25 Bytes in Response
10bits
19200bps
Ts = 15.2ms + 1ms + 14.0ms = 30.2ms
18
2 Specifications
3 System Configuration
3.1 System Configuration
1
Outline
3.
System Configuration
3.1
System Configuration
This section outlines the system configuration required to use MODBUS serial communication.
System
Configuration
FX PLC
Total extension
distance
Communication
adapter
RS-485: 500 m
(1640' 5")
RS-232C: 15 m
(49' 2")
Wiring
5
Communication
Setup
Connector
conversion
adapter
+
Expansion
board
RS-485: 500 m
(1640' 5")
RS-232C: 15 m
(49' 2")
+
Expansion
board
7
MODBUS
Standard
Commands
Communication
adapter
FX3U Series
Related
Devices and
Comm. Status
Communication
adapter
FX3UC-32MT-LT(-2)
8
FX3UC Series
(D, DS, DSS)
Master
Specification
Communication
adapter
RS-485: 500 m
(1640' 5")
RS-232C: 15 m
(49' 2")
Slave
Specification
Communication
adapter
2
Specifications
This section explains the configuration of communication equipment operating in accordance with RS-485
and RS-232C and the selection of equipment required by FX3G/FX3U/FX3GC/FX3UC PLCs.
FX3GC Series
10
Creating
Programs
For combinations of communication equipment for each FX Series, refer to the next page.
19
3.2
3 System Configuration
Total extension
distance
15 m
(49' 2")
FX3G
(14-point, 24-point
type)
FX3G-CNV-ADP
FX3U-232ADP-MB
(9-pin D-Sub, male)
15 m
(49' 2")
FX3G-CNV-ADP
FX3U-232ADP-MB
(9-pin D-Sub, male)
FX3G-CNV-ADP
FX3U- ADP(-MB)
(Where represents
232 and 485)
FX3U-232ADP-MB
(9-pin D-Sub, male)
15 m
(49' 2")
15 m
(49' 2")
FX3U-232ADP-MB
(9-pin D-Sub, male)
ch2
ch1
+
FX3U-232ADP(-MB),
FX3U-485ADP(-MB)
20
15 m
(49' 2")
FX3U-232ADP-MB
(9-pin D-Sub, male)
Check
3 System Configuration
1
Total extension
distance
Check
Outline
FX Series
Specifications
FX3U-CNV-BD
15 m
(49' 2")
FX3U-232ADP-MB
(9-pin D-Sub, male)
RD
SD
FX3U--BD
15 m
(49' 2")
4
Wiring
FX3U
System
Configuration
ch1
FX3U-232ADP-MB
ch2
Communication
Setup
15 m
(49' 2")
FX3U-CNV-BD
FX3U-232ADP(-MB),
FX3U-232ADP-MB
(9-pin D-Sub, male)
FX3U-485ADP(-MB),
FX3U-CF-ADP
When a FX3U-CF-ADP is used, it occupies one communication port
channel.
6
Related
Devices and
Comm. Status
ch1
MODBUS
Standard
Commands
15 m
(49' 2")
FX3U-232ADP-MB
Master
Specification
ch1
ch2
9
Slave
Specification
15 m
(49' 2")
FX3U-232ADP(-MB),
FX3U-232ADP-MB
(9-pin D-Sub, male)
FX3U-485ADP(-MB),
FX3U-CF-ADP
When a FX3U-CF-ADP is used, it occupies one communication port
channel.
10
Creating
Programs
21
FX Series
3 System Configuration
Total extension
distance
+
FX3U-CNV-BD
15 m
(49' 2")
FX3U-232ADP-MB
(9-pin D-Sub, male)
ch2
RD
SD
FX3UC-32MT-LT
(-2)
FX3U--BD
(Where represents
232, 422, 485, USB and 8AV)
15 m
(49' 2")
FX3U-232ADP-MB
(9-pin D-Sub, male)
+
FX3U-CNV-BD
ch2
FX3U-232ADP(-MB),
FX3U-232ADP-MB
(9-pin D-Sub, male)
FX3U-485ADP(-MB),
FX3U-CF-ADP
When a FX3U-CF-ADP is used, it occupies one communication port
channel.
22
15 m
(49' 2")
Check
3 System Configuration
1
Outline
FX Series
Total extension
distance
Check
Specifications
500 m
(1640' 5")
FX3G-CNV-ADP
FX3U-485ADP-MB
(European terminal block)
System
Configuration
FX3G
(14-point, 24-point
type)
4
FX3G-CNV-ADP
Wiring
500 m
(1640' 5")
FX3U-485ADP-MB
(European terminal block)
Communication
Setup
FX3G
(40-point, 60-point
type)
FX3U- ADP(-MB)
FX3U-485ADP-MB
(Where
represents (European terminal block)
232 and 485)
Ch2 is not available when the FX3G-232-BD, FX3G-422-BD,
FX3G-485-BD or FX3G-8AV-BD is connected in the second
expansion board slot.
Related
Devices and
Comm. Status
FX3G-CNV-ADP
500 m
(1640' 5")
7
MODBUS
Standard
Commands
500 m
(1640' 5")
8
Master
Specification
FX3U-485ADP-MB
ch2
ch1
FX3U-232ADP(-MB),
FX3U-485ADP(-MB)
Slave
Specification
9
500 m
(1640' 5")
FX3U-485ADP-MB
10
Creating
Programs
23
FX Series
3 System Configuration
Total extension
distance
+
FX3U-CNV-BD
500 m
(1640' 5")
FX3U-485ADP-MB
ch2
RD
SD
FX3U--BD
FX3U
500 m
(1640' 5")
FX3U-485ADP-MB
ch2
500 m
(1640' 5")
FX3U-CNV-BD
FX3U-232ADP(-MB),
FX3U-485ADP-MB
(European terminal block)
FX3U-485ADP(-MB),
FX3U-CF-ADP
When a FX3U-CF-ADP is used, it occupies one communication port
channel.
500 m
(1640' 5")
FX3U-485ADP-MB
(European terminal block)
FX3UC
(D, DS, DSS)
ch2
+
FX3U-232ADP(-MB),
FX3U-485ADP(-MB),
FX3U-CF-ADP
500 m
(1640' 5")
FX3U-485ADP-MB
(European terminal block)
24
Check
3 System Configuration
1
Total extension
distance
Check
Outline
FX Series
Specifications
FX3U-CNV-BD
500 m
(1640' 5")
FX3U-485ADP-MB
(European terminal block)
RD
SD
FX3U--BD
(Where represents
232, 422, 485, USB and 8AV)
500 m
(1640' 5")
Wiring
FX3UC-32MT-LT
(-2)
System
Configuration
ch1
FX3U-485ADP-MB
(European terminal block)
Communication
Setup
ch2
500 m
(1640' 5")
FX3U-CNV-BD
Related
Devices and
Comm. Status
FX3U-232ADP(-MB),
FX3U-485ADP-MB
(European terminal block)
FX3U-485ADP(-MB),
FX3U-CF-ADP
When a FX3U-CF-ADP is used, it occupies one communication port
channel.
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
25
3.3
3 System Configuration
3.3 Limitation when ch1 and ch2 are used at the same time
Limitation when ch1 and ch2 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. For more details, refer to the table below.
RD A
RD
RD B
SD A
SD
SD B
SG
Communication
special adapter
Expansion
board
Communication
special adapter
Expansion
board
FX3G/FX3U/FX3GC/FX3UC PLCs
Parallel
Link
Computer
Link
Inverter
Communication
Non-protocol
Communication (RS
instruction)
Non-protocol
Communication (RS2
instruction)
Programming
Communication
Remote
Maintenance
CF card
MODBUS
Serial Communication
MODBUS Serial
Communication
(Example 1)
N:N Networking
(Example 2)
Parallel Link
Computer Link
Inverter
Communication
Non-protocol
Communication
(RS2 instruction)
Programming
Communication
Remote
Maintenance *2
CF card
*3
*3
*1.
*2.
*3.
Example1:
When using "MODBUS Serial Communication" on ch1, "MODBUS Serial Communication" can not be set on
ch2.
Example2:
When using "MODBUS Serial Communication" on ch1, "N:N Networking" can be used on ch2.
For more details on using N:N Networking and MODBUS Serial Communication,
refer to Section 5.3.
26
4 Wiring
4.1 Wiring Procedure
1
Outline
4.
Wiring
Specifications
WIRING PRECAUTIONS
WIRING PRECAUTIONS
3
System
Configuration
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, offered as an accessory, before turning on the power or initiating
operation after installation or wiring work.
Failure to do so may cause electric shock.
4
Wiring
5
Communication
Setup
6
Related
Devices and
Comm. Status
Make sure to observe the following precautions in order to prevent any damage to the machinery or accidents
due to abnormal data written to the PLC under the influence of noise:
1) Do not bundle the main circuit line together with or lay it close to the main circuit, high-voltage line or load line.
Otherwise, noise disturbance and/or surge induction are likely to take place.
As a guideline, lay the control line at least 100mm (3.94") or more away from the main circuit or high-voltage
lines.
2) Ground the shield wire or shield of the shielded cable at one point on the PLC. However, do not use common
grounding with heavy electrical systems.
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 end of strand wire 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.
7
MODBUS
Standard
Commands
4.1
Wiring Procedure
Master
Specification
9
Slave
Specification
10
Creating
Programs
27
4 Wiring
4.2
4.2.1
FX PLC
Slave station No. 1 (01H)
Communication
equipment operating
in accordance with
MODBUS RS-232C
Communication
equipment operating
in accordance with
MODBUS RS-232C
15 m (49' 2")
4.2.2
FX PLC
Slave station No. 1 (01H)
FX PLC
Slave station No. 32 (20H)
.......
Communication
equipment operating
in accordance with
MODBUS RS-485
Communication
equipment operating
in accordance with
MODBUS RS-485
Note
MODBUS Slave Nodes do not need to be numbered in any specific order.
28
Communication
equipment operating
in accordance with
MODBUS RS-485
Outline
4.3
4 Wiring
4.3.1
3
System
Configuration
Shield
Example of three-pair
cable structural drawing
Wiring
Specifications
Use shielded twisted pair cables for connecting communication equipment operating in accordance with
MODBUS RS-485.
Related
Devices and
Comm. Status
2p, 3p
Communication
Setup
Number of pairs
Description
Shielded cable
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
29
4.3.2
4 Wiring
Connecting cables
1. European type terminal block
Use shielded twisted pair cables for connecting communication equipment operating in accordance with
MODBUS RS-485.
The table below shows applicable cables and tightening torques.
Cable size when Cable size when
one cable is
two cables are
connected
connected
AWG22 to
AWG20
FX3U-485ADP-MB
AWG22
Tightening
torque
Tool size
A
Applicable
0.22 to 0.25
0.4 (0.01") 2.5 (0.09")
(AWG22 to AWG20)
Nm
Approx. 9 mm
(0.35")
Model name
Caulking tool
AI 0.5-8WH
CRIMPFOX 6*1
(or CRIMPFOX 6T-F*2)
Insulating sleeve
Contact area
(Crimp area)
8 mm (0.31")
2.6 mm
(0.1")
14 mm
(0.55")
30
Model name
SZS 0.4 2.5
Select a
screwdriver
with a
straight tip.
Outline
4.3.3
4 Wiring
330
Terminal
resistor selector
switch
OPEN
3
System
Configuration
110
4.4
Specifications
4.4.1
Wiring
Representative wiring examples are shown in this section. When pin numbers in the counterpart equipment
are different, wire the pins as shown below.
RD(RXD)
RD(RXD)
RD(RXD)
SD(TXD)
SD(TXD)
SD(TXD)
ER(DTR)
RS(RTS)
ER(DTR)
20
SG(GND)
SG(GND)
SG(GND)
CS(CTS)
DR(DSR)
DR(DSR)
*1
7
MODBUS
Standard
Commands
*1.
FX3U-232ADP-MB
9-pin D-Sub
Related
Devices and
Comm. Status
Name
Communication
Setup
FG
1
FG
PLC side
For third-party external equipment requiring the Control Signal, connect these pins.
The FX3U-232ADP-MB does not require these pins to be connected.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
31
4 Wiring
4.5
4.5.1
One-pair wiring
FX3U-485ADP-MB
Master
FX3U-485ADP-MB
Slave
FX3U-485ADP-MB
Slave
FX3U-485ADP-MB
Slave
SDA
SDA
SDA
SDA
Terminal
resistor:
110
SDB
SDB
SDB
SDB
*2
RDA
RDA
RDA
RDA
RDB
RDB
RDB
RDB
SG
SG
SG
SG
Class-D grounding
(resistance: 100 or less)*1
Class-D grounding
(resistance: 100 or less)*1
Terminal
resistor:
110
*2
Class-D grounding
(resistance: 100 or less)*1
*1 Make sure to perform Class-D grounding on the shield of the twisted pair cable connected to the FX3U-485ADP-MB.
*2 Make sure to provide a terminal resistor at each end of a line.
The FX3U-485ADP-MB has a built-in terminal resistor.
Set the terminal resistor selector switch accordingly.
4.5.2
Two-pair wiring
FX3U-485ADP-MB
Master
FX3U-485ADP-MB
Slave
FX3U-485ADP-MB
Slave
FX3U-485ADP-MB
Slave
SDA
SDA
SDA
SDA
SDB
SDB
SDB
SDB
RDA
RDA
RDA
RDA
RDB
RDB
RDB
RDB
*2
*2
Terminal
resistor:
330
2
SG
SG
Class-D grounding
(resistance: 100 or less)*1
SG
SG
Class-D grounding
(resistance: 100 or less)*1
Class-D grounding
(resistance: 100 or less)*1
*1 Make sure to perform Class-D grounding on the shield of the twisted pair cable connected to the FX3U-485ADP-MB.
*2 Make sure to provide a terminal resistor at each end of a line.
The FX3U-485ADP-MB has a built-in terminal resistor.
Set the terminal resistor selector switch accordingly.
32
*2
*2
Terminal
resistor:
330
2
4.6 Grounding
Grounding
Outline
4.6
4 Wiring
PLC
Other
equipment
Other
equipment
Shared grounding
Good condition
PLC
Other
equipment
System
Configuration
Independent grounding
Best condition
PLC
2
Specifications
Common grounding
Not allowed
4
Wiring
5
Communication
Setup
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
33
5.
5 Communication Setup
5.1 Setup method for MODBUS serial communication
Communication Setup
This chapter explains the setup method for using the MODBUS protocol with an FX3G/FX3U/FX3GC/FX3UC
PLCs and MODBUS Communication ADP.
5.1
5.2
*1.
34
Name
D8400
Communication Format
D8401
Protocol
D8409
D8410
D8411
D8412
Number of Retries
D8415
D8416
Description
5 Communication Setup
1
Outline
The ladder code for setting the Master parameters can be expressed as follows:
Program for setting up a MODBUS Master
b15
H1097
D8400
The communication
format is set.
b0
Specifications
MODBUS Serial
Communication Setup
M8411
MOV
H1
D8401
b0
System
Configuration
K2000
D8409
4
Wiring
MOV
K400
D8410
5
K10
D8411
MOV
K3
D8412
D8415
The Communication
Status Information
Setup *1 is set.
Communication
Setup
MOV
MOV
H1
Related
Devices and
Comm. Status
b15
b0
MODBUS
Standard
Commands
K100
D8416
When you program MODBUS communications parameters with structured ladder/FBD, the MOV commands
must be connected using the ENO output and the EN input.
<Program example>
MODBUS Serial
Communication Setup
K10
EN
s
MOV
ENO
d
D8400 H1
EN
s
MOV
ENO
d
D8411 K3
EN
s
MOV
ENO
d
D8401 K2000
EN
s
MOV
ENO
d
D8412
EN
s
MOV
ENO
d
H1
D8409
D8415
K400
EN
s
MOV
ENO
d
K100
EN
s
MOV
ENO
d
D8410
10
D8416
35
Creating
Programs
MOV
ENO
d
Slave
Specification
H1097
EN
s
M8411
Master
Specification
5 Communication Setup
<Program example>
MOV( MOV( MOV( MOV( MOV( MOV( MOV( MOV( M8411, H1097, D8400), H1, D8401), K2000, D8409), K400,
D8410), K10, D8411), K3, D8412), H1, D8415), K100, D8416) ;
Parameters for a Slave using Channel 1:
Device
*1.
Name
Description
D8400
Communication Format
D8401
Protocol
D8411
D8414
D8415
D8416
The ladder code for setting the Slave parameters can be expressed as follows:
Program for setting up a MODBUS Slave
b15
MODBUS Serial
Communication Setup
M8411
MOV
H1097
D8400
The communication
format is set.
b0
H11
D8401
b0
K10
D8411
MOV
H1
D8414
D8415
The Communication
Status Information
Setup *1 is set.
b15
MOV
H11
b0
K100
D8416
36
Outline
5.3
5 Communication Setup
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.
Program for setting up N:N Networking
K0
D8176
Specifications
N:N Networking
Setup on Channel 1
M8038
MOV
3
D8177
MOV
K0
D8178
MOV
K3
D8179
MOV
K5
D8180
4
Wiring
K2
System
Configuration
MOV
5
Communication
Setup
H1097
D8420
The communication
format is set.
b0
Related
Devices and
Comm. Status
26
MODBUS Serial
Communication
Setup on Channel 2
M8411
MOV
b0
MODBUS
Standard
Commands
MOV
H11
K10
D8431
MOV
H1
D8434
Master
Specification
MOV
K100
D8435
D8436
b0
10
Creating
Programs
MOV
H11
b15
Slave
Specification
MOV
The Communication
Status Information
Setup*1 is set.
37
5.4
5 Communication Setup
5.4 Cautions on Communication Setup
38
1
Outline
6.
6.1
The table shows the Special Data registers used in MODBUS serial communication.
CH1
Name
Valid
Communication
Format
Master
/Slave
Detailed description
R/W
CH2
D8400 D8420
Contents
0 (bit = OFF)
Protocol
Selection
b1-3
Not used
b4
Master/ slave
MODBUS Master
setting
b5-7
Not used
b8
RTU/ASCII
RTU
mode setting
b9-15
Not used
R,W*1
ASCII*2
Related
Devices and
Comm. Status
b0
1 (bit = ON)
Communication
Error Code
Master
Special clear conditions:
/Slave
1) Power on
2) STOP to RUN (master only)
R,W
R,W
D8404 D8424
Error step
number
Slave
Specification
Master
Specification
MODBUS
Standard
Commands
Communication
Setup
Master
/Slave
Name
4
Wiring
R,W*1
System
Configuration
Special Data
Register
2
Specifications
In this section the device numbers and functions of the special data registers and special auxiliary relays are
described for MODBUS serial communication.
R,W
10
Creating
Programs
Note: If the step number is greater than 32767 the value will
become a negative number. To see the step numbers
above 32767 the user must convert the step number to
an unsigned value.
39
Special Data
Register
CH1
Name
Valid
Detailed description
R/W
CH2
Communication
D8405 D8425 Format
Display
Master
This device stores the communication format set in the PLC.
/Slave
ASCII Input
D8406 D8426
Delimiter*2
R,W
D8407 D8427
Step Number
Being Executed
Note: If the step number is greater than 32767 the value will
become a negative number. To see the step numbers
above 32767 the user must convert the step number to
an unsigned value.
The current value of retries that the master is sending to
process the request.
D8408 D8428
D8409 D8429
Current Retry
Value
Slave Response
Master
Timeout
40
1
CH1
Name
Valid
Detailed description
R/W
Outline
Special Data
Register
CH2
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.
This delay allows the slaves to process the broadcast message
and prepare the reception of the next request.
2
Specifications
Turn Around
Delay
Master
R,W
4
Wiring
5
Communication
Setup
Message to
Message delay
Master Note 1:The Turn Around delay and Message to Message delay
/Slave
must be set for the slowest slave in the network.
R,W
Master
R,W*1
R,W*1
Slave
Specification
D8414 D8434
8
Master
Specification
Number Of
Retries
7
MODBUS
Standard
Commands
D8412 D8432
6
Related
Devices and
Comm. Status
3
System
Configuration
10
Creating
Programs
41
Special Data
Register
CH1
Name
Valid
Detailed description
R/W
CH2
Defines the device range that is used to store the
communication state (event & error counter and/or event log).
Bit No.
Communication
Status
D8415 D8435 Information
Master
/Slave
Name
Contents
0 (bit = OFF)
1 (bit = ON)
b0
b1-b3
Not used
b4
Event log
*Slave Only
b5-7
Not used
b8
Communication
status storage D-register
device type
b9-b15
Not used
Setup*2
R,W*1
R-register
One MODBUS event is one byte so one 16 bit register will hold
two events. For further details refer to Subsection 9.5.1.
Note: For "Event and error counter" and "Event log" details,
refer to Section 6.4.
Defines the PLC head device address of the device block that
will store the communication status information.
Counter values occupy 10 devices and the event log requires
33 devices. Therefore if both are displayed a total of 43 devices
are required.
According to these rules, the maximum valid range will be:
Communication
D8416 D8436 Status Device
Range Setup*2
For D:
Master
Counter only: 0-7990 (i.e. D8415 / D8435 = 01H)
/Slave
Log only: 0-7967 (i.e. D8415 / D8435 = 010H)
Log and counter: 0-7957 (i.e. D8415 / D8435 = 011H)
R,W*1
For R:
Counter only: 0-32758 (i.e. D8415 / D8435 = 0101H)
Log only: 0-32735 (i.e. D8415 / D8435 = 0110H)
Log and counter: 0-32725 (i.e. D8415 / D8435=0111H)
Note: If the above mentioned rule is violated neither counter
nor event log is stored and an error is generated.
D8417 D8437 Not used
D8063 D8438
Communication
Error Code
42
R,W*1
1
CH1
Name
Valid
Detailed description
R/W
Outline
Special Data
Register
CH2
Communication
Mode
2
R
3
System
Configuration
10: CF-ADP*2
D8470
D8471
D8478
D8479
R: Read
MODBUS
Device
Mapping 5*2
MODBUS
Device
Mapping 6*2
MODBUS
Device
Mapping 7*2
MODBUS
Device
Mapping 8*2
5
R,W*1
R,W*1
R,W*1
R,W*1
R,W*1
R,W*1
W: Write
Values must be written to these Device registers using the MODBUS configuration block using
M8411. For details refer to Section 9.4.
*2.
10
Creating
Programs
*1.
9
Slave
Specification
D8484
D8485
MODBUS
Device
Mapping 4*2
R,W*1
Master
Specification
D8482
D8483
MODBUS
Device
Mapping 3*2
MODBUS
Standard
Commands
D8480
D8481
MODBUS
Device
Mapping 2*2
Related
Devices and
Comm. Status
D8476
D8477
Mapping 1
R,W*1
Communication
Setup
D8474
D8475
*2
Wiring
D8472
D8473
MODBUS
Device
Specifications
D8419 D8439
43
6.2
Bit No.
b0
Data
Contents
0 (bit = OFF)
1 (bit = ON)
7-bit
8-bit
length*1
b1
b2
Parity
b3
Stop bit
b4
b5
b6
b7
Parity
b2, b1
(0, 0): Not provided
(0, 1): Odd
(1, 1): Even
1-bit
b7, b6, b5, b4
(0, 0, 1, 1): 300
(0, 1, 0, 0): 600
(0, 1, 0, 1): 1200
(0, 1, 1, 0): 2400
2-bit
b7, b6, b5, b4
(1, 0, 1, 1): 57600
(1, 1, 0, 0): Reserved
(1, 1, 0, 1): 115200
b8 -11
Reserved
b12
H/W type
RS232C
RS485
b13-15
Reserved
*1.
44
Name
Please set data length as 8 bits for of RTU mode. In the case of 7 bits, there is a possibility that data
may be missing.
Outline
6.3
The table shows the Special Auxiliary Relays used for MODBUS serial communication.
Special Device
CH2
Name
MODBUS
Configuration
Request Flag
M8411
Valid
Master
/Slave
Detailed Description
LD M8411 can be used to trigger a set of subsequent
MOV commands that initialize the MODBUS function.
R/W
R, W
M8421
MODBUS
Request in
Process
Master
4
Wiring
M8401
Master
M8423
M8438
MODBUS
Communication
Error
MODBUS
Communication
Error (latched)
Master
/Slave
0: Normal processing
1: Listen only mode
Special clear conditions:
1) Power on
2) Reception of a restart command from the master
M8424
Listen Only
Mode*1
Slave
9
Slave
Specification
8
Master
Specification
M8404
7
MODBUS
Standard
Commands
6
Related
Devices and
Comm. Status
M8403
M8063
M8422
Communication
Setup
System
Configuration
Command
Execution
Complete
M8029
2
Specifications
CH1
10
Creating
Programs
45
Special Device
CH1
CH2
Name
Valid
Detailed Description
R/W
M8408
M8428
Retry
Master
M8409
M8429
Timeout
Master
R: Read
*1.
46
W: Write
Communication status
Outline
6.4
The following table shows the communication status of the event and error counters and the communication
event log data for the following scenario:
D8415 = 11H - i.e. store event counter and event log into D devices
D8416 = 100 - i.e. head device is set to D100
Head Device
(D100)*1
Bus Message
Counter
Bus Communication
Error Counter
Valid
Details
Number of messages that a remote node has
Master detected on the bus.
/Slave Note: Messages with false CRC/LRC are not taken
into account.
This counter is incremented if one of the following
errors occur:
Master CRC/LRC mismatch
/Slave Bit-level error (overrun, parity error)
Received telegram length is <= 3 characters
(RTU) or <= 8 characters (ASCII)
R/W
R
4
R
Slave Message
Counter
Slave
Head Device + 4
Slave No Response
Counter
Slave
Slave
Slave
(D104)
*1
Head Device + 5
(D105)*1
Head Device + 6
(D106)*1
Character Overrun
Counter
Head Device + 8
(D108)*1
Event counter
Head Device + 9
Head Device + 10
(D110)*2
Head Device + 11 to 42
Event Log
(D111-D142)*2
7
R
8
R
R
R
10
Creating
Programs
R: Read
W: Write
*1. Event and Error counters
*2. Communication event log
9
Slave
Specification
(D109)
Not used
Master
Specification
Head Device + 7
(D107)*1
MODBUS
Standard
Commands
Head Device + 3
(D103)*1
Master
Slave: Number of exception conditions detected by
/Slave
the remote node including exceptions
caused by broadcast messages (In this
case no exception response is sent).
Related
Devices and
Comm. Status
Exception Error
Counter
Communication
Setup
Head Device + 2
(D102)*1
Wiring
Head Device + 1
(D101)*1
Description
3
System
Configuration
Device
2
Specifications
For Slave devices, the event and error counters will be cleared when: the communication is reset, a counter
reset command is received, at power ON and when the PLC is switched from STOP to RUN.
47
7.
7.1
Command Name
Details
Accessible
Devices per
Message
Broadcast
Reference
0x01
Read Coils
1 to 2000
points
Section 7.4
0x02
Read Discrete
Inputs
1 to 2000
points
Section 7.5
0x03
Read Holding
Registers
1 to 125
points
Section 7.6
0x04
Read Input
Registers
1 to 125
points
Section 7.7
0x05
1 point
Section 7.8
0x06
Write Single
Register
1 point
Section 7.9
0x07*1
Read Exception
Status
Read 1 byte of
vendor specified
data
Section 7.10
0x00
Loop back
function
Subsection
7.11.1
0x01
Restart
Communication
Option
Restart
communication/
Remote
Communication
Reset
Subsection
7.11.2
0x02
Return Diagnostic
Register
Read 16 bit
register of vendor
specified data
Subsection
7.11.3
0x03
Change ASCII
Change ASCII Input mode End of
Delimiter
Message
character
Subsection
7.11.4
0x04
Switch slave to
Listen Only Mode
Subsection
7.11.5
0x0A
Subsection
7.11.6
0x0B
Return Bus
Message Count
Read number of
detected
messages
Subsection
7.11.7
0x08
Diagnosis*1
48
Subcommand
Code
1
Command Name
Details
Accessible
Devices per
Message
Broadcast
Reference
0x0C
Return Bus
Communication
Error Count
Read number of
detected
communication
errors
Subsection
7.11.8
0x0D
Return Bus
Exception Error
Count
Read number of
detected
exception
conditions
Subsection
7.11.9
0x0E
Return Slave
Message Count
Read number of
received requests
Subsection
7.11.10
0x0F
Return Slave No
Response Count
Read "No
Response"
counter of the
slave
Subsection
7.11.11
System
Configuration
0x10
Read NAK
counter of the
slave
Subsection
7.11.12
0x11
Read "Busy"
counter of the
slave
Subsection
7.11.13
0x12
Return Bus
Character Overrun
Count
Read "Bus
Character
Overrun" counter
of the slave
Subsection
7.11.14
Section 7.12
0x0C*1
Read
Get Communication
communication
Event Log
event log
Section 7.13
0x0F
Write multiple
binary (R/W)
devices
1 to 1968
points
Section 7.14
0x10
Write Multiple
Registers
Write multiple 16
bit (R/W) registers
1 to 123
points
Section 7.15
0x11*1
Report Slave ID
Read Slave ID
code data
Section 7.16
0x16*1
Manipulate slave
Mask Write Register register with AND
Mask / OR Mask
1 point
Section 7.17
0x17*1
Read/Write
Read/Write Multiple
multiple 16 bit
Registers
(R/W) registers
Section 7.18
Master
Specification
*1.
Read:1 to
125 points
Write:1 to
121 points
Wiring
MODBUS
Standard
Commands
Related
Devices and
Comm. Status
Read
Get Communication
communication
Event Counter
event counter
5
Communication
Setup
0x0B*1
2
Specifications
0x08
Diagnosis*1
Subcommand
Code
Outline
Command
Code
9
Slave
Specification
10
Creating
Programs
49
Subcommand
Code
0x01
Command Name
Read Coils
Reference
Section 7.4
0x02
Section 7.5
0x03
Section 7.6
0x04
Section 7.7
0x05
Section 7.8
0x06
Section 7.9
0x07
Section 7.10
0x00
Subsection
7.11.1
0x01
Subsection
7.11.2
0x02
Subsection
7.11.3
0x03
Subsection
7.11.4
0x04
Subsection
7.11.5
0x0A
Subsection
7.11.6
0x0B
Subsection
7.11.7
0x0C
Subsection
7.11.8
0x0D
Subsection
7.11.9
0x0E
Subsection
7.11.10
0x0F
Subsection
7.11.11
0x10
Subsection
7.11.12
0x11
Subsection
7.11.13
0x12
Subsection
7.11.14
0x08
Diagnosis
0x0B
Section 7.12
0x0C
Section 7.13
0x0F
Section 7.14
0x10
Section 7.15
0x11
Report Slave ID
Section 7.16
0x16
Section 7.17
0x17
Section 7.18
50
FX3G/FX3GC FX3U/FX3UC
FX3G/FX3GC FX3U/FX3UC
RTU
ASCII
Frame Specifications
Outline
7.2
The following shows the frame specifications for the MODBUS protocol.
Address field
Function code
Data
Error check
2
Specifications
The following table details the frame specification for the MODBUS Protocol.
Area name
Description
Address field
Note: 247 is the MODBUS maximum address number. The FX3U MODBUS Master can
address from 1 to 32 stations within this range.
4
Wiring
System
Configuration
Error check *1
*1.
The node adds the check code automatically to all transmitted messages and
recalculates the check code for any received message. The received message is
discarded if it has an error.
The error check method differs depending on the frame mode. See Subsection 7.2.1.
6
Related
Devices and
Comm. Status
5
Communication
Setup
7
MODBUS
Standard
Commands
Note
Refer to the Subsection 7.2.1 for the data size of each area.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
51
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.
1) Available frame modes
a) RTU mode
In this mode, frames are received or sent in binary codes.
The frame specifications are compliant with the MODBUS protocol specifications.
Start
3.5 character
time or more
Address field
1 byte
Function code
1 byte
Data
Error check
END
(Start)
Address field
0 to 252
bytes
2 bytes
3.5 character
time or more
1 byte
Note
The Cyclical Redundancy Checking (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 results.
A procedure for generating a CRC is:
1) Load a 16-bit register with FFFF hex (all 1s). 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 LSB), zero-filling the MSB (Most Significant bit).
Extract and examine the LSB (Least Significant bit).
4) (If the LSB was 0): Repeat Step 3 (another shift).
(If the LSB was 1): Exclusive OR the CRC register with the polynomial value 0xA001 (1010 0000 0000
0001).
5) Repeat Steps 3 and 4 until 8 shifts have been performed. 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 into the message, its upper and lower bytes must be switched as described
below.
52
1111
1111
02H(Station No.)
Exclusive OR (XOR)
1111
1111
Carry Flag
1111
1111
0000
0010
1111
1101
0111
1111
1111
1110
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1101
1111
1111
1111
2
1
Shift2
0110
1111
1111
1111
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1100
1111
1111
1110
Shift3
0110
0111
1111
1111
Shift4
0011
0011
1111
1111
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1001
0011
1111
1110
Shift5
0100
1001
1111
1111
Shift6
0010
0100
1111
1111
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1000
0100
1111
1110
Shift7
0100
0010
0111
1111
Shift8
0010
0001
0011
1111
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1000
0001
0011
1110
0000
0111
Exclusive OR (XOR)
1000
0001
0011
1001
Shift 1
0100
0000
1001
1100
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1110
0000
1001
1101
Shift2
0111
0000
0100
1110
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1101
0000
0100
1111
Shift3
0110
1000
0010
0111
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1100
1000
0010
0110
Shift4
0110
0100
0001
Shift5
0011
0010
0000
Generator polynomial
1010
0000
0000
0001
Exclusive OR (XOR)
1001
0010
0000
1000
Shift6
0100
1001
0000
0100
Shift7
0010
0100
1000
0010
Shift8
0001
0010
0100
0001
6
1
7
1
0011
1001
8
Master
Specification
9
Slave
Specification
41H
10
(12H)
Creating
Programs
(07H)
Wiring
(02H)
Function code
MODBUS
Standard
Commands
Address field
Related
Devices and
Comm. Status
12H
Communication
Setup
CRC value
System
Configuration
07H(Function)
Specifications
Shift 1
Outline
The following is a calculation example in the case where function code 07H is sent to station No. 2.
53
b) ASCII mode
The ASCII mode is available only in FX3U and FX3UC PLCs.
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
:
(3AH)
2 bytes
Function code
2 bytes
Data
n x 2 bytes
(n = 0 to 252)
Error check
2 bytes
END
CR + LF
(0DH) (0AH)
Note
The Longitudinal Redundancy Checking (LRC) field is one byte, containing an 8-bit binary value. The LRC
value is calculated by the transmitting device, which appends the LRC to the message. The device that
receives recalculates an LRC during receipt of the message, and compares the calculated value to the actual
value it received in the LRC field. If the two values are not equal, an error results.
A procedure for generating an LRC is:
1) Add all bytes in the message, excluding the starting colon and ending CRLF. Add them into an 8-bit field,
so that carries will be discarded.
2) Subtract the final field value from FF hex (all 1s), to produce the ones-complement.
3) Add 1 to produce the twos-complement.
4) For a transmit frame the LRC is calculated before converting to ASCII.
54
1
Outline
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
0000
0010
01
0000
0001
00
0000
0000
00
0000
0000
00
0000
0000
08
+0000
1000
Addition result
0B
0000
1011
Bit reversal 1
F4
1111
0100
2's complement
F5
1111
0101
F5
+1
2
Specifications
02
Function code
3
System
Configuration
4
Wiring
Start
:
Address field
(02H)
Function code
(01H)
(00H)
30H
32H
30H
31H
30H
30H
30H
30H
(00H)
30H
30H
(08H)
30H
38H
LRC
(Error check)
(F5H)
"CR"
"LF"
46H
0DH
0AH
35H
5
Communication
Setup
3AH
(00H)
Read points
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
55
7.3
56
1
Outline
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.
Area name
Read points
(0001H to 07D0H )
(L)
(H)
1 byte (8 bits). . .
(L)
(H)
System
Configuration
Specifications
Function
code
(01H)
Frame contents
Data
Function code
4
Wiring
For use in ASCII mode, convert the values into ASCII codes.
(Conversion example)
(RTU mode)
Function
code
(01H)
Communication
Setup
Data
Function code
(H)
Read points
(003FH)
(H)
(L)
(L)
Related
Devices and
Comm. Status
(H)
(L)
0
(30 H )
6
(36H)
MODBUS
Standard
Commands
Function code
1
0
(31H)
(30 H)
Data
Data
Function code
Read points
E
(45H)
0
(30 H)
(L)
(H)
0
(30H)
3
(33H)
F
(46H)
(L)
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
57
7.4
Function code
Function
code
(01H)
Read points
(0001H to 07D0H)
(L)
(H)
(L)
(H)
Function code
Function
code
(01H )
Number of
read bytes
n
Device data
1
Device data
n
(Device data 1 to n)
b7
b6
b5
b4
b3
b2
b1
b0
Device data 1
Bit device
storage order
Device data n
0 : OFF
1 : ON
The read coil statuses are stored in order from low-order to high-order bits.
When the number of read points is not a multiple of 8, the excess bits turn to 0.
Data
Exception
code*1
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
58
Outline
7.5
Function
code
(02 H)
Specifications
Function code
Data
Head input number
(0000 H to FFFFH)
Read points
(0001H to 07D0H)
(H)
(H)
(L)
(L)
System
Configuration
Function code
Number of
read bytes
n
Device data
1
Wiring
Function
code
(02 H)
4
Device data
n
5
Communication
Setup
(Device data 1 to n)
b7
b6
b5
b4
b3
b2
b1
b0
Device data 1
6
Related
Devices and
Comm. Status
Bit device
storage order
Device data n
0 : OFF
1 : ON
7
MODBUS
Standard
Commands
The read input statuses are stored in order from low-order to high-order bits.
When the number of read points is not a multiple of 8, the excess bits turn to 0.
Exception
code*1
Master
Specification
Function
code
(82 H)
Data
9
Slave
Specification
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
10
Creating
Programs
59
7.6
Function code
Function
code
(03 H)
Read points
(0001H to 007DH)
(L)
(H)
(L)
Function code
Function
code
(03 H)
Number of
read bytes
m = n x 2*1
. . .
Device data
1
(H)
Device data
n
(H)
(L)
(L)
Data
Exception
code *2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
60
Outline
7.7
Function
code
(04 H)
Specifications
Data
Function code
Read points
(0001H to 007DH)
(H)
(L)
(L)
System
Configuration
Function code
Number of
read bytes
m = n x 2* 1
Device data
1
(H)
(L)
. . .
Device data
n
(H)
(Number of read bytes n x 2)
Wiring
Function
code
(04 H)
(L)
5
Communication
Setup
Related
Devices and
Comm. Status
Function
code
(84 H)
Data
Exception
code * 2
7
MODBUS
Standard
Commands
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
61
7.8
Function code
Function
code
(05 H)
ON/OFF specification
Coil number
(0000 H to FFFFH)
(H)
0000 H : OFF
FF00 H : ON
(L)
(H)
(L)
Data
Exception
code*1
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
62
Outline
7.9
Data
Holding register number
(0000 H to FFFFH)
Write data
(0000 H to FFFFH)
(H)
(L)
(H)
Specifications
Function
code
(06 H)
(L)
System
Configuration
Function
code
(86 H)
Wiring
Function code
Data
Exception
code*1
5
Communication
Setup
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
63
7.10
Data
Function
code
(07 H)
Error
information*1
Data
Exception
code *2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
64
Outline
7.11
Executes the various diagnostics and checks the FX-Series MODBUS Communication ADP.
Available only in FX3U and FX3UC PLCs.
Specifications
Function
code
(08 H)
Sub-function code
(0000 H)
(H)
3
Data
System
Configuration
Function code
Arbitrary data
(L)
Wiring
Function
code
(88 H)
Communication
Setup
Function code
Data
Exception
code*1
6
Related
Devices and
Comm. Status
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
65
Clears the data when the communications event log clear is specified in the request message.
Sub-function code
Function
code
(08 H)
Sub-function code
(0001 H)
(H)
(L)
Data
Clear setting of
Communications event log
0000 H: Do not clear
FF00 H: Clear
(L)
(H)
Data
Exception
code*2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
66
1
Outline
Function
code
(08 H)
Sub-function code
Data
Sub-function code
(0002 H)
(H)
Specifications
Function code
(0000 H)
(L)
(H)
(L)
System
Configuration
Data
Sub-function code
(0002 H)
(H)
Diagnostic register
value
(L)
Wiring
Function
code
(08 H)
Sub-function code
(L)
(H)
M8060-M8062,M8438, M8064-M8067
(When using CH2 for MODBUS communication)
*1. When using 3rd party products. The high byte (H) does not equal 00H. For further information on the
specifications for the slave refer to Chapter 9.
Data
Exception
code*2
MODBUS
Standard
Commands
Function
code
(88 H)
6
Related
Devices and
Comm. Status
5
Communication
Setup
M8060-M8067
(When using CH1 for MODBUS communication)
00H
(FX3U/FX3UC)*1
8
Master
Specification
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
9
Slave
Specification
10
Creating
Programs
67
Address field
:
(3AH)
2 characters
Function code
Data
Error check
END
2 characters
n x 2 characters
(n = 0 to 252)
2 characters
CR + LF
(0DH) (0AH)
Sub-function code
Function
code
(08 H)
Sub-function code
(0003 H)
Data
Input delimiter
setting
(00 H to FFH)
(00 H)
(L)
(H)
Note
(0x3A), "0"-"9" (0x30-0x39), "A"-"F" (0x41-0x46) and "a"-"f" (0x61-0x66) should not be used as they might
occur within the message and cause false end of frame detection.
2) 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)
Function code
Data
Function
code
(88 H)
Exception
code*1
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
68
1
Outline
When FX-Series MODBUS Communication ADP is set in the listen only mode, the status is as follows:
Specifications
Ignores all request messages except for those of restart communications option (Refer to Subsection
7.11.2).
Stops counting of the diagnostic counter (Refer to Chapter 6).
Continues recording with the communications event log (Refer to Section 9.5).
Function code
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(0004 H)
(0000 H)
4
Wiring
(H)
(L)
(H)
System
Configuration
(L)
5
Communication
Setup
Exception
code*1
Note
1) Whether the FX-Series MODBUS Communication ADP has been switched to listen only mode or not is
indicated by M8404/M8424.
8
Master
Specification
2) The listen only mode can be changed to online mode by either of the following:
- Restart communications option (Refer to Subsection 7.11.2)
- Power OFF ON
7
MODBUS
Standard
Commands
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
Related
Devices and
Comm. Status
Function
code
(88 H)
Data
9
Slave
Specification
10
Creating
Programs
69
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(000A H)
(0000 H)
(L)
(H)
(H)
(L)
Data
Exception
code*1
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
70
1
Outline
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(000B H)
(0000 H)
(L)
(H)
Specifications
Function code
(L)
(H)
System
Configuration
Data
Sub-function code
(000B H)
(H)
(L)
(H)
Wiring
Function
code
(08 H)
Sub-function code
(L)
5
Communication
Setup
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Exception
code * 2
Related
Devices and
Comm. Status
Function
code
(88 H)
Data
7
MODBUS
Standard
Commands
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
71
Sub-function code
Data
Sub-function code
(000CH)
(H)
(0000 H)
(L)
(L)
(H)
Sub-function code
Data
Sub-function code
(000CH)
(H)
Bus communication
error count value
(0000 H to FFFFH) *1
(L)
(H)
(L)
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Function
code
(88 H)
Data
Exception
code *2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
72
1
Outline
Function
code
(08 H)
Sub-function code
Data
Sub-function code
(000DH)
(0000 H)
(L)
(H)
Specifications
Function code
(L)
(H)
System
Configuration
Data
Sub-function code
(000DH)
(H)
4
Wiring
Function
code
(08 H)
Sub-function code
(L)
(H)
(L)
5
Communication
Setup
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Exception
code *2
Related
Devices and
Comm. Status
Function
code
(88 H)
Data
7
MODBUS
Standard
Commands
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
73
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(000E H)
(0000 H)
(L)
(H)
(L)
(H)
Sub-function code
Function
code
(08 H)
Sub-function code
(000E H)
Data
Slave message count value
(0000 H to FFFFH) * 1
(L)
(H)
(H)
(L)
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Function
code
(88 H)
Data
Exception
code * 2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
74
1
Outline
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(000F H)
(0000 H)
(H)
(L)
(H)
Specifications
Function code
(L)
System
Configuration
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(000F H)
(L)
Wiring
(H)
4
(L)
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
Communication
Setup
Exception
code *2
Related
Devices and
Comm. Status
Function
code
(88 H)
Data
7
MODBUS
Standard
Commands
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
75
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(0010 H)
(0000 H)
(H)
(L)
(L)
(H)
Sub-function code
Function
code
(08 H)
Sub-function code
(0010 H)
Data
Slave NAK count value
(0000 H) * 1
(L)
(H)
(H)
(L)
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Function
code
(88 H)
Data
Exception
code *2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
76
1
Outline
Data
Function
code
(08 H)
Sub-function code
(0011 H)
(0000 H)
(L)
(H)
System
Configuration
(L)
(H)
Specifications
Function code
Function
code
(08 H)
Sub-function code
(0011 H)
(L)
(H)
Data
Wiring
Function code
(H)
(L)
5
Communication
Setup
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
6
Related
Devices and
Comm. Status
Function
code
(88 H)
Data
Exception
code *2
7
MODBUS
Standard
Commands
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
77
Sub-function code
Data
Function
code
(08 H)
Sub-function code
(0012 H)
(0000 H)
(L)
(H)
(L)
(H)
Sub-function code
Function
code
(08 H)
Sub-function code
(0012 H)
(H)
Data
Bus character overrun
count value
(0000 H to FFFFH) * 1
(L)
(H)
(L)
*1. Refer to Chapter 6 for the relevant counts, count clear methods and precautions.
(When completed with an error)
Function code
Function
code
(88 H)
Data
Exception
code *2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
Note
Refer to Subsection 7.2.1 for details on the size of request messages.
78
Users Manual - MODBUS Serial Communication Edition 7.12 Get Communications Event Counter (Command Code: 0x0B)
Outline
7.12
Acquires the number of messages whose requested actions (read/write, diagnostics, etc.) have been
normally completed.
Available only in FX3U and FX3UC PLCs.
Note
Specifications
Function
code
(0B H)
System
Configuration
Function code
Wiring
Function
code
(0B H)
Data
Program command status
(0000 H) * 1
(L)
(H)
(L)
*1. Since the FX-Series MODBUS Communication ADP does not support any program commands,
0000H is stored.
6
Related
Devices and
Comm. Status
Communication
Setup
(H)
Communications
event count value
(0000 H to FFFFH) *2
7
MODBUS
Standard
Commands
Note
The communications event counter counts only when the processing (read/write, diagnostics, etc.) has
completed normally.
The communications event counter does not count in the case of the following:
The processing has completed with an error.
8
Master
Specification
When receiving a request message containing a function code that the FX-Series MODBUS
Communication ADP does not support.
When receiving the Get communications event counter (Command Code: 0x0B).
(When completed with an error)
Function code
Slave
Specification
Function
code
(8B H)
Data
Exception
code *3
10
79
Creating
Programs
*3. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
7.13
Data
Number of
read bytes
Program command
status
(0000 H) *1
(H)
Communications event
count value
(0000 H to FFFFH) *2
(H)
(L)
(L)
(H)
(Number of read bytes)
Communications
event log No. 63
(L)
*1. Since the FX-Series MODBUS Communication ADP does not support any program commands,
0000H is always stored.
*2. Refer to the following for the relevant counts, count clear methods and precautions.
Refer to Section 7.12.
*3. Refer to the following for the relevant counts, count clear methods and precautions.
Refer to Chapter 6.
*4. For information on the Communication Event Log and Communication event log Timing and
Communication event log Format refer to Section 9.5.
(When completed with an error)
Function code
Function
code
(8C H)
Data
Exception
code *5
*5. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
80
Outline
7.14
Function
code
(0F H)
Specifications
Function code
Data
Write points*1
(0001H to 07B0 H)
(H)
(L)
Number of
bytes n*1
(0001H to
00F6 H)
Device
data
1
. . .
Device
data
n
(L)
(H)
System
Configuration
(Number of bytes n)
b6
b5
b4
b3
b2
b1
b0
Wiring
(Device data 1 to n )
b7
Device data 1
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.
MODBUS
Standard
Commands
Function
code
(0F H)
Data
Function code
Write points
(The same write points
value as in the request
message is stored.)
(L)
(H)
8
Master
Specification
Data
Exception
code*2
Slave
Specification
Function
code
(8F H)
6
Related
Devices and
Comm. Status
*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).
Communication
Setup
0 : OFF
1 : ON
81
10
Creating
Programs
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
7.15
Function code
Function
code
(10 H)
Head holding
register number
(0000 H to FFFFH)
(H)
(L)
Write points
n *1
(0001 H to 007BH)
Number of
bytes, n x 2 *1
(0002H to
00F6 H)
Device
data
1
(L)
(H)
(H)
Device
data
n
. . .
(L)
(H)
(L)
(Number of bytes n x 2)
*1. The number of the specified write points must be matched with the number of bytes.
2) Response message format (Slave Master)
(When completed normally)
Function code
Function
code
(10 H)
Data
Head holding register number
(The value same as in the
request message is stored.)
(H)
Write points
(The value same as in the
request message is stored.)
(L)
(H)
(L)
Data
Exception
code * 2
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
82
Outline
7.16
Acquires the information of the slave (FX-Series MODBUS Communication ADP) mounted station into the
master.
Available only in FX3U and FX3UC PLCs.
Specifications
3
System
Configuration
4
Data
Number of
bytes
(02 H)
PLC CPU
type
(F3H)
Wiring
Function
code
(11 H)
PLC CPU
STOP/RUN
state
5
Communication
Setup
00H: STOP
FFH: RUN
Exception
code*1
MODBUS
Standard
Commands
Function
code
(91 H)
Data
6
Related
Devices and
Comm. Status
The slave (FX-Series MODBUS Communication ADP) will return 'F3' as the PLC CPU type data to the
Master:
8
Master
Specification
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
9
Slave
Specification
10
Creating
Programs
83
7.17
Data
Target holding register
number
(0000 H to FFFFH)
(H)
(L)
(L)
OR mask value
(0000 H to FFFFH)
(H)
(L)
Data
Exception
code*1
*1. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
84
Outline
7.18
2
Specifications
Data
Write
device data
1
(H)
. . .
Write
device data
m
(H)
(L)
3
System
Configuration
(L)
(Number of bytes m x 2)
4
Wiring
*1. The number of the specified write points must be matched with the number of bytes.
2) Response message format (Slave Master)
(When completed normally)
Function code
Number of
bytes
nx2
Read
device data
1
(H)
5
Read
device data
n
. . .
(L)
(H)
Communication
Setup
Function
code
(17 H)
Data
(L)
(Number of bytes n x 2)
6
Related
Devices and
Comm. Status
Function code
(97 H)
Exception
code *2
7
MODBUS
Standard
Commands
Function code
8
Master
Specification
*2. Exception and error codes are stored in special data registers and special auxiliary relays in the case
of error completion. Refer to Chapter 6 for storage location, confirmation methods, and other detailed
contents.
9
Slave
Specification
10
Creating
Programs
85
8.
8 Master Specification
8.1 MODBUS Master Command List
Master Specification
This chapter explains the MODBUS Master functions supported by the FX-Series MODBUS
Communication ADP.
8.1
Subcommand
Code
Details
0x01
Read Coils
0x02
0x03
0x04
0x05
0x06
0x07*1
0x00
0x01
0x02
0x03
0x04
0x0A
0x0D
0x0E
0x0F
0x10
0x0B
0x08
Diagnosis*1 0x0C
0x0B*1
0x0C
*1
0x11
0x12
0x0F
0x10
0x11*1
Report Slave ID
0x16*1
0x17*1
*1.
86
Command Name
8 Master Specification
8.2.1
Outline
Outline
8.2
1) Instruction Format
16-bit Instruction
Mnemonic
Operation Condition
Operation Condition
Continuous
Operation
11 steps ADPRW
System
Configuration
FNC 276
ADPRW
2) Set Data
Operand Type
Description
Data Type
16-bit binary
S1
Command Code
16-bit binary
S2
16-bit binary
S3
16-bit binary
Wiring
S4
Operand Type
Word Devices
System User
Digit Specification
System User
Others
Special
Unit
Z Modify K H
S 3
3 3
S1
S 3
3 3
S2
S 3
3 3
S3
S 3
3 3
S 3
3 3
3 3 S
""
7
MODBUS
Standard
Commands
S: Except special auxiliary relay (M) and special data register (D)
8.2.2
6
Related
Devices and
Comm. Status
S4
ConReal CharacPointer
stant Number ter String
Index
Communication
Setup
3) Applicable Devices
Bit Devices
Specifications
This instruction allows the MODBUS Master to communicate (read/write data) with its associated Slaves.
Command
input
(normally ON)
Command
code
S1
Command Code
Parameters
S2
S3
S4 / D
Slave
Specification
FNC276
ADPRW
Slave
Node
Address
Master
Specification
Command Parameters
depending on the
Command Code
(See Section 8.3)
Command Code
(See Section 8.3)
10
Creating
Programs
87
8.3
8 Master Specification
8.3 ADPRW Command Parameters
S2
S3
:
:
Device Address/
Device Count/Sub-command
Sub-command Code
Data/AND Mask
S4
/ D
:Source Data /
Destination PLC Device/OR Mask
1H
Read Coils
MODBUS Address:
Device Count:1~2000
0000H~FFFFH
Applicable
Devices
Block Length
D R M Y S
indexing
( S3
+ 15)16
MODBUS Address:
Device Count:1~2000
0000H~FFFFH
Applicable
Devices
Block Length
D R M Y S
indexing
( S3
+ 15)16
MODBUS Address:
Device Count:1~125
0000H~FFFFH
Applicable
Devices
Block Length
D R indexing
S3
MODBUS Address:
Device Count:1~125
0000H~FFFFH
Applicable
Devices
Block Length
D R indexing
S3
MODBUS Address:
Applicable
Devices
0 (fixed)
0000H~FFFFH
Block Length
6H
Write Single
Register
7H
Read Exception
Applicable
Devices
0 (fixed)
0000H~FFFFH
Block Length
D R K H
indexing
1 Point
Applicable
Devices
0 (fixed)
State
Block Length
Sub-command Code:
0H~4H AH~12H
D R indexing
1 Point
-
8H
Sub-function: 0H
Loop-back Test
Sub-function Data
(loop-back data):
0~65535
88
1 Point
MODBUS Address:
*1
Diagnosis*1
DRKHMX
Y S indexing
0 = bit OFF
1 = bit ON
D R indexing
1 Point
8 Master Specification
8.3 ADPRW Command Parameters
1
S2
S3
:
:
Device Address/
Device Count/Sub-command
Sub-command Code
Data/AND Mask
S4
/ D
:Source Data /
Destination PLC Device/OR Mask
S3
D R indexing
1 Point
Applicable
Devices
Block Length
D R indexing
1 Point
Block Length
0 (fixed)
Applicable
Devices
1 Point
D R indexing
1 Point
D R indexing
1 Point
D R indexing
1 Point
Applicable
Devices
Block Length
Applicable
Devices
Block Length
D R indexing
1 Point
D R indexing
1 Point
Slave
Specification
Sub-function: FH
Return Slave No
Response Counter
D R indexing
Master
Specification
Sub-function: DH
Return Bus Exception 0 (fixed)
Error Counter
MODBUS
Standard
Commands
Sub-function: CH
Return Bus
0 (fixed)
Communication Error
Counter
S3
Related
Devices and
Comm. Status
Sub-function: BH
Return Bus Message 0 (fixed)
Counter
Block Length
Sub-function: EH
Return Slave
Message Counter
D R indexing
Communication
Setup
4
Wiring
Sub-function: 4H
Force Listen Only
Mode
3
System
Configuration
Sub-function: 2H
Return
Diagnostic Register
Sub-function Data:
Specifications
Sub-function: 1H
Restart
Communication
8H
Diagnosis*1
Outline
:
Command
Code
S1
10
Creating
Programs
89
8 Master Specification
S2
S3
:
:
Device Address/
Device Count/Sub-command
Sub-command Code
Data/AND Mask
:
Command
Code
S1
S4
/ D
:Source Data /
Destination PLC Device/OR Mask
0 (fixed)
Applicable
Devices
Block Length
Sub-function: 11H
Return Slave Busy
Counter
8H
Diagnosis*1
Sub-function: 12H
Return Character
Overrun Counter
D R indexing
1 Point
Applicable
Devices
Block Length
D R indexing
1 Point
Applicable
Devices
Block Length
D R indexing
1 Point
BH
Get Comm.
Event Counter
0 (fixed)
0 (fixed)
*1
: Programming State
+1: Event Counter
Applicable
Devices
Block Length
D R indexing
2 Point
CH
Get Comm.
Event Log*1
0 (fixed)
0 (fixed)
: Programming State
Applicable
Devices
Block Length
D R indexing
4~36 Point
MODBUS Address:
Device Count:
0000H~FFFFH
1~1968
Applicable
Devices
Block Length
DRKHMX
Y S indexing
( S3
+ 15)16
MODBUS Address:
Device Count:1~123
0000H~FFFFH
Applicable
Devices
Block Length
DRKH
indexing
S3
0 (fixed)
0 (fixed)
: Slave ID
Applicable
Devices
Block Length
90
D R indexing
2 Point
8 Master Specification
1
S2
S3
:
:
Device Address/
Device Count/Sub-command
Sub-command Code
Data/AND Mask
S4
/ D
:Source Data /
Destination PLC Device/OR Mask
OR Mask:
MODBUS Address:
AND Mask:
0000H~FFFFH
0000H~FFFFH
0000H~FFFFH
Applicable
Devices
Specifications
16H
Mask Write
Register*1
DRKH
indexing
Block Length
1 Point
S2
: Write Address
0000H~FFFFH
S3
: Write Count
1~121
S3
1~125
: Write Data 1
S4
+ (Write Count S3
Data ( S3 )
S4
S4
+ S3
S4
+( S3
: Read Data 1
) +1: Read Data 2
S4 + S3 + (Read Count S3
Read Data ( S3 +1)
Applicable
Devices
+1) -1:
D R indexing
Write Count S3
Read Count S3
+1
5
Communication
Setup
Block Length
*1.
) -1: Write
Wiring
S2
+1: Read
Address
0000H~FFFFH
Device Count:
S4
System
Configuration
MODBUS Address:
17H
Read/Write
Multiple
Registers*1
Outline
:
Command
Code
S1
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
91
9.
9 Slave Specification
9.1 MODBUS Slave Command Code List
Slave Specification
This chapter explains the configuration of the slave for MODBUS Serial Communication.
9.1
Subcommand
Code
Command Name
Details
0x01
Read Coils
0x02
0x03
0x04
0x05
0x06
0x00
0x01
Restart Communication
Option
Restart communication
- Clear all counters
- Recover from listen only mode
- Reset event log (if requested)
0x02
0x03
0x07*1
0x04
0x0A
0x0B
0x0C
0x0D
0x0E
0x0F
0x08
Diagnosis*1
92
0x10
0x11
0x12
Return
Bus
Overrun Count
9 Slave Specification
9.2 MODBUS device address allocation
1
Subcommand
Code
Command Name
Outline
Command Code
Details
0x0C*1
0x0F
0x10
2
Specifications
0x0B*1
Slave ID details:
- PLC run/stop state
0x11*1
0x17*1
Read/Write Multiple
Registers
*1.
9.2
M0-M7679
0x1E00-0x1FFF
0x1E00-0x1FFF
M8000-M8511
0x2000-0x2FFF
0x2000-0x2FFF
S0-S4095
0x3000-0x31FF
TS0-TS511
0x3200-0x32FF
0x3200-0x32FF
CS0-CS255
0x3300-0x33FF
0x3300-0x33FF
Y0-Y377
-
8
Master
Specification
0x3000-0x31FF
0x3400-0x34FF
FX3U/FX3UC Device
MODBUS
Standard
Commands
6
Related
Devices and
Comm. Status
The following table provides the default values for MODBUS address allocation for Bit devices and word
devices.
5
Communication
Setup
The following information details device allocation when using default values and how to create user defined
device address allocation values.
9.3
4
Wiring
0x16*1
System
Configuration
Report Slave ID
X0-X377
9
Slave
Specification
10
Creating
Programs
93
9 Slave Specification
Word device:
MODBUS Word Device Address
Input-Register (Read Only)
0x0000-0x1F3F
FX3U/FX3UC Device
D0-D7999
0x1F40-0x213F
0x1F40-0x213F
D8000-D8511
0x2140-0xA13F
0x2140-0xA13F
R0-R32767
0xA140-0xA33F
0xA140-0xA33F
TN0-TN511
0xA340-0xA407
0xA340-0xA407
CN0-CN199
0xA408-0xA477
0xA408-0xA477
CN200-CN255*1
0xA478-0xA657
0xA478-0xA657
M0-M7679
0xA658-0xA677
0xA658-0xA677
M8000-M8511
0xA678-0xA777
0xA678-0xA777
S0-S4095
0xA778-0xA797
0xA778-0xA797
TS0-TS511
0xA798-0xA7A7
0xA798-0xA7A7
CS0-CS255
0xA7A8-0xA7B7
0xA7A8-0xA7B7
Y0-Y377
0xA7B8-0xA7C7
*1.
X0-X377
FX3G/FX3GC Device
0x0000-0x1DFF
M0-M7679
0x1E00-0x1FFF
0x1E00-0x1FFF
M8000-M8511
0x2000-0x2FFF
0x2000-0x2FFF
S0-S4095
0x3000-0x313F
0x3000-0x313F
TS0-TS319
0x3140-0x31FF
0x3140-0x31FF
unused address*2
0x3200-0x32FF
0x3200-0x32FF
CS0-CS255
0x3300-0x337F
0x3300-0x337F
Y0-Y177
0x3380-0x33FF
0x3380-0x33FF
unused address*2
0x3400-0x347F
*2.
94
X0-X177
9 Slave Specification
1
MODBUS Word Device Address
FX3G/FX3GC Device
0x1F40-0x213F
0x1F40-0x213F
D8000-D8511
0x2140-0x7EFF
0x2140-0x7EFF
R0-R23999
0x7F00-0xA13F
0x7F00-0xA13F
unused address*1
0xA140-0xA27F
0xA140-0xA27F
TN0-TN319
0xA280-0xA33F
0xA280-0xA33F
unused address*1
0xA340-0xA407
0xA340-0xA407
CN0-CN199
0xA408-0xA477
0xA408-0xA477
CN200-CN255*2
0xA478-0xA657
0xA478-0xA657
M0-M7679
0xA658-0xA677
0xA658-0xA677
M8000-M8511
0xA678-0xA777
0xA678-0xA777
S0-S4095
0xA778-0xA78B
0xA778-0xA78B
TS0-TS319
0xA78C-0xA797
0xA78C-0xA797
unused address*1
0xA798-0xA7A7
0xA798-0xA7A7
CS0-CS255
0xA7A8-0xA7AF
0xA7A8-0xA7AF
Y0-Y177
0xA7B0-0xA7B7
0xA7B0-0xA7B7
unused address*1
-
*2.
X0-X177
Communication
Setup
*1.
Wiring
D0-D7999
Specifications
0x0000-0x1F3F
System
Configuration
0x0000-0x1F3F
0xA7B8-0xA7BF
Outline
Word device:
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
95
9.4
9 Slave Specification
MODBUS Serial
Communication Setup
M8411
MOV
H1097
D8400
MOV
H11
D8401
MOV
H1
D8414
MOV
H11
D8415
MOV
K100
D8416
MOV
H5002
D8470
MOV
K0
D8471
MOV
H4
D8472
MOV
K128
D8473
MOV
H8008
D8474
MOV
K0
D8475
96
Note
Device
allocation
data
LSB
D8470
1
Device code
(4bit)
2
Size
(12bit)
D8471
Wiring
MSB
3
System
Configuration
The values set for D8470 - D8485 by the MOV command are checked at the initialisation phase after power
ON. If the values are valid they will be moved into the special data registers D8470 - D8485. In the event that
an error is detected, the MOV command will not be executed and the corresponding special data registers
and all subsequent registers up to D8485 will be set to 0.
2
Specifications
One set of configuration information requires two special data registers where up to eight PLC device areas
can be mapped into the MODBUS slave address area. The user defined devices are then mapped to the top
of the MODBUS address range of "coils" or "Holding Register". The PLC devices are mapped in the order
given by the device allocation data sets 1 to 8 (D8470/D8471 - D8484/D8485).
Outline
9.4.1
9 Slave Specification
3
PLC head device address
(16bit)
Where:
MSB - Most Significant Bit
LSB - Least Significant Bit
Communication
Setup
Device code: defines which FX3U/FX3UC device type shall be mapped into "coils" or "Holding Register"
(4bit)
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
97
9 Slave Specification
Note
If the above range is exceeded, or the selected value exceeds the valid range for the PLC device
defined in c a MODBUS communication error will occur.
X and Y addressing should always be completed in octal. i.e. 00, 20, 40 etc.
If the selected head device address or its combination with the block length exceeds the valid range for
the selected PLC device a MODBUS communication error will occur.
If the setting of d and e is correct and the device mapping is valid, the values will be moved into the
special data registers D8470 - D8485. In the event that an error is detected, the MOV will not be
executed and the corresponding special data registers and all subsequent registers up to D8485 will be
set to 0.
If an error occurs during the device allocation, mapping will be stopped at the first invalid mapping value.
However any mapping operations that have been successfully executed before the error occurrence will
be effective.
For Auxiliary Relays, Data Registers and Counters it is necessary to separate the mapping for standard
and special devices as well as 16 and 32-bit devices. According to this rule it is not possible to map
standard Auxiliary Relay (M0-M7679) and Special Auxiliary Relay (M8000-M8511) in the same mapping
command.
(The same applies for Data Registers & Special Data Registers, 16-bit counters & 32-bit counters).
98
Outline
9.4.2
9 Slave Specification
The following table provides an example of a valid user defined device allocation.
Device
Allocation
Data set
Device Codec
PLC Mapping
D8470(12bit)
D8471
D8472(4bit)
0H(M)
D8472(12bit)
D8473
128
M128-M191
D8474(4bit)
8H(TS)
D8474(12bit)
D8475
TS0-TS127
D8476(4bit)
9H(CS)
D8476(12bit)
D8477
128
CS128-CS159
D8478(4bit)
CH(D)
D8478(12bit)
13
D8479
1000
H-Register 10-217
D1000-D1207
D8480(4bit)
DH(R)
D8480(12bit)
16
D8481
H-Register 218-473
R0-R255
D8482(4bit)
FH(CN)
D8482(12bit)
D8483
200
H-Register 474-489
CN200-CN207
D8484(4bit)
D8484(12bit)
D8485
Unused
Coil 32-95
H-Register 0-7
H-Register 8-9
5
Communication
Setup
The example program below shows the defined MODBUS defined device allocation for the table on the
previous page.
Wiring
5H(X)
Specifications
D8470(4bit)
System
Configuration
Coil 0-31
X0-X37
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
99
9 Slave Specification
MOV
H1097
D8400
MOV
H11
D8401
MOV
H1
D8414
MOV
H11
D8415
MOV
K100
D8416
100
MOV
H5002
D8470
MOV
K0
D8471
MOV
H4
D8472
MOV
K128
D8473
MOV
H8008
D8474
MOV
H0
D8475
MOV
H9002
D8476
MOV
K128
D8477
MOV
H0C0D
D8478
MOV
K1000
D8479
MOV
H0D10
D8480
MOV
K0
D8481
MOV
HF008
D8482
MOV
K200
D8483
9 Slave Specification
1
Outline
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)
FX3U/FX3UC Device
X0 - X37
0x0020 - 0x005F
M128 - M191
2
Specifications
0x0000 - 0x001F
Word device:
Holding-Register (Read / Write)
0x0000 - 0x0007
FX3U/FX3UC Device
CS128 - CS159
0x000A - 0x00D9
D1000 - D1207
0x00DA - 0x01D9
R0 - R255
0x01DA - 0x01E9
CN200 - CN207*1
System
Configuration
0x0008 - 0x0009
*1.
TS0 - TS127
Wiring
The following table provides an example of an invalid user defined device allocation.
Device
Allocation
Data set
Device Code
PLC Mapping
D8470(4bit)
5H(X)
D8470(12bit)
D8471
Coil 0-31
X0-X37
D8472(4bit)
0H(M)
D8472(12bit)
D8473
128
Coil 32-95
M128-M191
D8474(4bit)
8H(TS)
D8474(12bit)
D8475
H-Register 0-7
TS0-TS127
D8476(12bit)
20
D8477
D8478(4bit)
CH(D)0
D8478(12bit) 130
D8479
10000
NOT MAPPED!
Skipped due to error.
D8480(4bit)
DH(R)0
D8480(12bit) 160
D8481
00
NOT MAPPED!
Skipped due to error.
D8482(4bit)
FH(CN)0
D8482(12bit) 160
D8483
2000
NOT MAPPED!
Skipped due to error.
D8484(4bit)
D8484(12bit)
D8485
Unused
8
Master
Specification
9H(CS)0
MODBUS
Standard
Commands
D8476(4bit)
6
Related
Devices and
Comm. Status
NOT MAPPED!
CS240-CS271
exceeds the valid
2400
range for CS. Error has
occurred so the
assignment is stopped.
Communication
Setup
9
Slave
Specification
10
Creating
Programs
101
9 Slave Specification
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)
FX3U/FX3UC Device
0x0000 - 0x001F
X0 - X37
0x0020 - 0x005F
M128 - M191
Word device:
Holding-Register (Read / Write)
0x0000 - 0x0007
102
FX3U/FX3UC Device
TS0 - TS127
9 Slave Specification
Outline
9.5
This section details the communication event log details for the MODBUS slave device.
The communication event log is available only in FX3U and FX3UC PLCs.
High byte
D100D109
D110
Low byte
D113
D112
D141
D142
New values
Old values
Wiring
D111
If the number of communications event logs exceeds 64, the oldest log is deleted and the latest log is stored
to Communications event log 0.
When executing the ADPRW command (command code 0x0C "Get Communication Event Log") the slaves
response data is stored in the following format:
High byte
D2000
H0C
K0
K0
MODBUS
Standard
Commands
K4
6
Related
Devices and
Comm. Status
2. Communications event log response format if ADPRW command is used (For command
code 0x0C "get communication event log")
Communication
Setup
Note
FNC276
ADPRW
3
System
Configuration
D8415 = 11H - i.e. store event counter and event log into D devices
D8416 = 100 - i.e. head device is set to D100
Specifications
D2000
Low byte
Programming state
FFFFH = programming command in process
0000H = no program. Command in process
(always 0000H in case of FX3U/FX3UC slave)
Event counter
D2002
D2003
D2006
D2005
D2034
D2035
New values
9
Slave
Specification
D2004
8
Master
Specification
D2001
9.5.1
Old values
10
If the number of communications in the event log exceeds 64, the oldest log is deleted and the latest log is
stored to Communications event log 0.
103
Creating
Programs
Note
9.5.2
9 Slave Specification
9.5 Communication Event log
Communication error
Unused (Fixed to 0)
Bus character overrun error
In listen only mode
Broadcast message reception
Fixed to 1
2) When sending a response message:
The slave stores this kind of event to the communications event log after sending the response message.
For the relevant communications event, "1" is stored.
b7 b6 b5 b4 b3 b2 b1 b0
0 1 1/0 0 0 0 1/0 1/0
Read exception sent - exception code 01H to 03H
Slave abort exception sent - exception code 04H
Slave busy exception send - exception code 05H or
06H, (when using FX3U slave unsupported - fixed to 0)
Slave NAK (Negative acknowledge) exception sent exception code 07H, (when using FX3U slave unsupported fixed to 0)
Write timeout error occur (when using FX3U slave
unsupported - fixed to 0)
Currently in listen only mode
Slave send event - fixed to 1
Slave send event - fixed to 0
Note
As the FX-Series MODBUS Communication ADP will never be in a state that details exception code 05H to
07H. Therefore the bits 2, 3 & 4 will always read "0" when using a FX-Series MODBUS Communication ADP.
3) When switching to the listen only mode:
The slave stores this kind of event to the communications event log when switching to the listen only
mode.
04H is stored to the communications event log.
b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 0 1 0 0
104
9 Slave Specification
9.5 Communication Event log
b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 0 0 0 0
1
Outline
2
Specifications
3
System
Configuration
4
Wiring
5
Communication
Setup
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
105
10 Creating Programs
10.1
10.2
MODBUS Serial
Communication Setup
M8411
0
H1097
D8400
MOV
H1
D8401
MOV
K2000
D8409
MOV
K400
D8410
MOV
K10
D8411
MOV
K3
D8412
MOV
H101
D8415
MOV
K100
D8416 *1
*1
K100
K8
D0
106
MOV
M0
10 Creating Programs
10.3 Creating Programs for the Slave Station
1
Outline
H0A
H8
H1
H0FF00
R0
M8029
RST
M10
D11
MOVP
K27
D12
H5
H17
D10
D12
D100
M20
7
MODBUS
Standard
Commands
10.3
Related
Devices and
Comm. Status
M8029
Communication
Setup
ADPRW
D13
4
Wiring
MOVP
K150
Command Parameters:
D10 = 90
D11 = 150
D12 = 27
D13 = 31
System
Configuration
D10
MOVP
K31
2
Specifications
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
107
10 Creating Programs
10.4
SET
M0
S0
S999
RST
M0
Reset input
M0
M8401
Communication
port busy
FNC 40
ZRST
Remarks
Conditional jump
Repeat
Subroutine
Interrupt routine
3. Reading Coils
When using the Read Coils command (Command Code 0x01) in the FX MODBUS 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
command will be overwritten. The remaining bits of the word device will not be affected.
108
10 Creating Programs
Command
sending
100s or more
Response
Next Command
sending
Command
sending
Response
3
System
Configuration
External equipment
(Master)
Specifications
External equipment
(Slave)
Outline
100s or more
4
Wiring
5
Communication
Setup
6
Related
Devices and
Comm. Status
7
MODBUS
Standard
Commands
8
Master
Specification
9
Slave
Specification
10
Creating
Programs
109
11.1
M8411
0
MOV
H1081
D8400
MOV
H1
D8401
MOV
H1
D8415 *1
MOV
K100
D8416 *1
M8000
ADPRW
M8029
H1
H2
K0
K4
M100
M8402
MOV
K1M100
K1Y000
CALL
P0
SET
M0
M1000
M8402
M100
M101
M102
M103
M0
ADPRW
M8029
H4
H1
K32
M8402
110
K0
CALL
P0
RST
M0
SET
M1
11
Practical
Program
Examples
M1
ADPRW
H3
K10
K5
D20
12
M8402
CALL
P0
RST
M1
SET
M2
X000
Troubleshooting
M8029
H4
M2
ADPRW
M8029
H4
H0F
K32
K16
M8402
CALL
P0
RST
M2
SET
M3
D1000
M3
ADPRW
M8029
H4
H10
K0
K4
M8402
CALL
P0
RST
M3
FEND
M8000
P0
MOV
D8402
D4000
MOV
D8403
D4001
MOV
D8404
D4002
SRET
111
11.2
MOV
H1081
D8400
MOV
H11
D8401
MOV
K4
D8414
MOV
H11
D8415 *1
MOV
K100
D8416 *1
X000
Y000
27
*1. Available only in FX3U and FX3UC PLCs.
112
User Program
12 Troubleshooting
11
Practical
Program
Examples
12. Troubleshooting
12
12.2
Operation status
RD
SD
Flashing
Flashing
Flashing
Off
Off
Flashing
Off
Off
While MODBUS serial communication is functioning normally, both LEDs flash brightly.
If they are not flashing, check the wiring, communication settings, and error statuses of the master and slave
stations.
12.3
2. 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 Chapter 4.
12.4
113
Troubleshooting
12.1
12 Troubleshooting
12.5 Checking Setting Contents and Errors
12.5
Name
D8400
Channel 1 MODBUS
Communication Format
D8401
Channel 1 MODBUS
Protocol
D8409
Channel 1 MODBUS
Slave Response Timeout
D8410
Channel 1 MODBUS
Turn Around Delay
D8411
Channel 1 MODBUS
Message to Message Delay
D8412
Channel 1 MODBUS
Number of Retries
D8414
Channel 1 MODBUS
Slave Node Address
D8415
Channel 1 MODBUS
Communication Status
Information Setup*1
D8416
Channel 1 MODBUS
Communication Status
Device Range Setup*1
114
Description
12 Troubleshooting
12.5 Checking Setting Contents and Errors
11
D8420
D8421
D8429
Channel 2 MODBUS
Slave Response Timeout
D8430
Channel 2 MODBUS
Turn Around Delay
D8431
Channel 2 MODBUS
Message to Message Delay
D8432
Channel 2 MODBUS
Number of Retries
D8434
Channel 2 MODBUS
Slave Node Address
D8435
Channel 2 MODBUS
Communication Status
Information Setup*1
D8436
Description
12
Troubleshooting
Name
Channel 2 MODBUS
Communication Format
Practical
Program
Examples
Device
Channel 2 MODBUS
Communication Status
Device Range Setup*1
*1.
If the correct contents are not stored in the above devices, check the sequence program.
Name
Description
M8063
M8402
M8403
MODBUS
(Latched)
M8422
M8423
MODBUS
(Latched)
M8438
Communication
Communication
Error
Error
115
12 Troubleshooting
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.
Device
D8063
Name
Description
D8402
MODBUS Communication Error Code on ch1 Set to corresponding MODBUS Error Code on ch1.
D8403
MODBUS Communication Error Details on Set to Error Details for MODBUS Error Code in
ch1
D8402.
D8422
MODBUS Communication Error Code on ch2 Set to corresponding MODBUS Error Code on ch2.
D8423
MODBUS Communication Error Details on Set to Error Details for MODBUS Error Code in
ch2
D8422.
D8438
12.6
0201
Master
Related Devices:(M & D)
/ Slave
0202
Details:Special D register (Device Address)
causing the error code
e.g. Invalid slave number channel 1: Details
(D) 8414
Master
See above
/ Slave
Corrective Action
Invalid Parameter
values will not be
entered
into
the
corresponding data
registers.
Check MODBUS
configuration program
block.
116
12 Troubleshooting
11
Error Name and Details
Bit-level Error
0204
Master
See above
/ Slave
CRC/LRC Error
0205
Master
Message CRC/LRC is invalid, or message
See above
/ Slave
length 3 characters (RTU) or 8 characters
(ASCII)
0206
Corrective Action
Check
Communication
Format data register
D8400 or D8420 for
errors.
12
Check the
Communication
Format, Turn Around
Delay, and Message
to Message Delay
data registers for
errors;
D8400 and
D8410-D8411, or
D8420 and
D8430-D8431.
Check
the
Turn
Around Delay and
Message to Message
Delay data registers
for errors;
D8410-D8411, or
D8430-D8431.
Also verify that the
serial port settings
are correct.
Verify that the Slave
is using MODBUS
Serial
Communication and
that the correct
command was
received.
Also verify that the
device count of the
command is within
the limits of the Slave
and Master.
Protocol error may
occur if you dont
program correctly.
Master
When in ASCII mode a byte code can not be
See above
/ Slave
converted
(any character except '0'-'9' and 'A'-'F' ('a'-'f'))
Unsupported Command Code Error
0209
Slave
See above
See Corrective
Actions for Error
Code 207.
Verify that the
command used is
within the Master and
Slave specifications.
117
Troubleshooting
Master
Related Devices:(M & D)
/ Slave
Practical
Program
Examples
MODBUS
Error
Code
12 Troubleshooting
MODBUS
Error
Code
Master
Related Devices:(M & D)
/ Slave
See above
Communication Timeout
0211
Corrective Action
0212
0213
See Corrective
Actions for Error
Code 207.
Details:
H-Byte: requested Slave Node address
L-Byte: received Slave Node address
Function Code Mismatch
0214
Details:
H-Byte: requested function code
L-Byte: received function code
See Corrective
Actions for Error
Code 207.
118
Non-Diagnosis
Commands
Diagnosis
Commands
H-Byte 0
Command Code
(08H)
Sub-Command
Code
Slave
See above
12 Troubleshooting
11
Master
Related Devices:(M & D)
/ Slave
Corrective Action
Practical
Program
Examples
MODBUS
Error
Code
See above
See Corrective
Actions for Error
Code 207.
See above
Slave
Details:
H-Byte: 0
L-Byte: 1-5 according to the invalid parameter
of the ADPRW command
S4
*1.
See above
to
/ D
119
12
Troubleshooting
12 Troubleshooting
120
Exception name
Details
Illegal Function
02H
03H
One of the fields within the request exceeds the allowed value (e.g.
the implied length, the device count)
04H
Warranty
Warranty
Please confirm the following product warranty details before using this product.
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.
6. Product application
1) In using the Mitsubishi MELSEC programmable logic
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
logic 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 logic 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 logic 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 logic 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 users discretion.
121
Revised History
Revised History
122
Date
Revision
Description
4/2007
First Edition
12/2009
10/2010
2/2012
7/2012
HEAD OFFICE: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
HIMEJI WORKS: 840, CHIYODA CHO, HIMEJI, JAPAN
MODEL
FX3U-U-MB-E
MODEL CODE
09R626
JY997D26201E
(MEE)
MITSUBISHI ELECTRIC
HEADQUARTERS
EUROPEAN REPRESENTATIVES
EUROPEAN REPRESENTATIVES
GEVA
AUSTRIA
Wiener Strae 89
AT-2500 Baden
Phone: +43 (0)2252 / 85 55 20
Fax: +43 (0)2252 / 488 60
TECHNIKON
BELARUS
Oktyabrskaya 19, Off. 705
BY-220030 Minsk
Phone: +375 (0)17 / 210 46 26
Fax: +375 (0)17 / 210 46 26
ESCO DRIVES & AUTOMATION
BELGIUM
Culliganlaan 3
BE-1831 Diegem
Phone: +32 (0)2 / 717 64 30
Fax: +32 (0)2 / 717 64 31
Koning & Hartman b.v.
BELGIUM
Woluwelaan 31
BE-1800 Vilvoorde
Phone: +32 (0)2 / 257 02 40
Fax: +32 (0)2 / 257 02 49
INEA RBT d.o.o.
BOSNIA AND HERZEGOVINA
Aleja Lipa 56
BA-71000 Sarajevo
Phone: +387 (0)33 / 921 164
Fax: +387 (0)33/ 524 539
AKHNATON
BULGARIA
4, Andrei Ljapchev Blvd., PO Box 21
BG-1756 Sofia
Phone: +359 (0)2 / 817 6000
Fax: +359 (0)2 / 97 44 06 1
INEA RBT d.o.o.
CROATIA
Losinjska 4 a
HR-10000 Zagreb
Phone: +385 (0)1 / 36 940 - 01/ -02/ -03
Fax: +385 (0)1 / 36 940 - 03
AutoCont C.S. s.r.o.
CZECH REPUBLIC
Technologick 374/6
CZ-708 00 Ostrava-Pustkovec
Phone: +420 595 691 150
Fax: +420 595 691 199
Beijer Electronics A/S
DENMARK
Lykkegrdsvej 17
DK-4000 Roskilde
Phone: +45 (0)46/ 75 76 66
Fax: +45 (0)46 / 75 56 26
Beijer Electronics Eesti O
ESTONIA
Prnu mnt.160i
EE-11317 Tallinn
Phone: +372 (0)6 / 51 81 40
Fax: +372 (0)6 / 51 81 49
Beijer Electronics OY
FINLAND
Peltoie 37
FIN-28400 Ulvila
Phone: +358 (0)207 / 463 540
Fax: +358 (0)207 / 463 541
UTECO
GREECE
5, Mavrogenous Str.
GR-18542 Piraeus
Phone: +30 211 / 1206 900
Fax: +30 211 / 1206 999
MELTRADE Kft.
HUNGARY
Fert utca 14.
HU-1107 Budapest
Phone: +36 (0)1 / 431-9726
Fax: +36 (0)1 / 431-9727
Beijer Electronics SIA
LATVIA
Ritausmas iela 23
LV-1058 Riga
Phone: +371 (0)784 / 2280
Fax: +371 (0)784 / 2281
Beijer Electronics UAB
LITHUANIA
Savanoriu Pr. 187
LT-02300 Vilnius
Phone: +370 (0)5 / 232 3101
Fax: +370 (0)5 / 232 2980
ALFATRADE Ltd.
MALTA
99, Paola Hill
Malta- Paola PLA 1702
Phone: +356 (0)21 / 697 816
Fax: +356 (0)21 / 697 817
INTEHSIS srl
MOLDOVA
bld. Traian 23/1
MD-2060 Kishinev
Phone: +373 (0)22 / 66 4242
Fax: +373 (0)22 / 66 4280
HIFLEX AUTOM.TECHNIEK B.V.
NETHERLANDS
Wolweverstraat 22
NL-2984 CD Ridderkerk
Phone: +31 (0)180 46 60 04
Fax: +31 (0)180 44 23 55
Koning & Hartman b.v.
NETHERLANDS
Haarlerbergweg 21-23
NL-1101 CH Amsterdam
Phone: +31 (0)20 / 587 76 00
Fax: +31 (0)20 / 587 76 05
Beijer Electronics AS
NORWAY
Postboks 487
NO-3002 Drammen
Phone: +47 (0)32 / 24 30 00
Fax: +47 (0)32 / 84 85 77
Fonseca S.A.
PORTUGAL
R. Joo Francisco do Casal 87/89
PT - 3801-997 Aveiro, Esgueira
Phone: +351 (0)234 / 303 900
Fax: +351 (0)234 / 303 910
Sirius Trading & Services srl
ROMANIA
Aleea Lacul Morii Nr. 3
RO-060841 Bucuresti, Sector 6
Phone: +40 (0)21 / 430 40 06
Fax: +40 (0)21 / 430 40 02
INEA RBT d.o.o.
SERBIA
Izletnicka 10
SER-113000 Smederevo
Phone: +381 (0)26 / 615 401
Fax: +381 (0)26 / 615 401
SIMAP s.r.o.
SLOVAKIA
Jna Derku 1671
SK-911 01 Trencn
Phone: +421 (0)32 743 04 72
Fax: +421 (0)32 743 75 20
PROCONT, spol. s r.o. Preov
SLOVAKIA
Kpeln 1/A
SK-080 01 Preov
Phone: +421 (0)51 7580 611
Fax: +421 (0)51 7580 650
INEA RBT d.o.o.
SLOVENIA
Stegne 11
SI-1000 Ljubljana
Phone: +386 (0)1 / 513 8116
Fax: +386 (0)1 / 513 8170
Beijer Electronics AB
SWEDEN
Box 426
SE-20124 Malm
Phone: +46 (0)40 / 35 86 00
Fax: +46 (0)40 / 93 23 01
Omni Ray AG
SWITZERLAND
Im Schrli 5
CH-8600 Dbendorf
Phone: +41 (0)44 / 802 28 80
Fax: +41 (0)44 / 802 28 28
GTS
TURKEY
Bayraktar Bulvari Nutuk Sok. No:5
TR-34775 Yukar Dudullu-mraniye-STANBUL
Phone: +90 (0)216 526 39 90
Fax: +90 (0)216 526 3995
CSC Automation Ltd.
UKRAINE
4-B, M. Raskovoyi St.
UA-02660 Kiev
Phone: +380 (0)44 / 494 33 55
Fax: +380 (0)44 / 494-33-66
Systemgroup
UKRAINE
2 M. Krivonosa St.
UA-03680 Kiev
Phone: +380 (0)44 / 490 92 29
Fax: +380 (0)44 / 248 88 68
EURASIAN REPRESENTATIVES
TOO Kazpromavtomatika
Ul. Zhambyla 28
KAZ-100017 Karaganda
Phone: +7 7212 / 50 10 00
Fax: +7 7212 / 50 11 50
KAZAKHSTAN
AFRICAN REPRESENTATIVE
CBI Ltd.
Private Bag 2016
ZA-1600 Isando
Phone: + 27 (0)11 / 977 0770
Fax: + 27 (0)11 / 977 0761
SOUTH AFRICA
Mitsubishi Electric Europe B.V. /// FA - European Business Group /// Gothaer Strae 8 /// D-40880 Ratingen /// Germany
Tel.: +49(0)2102-4860 /// Fax: +49(0)2102-4861120 /// [email protected] /// www.mitsubishi-automation.com