GFK-2220B 1
Modbus RTU Master Communications
This document describes the operation of Modbus® RTU Master from the user interface
point of view. Use this information as a supplement to the Serial Communications User’s
Manual (GFK-0582). This document contains the following information:
� Overview
� Supported Products
� Mode of Operation
� COMMREQs
� Time Constraints
� Serial Connections
� Standards
� Multidrop Connections
� Drivers and Receivers
� Cable
� Grounding
� Connector Wiring
� Four-Wire
� Two-Wire
� Point-to-Point
� COMMREQ Function Block Format
� COMMREQ Function Block Parameters
� COMMREQ Function Block Output
� COMMREQ Command Data Block
� Modbus RTU Master Status Word Format
� Queue Limitations for Modbus RTU Master COMMREQs
� Local Data
� Modbus RTU Master Diagnostic Status Words
� Modbus RTU Master Commands
� Initialize RTU Master Port: 65520 (FFF0)
� Clear RTU Master Diagnostic Status Words: 08000 (1F40)
� Read RTU Master Diagnostic Status Words: 08001 (1F41)
� Send RTU Read/Force/Preset Query: 08002 (1F42)
� Send RTU Diagnostic Query: 08003 (1F43)
� Error Codes
� Example Application
® Modbus is a registered trademark of Schneider Electric.
2 Modbus RTU Master Communications - December 2003 GFK-2220B
Overview
Modbus Serial Line protocol is an open standard for data communications between PLCs
and related devices. The Modbus Serial Line standard provides for communication using
either printable characters exclusively (Modbus ASCII), or binary data (Modbus RTU).
This document describes Modbus RTU Master communications on GE Fanuc PLC CPUs.
Supported Products
Modbus RTU Master communications is currently available on the Series 90-30
IC693CPU363 and VersaMax® modular CPU models IC200CPU001, IC200CPU002,
IC200CPU005 and IC200CPUE05.
Mode of Operation
A Modbus RTU master device (the client) sends query messages to one or more slave
devices (the servers) on a serial network. Queries may contain data, requests for data or
status, or commands.
Each slave on the network has a unique device address. Any query may be addressed
either to a specific slave device or to a special broadcast address. Queries addressed to the
broadcast address are called broadcast queries. Queries that require a response may not
be addressed to the broadcast address.
A slave that receives a well-formed, non-broadcast query must send a response message to
the master. The query/response transaction completes when the master receives a well-
formed response.
Slaves do not respond to broadcast queries. After sending a broadcast query, the master
must wait a specified time before completing the transaction and sending the next query.
Some broadcast queries contain commands that require the slaves to take specified
actions.
COMMREQs
The application program running in the PLC CPU controls the timing and content of each
query by sending a COMMREQ message. The COMMREQ must be addressed to the
CPU serial port that is connected to the Modbus RTU serial network. COMMREQ data
specifies the content of the query. When the query/response transaction completes, a
COMMREQ status value indicates the success or failure of the transaction. See the
COMMREQ Function Block Format section of this document and the sections that follow
it for details.
Time Constraints
The Modbus over Serial Line Specification and Implementation guide V1.01 contains
several important timing requirements.
Serial Connections
Series 90 and VersaMax are trademarks of GE Fanuc Automation.
1 The current Modbus RTU specification is available online in the documents Modbus Application
Protocol Specification V1.1 and Modbus over Serial Line Specification and Implementation guide V1.0
at http://www.modbus.org/. Follow the Modbus Standard Library link to find them.
GFK-2220B 3
A Modbus RTU network has one master device and one or more (up to 247) slave devices.
A serial network interconnects all these devices. If there is only one slave, a point-to-
point connection is used. A multidrop connection is needed for two or more slaves.
Standards
Virtually all PLC serial communications ports (including all serial ports on GE Fanuc PLC
CPUs) support one (or two or three in some cases) of three physical layer standards for
asynchronous serial communications. The current revisions of all three may be purchased
from the Telecommunications Industries Association at
http://www.tiaonline.org/standards/.
EIA/TIA-232-F: Interface Between Data Terminal Equipment and Data Circuit-Terminating
Equipment Employing Serial Binary Data Interchange (ANSI/TIA/EIA-232-F-1997)
This standard is commonly referred to as “RS-232” or “RS-232C” because the definitive
earlier revision was titled “RS-232-C”. RS-232 ports transmit and receive data and
control signals on unbalanced circuits. That is, one Signal Common (or Signal Ground)
wire serves as the return path for all the data and control circuits.
RS-232 ports are suitable for point-to-point connections up to about 25 meters in length,
but not for longer lines or multidrop connections. The specification recommends limiting
the data rate to (in effect) 19,200 bits per second (bps) or less, but rates up 115,200 bps are
frequently used with short cables (typically about 2 meters).
EIA/TIA-422-B: Electrical Characteristics of Balanced Voltage Digital Interface Circuits
(ANSI/TIA/EIA-422-B-94, revised 2000)
This standard is usually called “RS-422” because the initial revision had that title. It
specifies twisted-pair cabling and a balanced line driver and receiver for each circuit. RS-
442 supports higher data rates and longer distances than RS-232. A 100-ohm nominal
impedance is recommended for twisted pair circuits in cables, and 100-ohm terminating
resistors are recommended for the receiving end of each circuit.
Some RS-422 ports support multidrop (multipoint) operation. However, this capability is
not guaranteed by the standard. Use caution when attempting to use an RS-422 device on
a multidrop network.
EIA/TIA-485-A: Electrical Characteristics of Generators and Receivers for Use in Balanced
Digital Multipoint Systems (ANSI/TIA/EIA-485-A-98)
The original version of this standard was titled “RS-485”; it is frequently referred to by that
name. This standard has effectively replaced RS-422 because it adds guaranteed multidrop
(multipoint) capability. Line drivers in the data circuits are required to switch to a high-
impedance state (“tristate” themselves) except when transmitting, and the control and status
circuits are rarely connected through the cable in multidrop applications. Consequently,
multiple data line drivers can be connected in parallel to each data circuit. The port
firmware guarantees only one port at a time will attempt to transmit on each circuit.
RS-485 uses 120-ohm cable and terminating resistors. Because transmitters are not
always connected to the line, terminating resistors must be used at both ends of each
circuit.
Note that some RS-485 devices may require pull-up and pull-down resistors to polarize
(bias) receive-data circuits to the mark state when all transmitters are in the high-
impedance state. GE Fanuc RS-485 ports do not require pull-up and pull-down resistors.
4 Modbus RTU Master Communications - December 2003 GFK-2220B
Multidrop Connections
Four-Wire (4-Wire)
In this network configuration, the Send Data (SD) pair of the RTU master device is
connected to the Receive Data (RD) pairs of all the slaves, and the SD pairs of all the
slaves are connected to the RD pair of the master. The slave devices must all use RS-485-
compatible serial ports so that their transmitters are disabled except when transmitting.
Although some RS-442 devices disable outputs when not transmitting, the RS-442
specification does not require it. The master may use either an RS-422 or RS-485 port
because it is the only transmitter on that pair. Serial ports on all devices should be
configured for Flow Control NONE.
Both signal pairs must be terminated at both ends by appropriate resistors. Each pair is
terminated at one end by the resistive terminator (RT pin) build into the end port. The
other end of each pair is terminated by a 120 ohm, ¼ watt resistor in the connector shell.
If the end device lacks a built-in terminator, a second 120-ohm, ¼ watt resistor must be
wired across the RD signal pair inside the connector shell.
Four-Wire Connection without Repeaters
CTS(A’)
RD(B’)
RTS(B)
SD(B)
MODBUS RTU MASTER
(END CONNECTOR)
Notes:
1. Connectors on the cable ends have the
Resistive Termination (RT) pin connected.
All others have RT unconnected.
3. One connector is shown between the end
devices. Additional connectors may be
added up to a total of 31.
4. Attach all connectors to 15-pin RS-485
ports on GE Fanuc CPU modules. The
Modbus RTU master device must be
attached at the left-hand connector. All
other devices are slaves.
5. Jumper connections between CTS and
RTS are optional. No GE Fanuc 15-pin
RS -485 ports that support Modbus RTU
currently require them.
6. There are ground loops through the SHLD
connections and frame ground connections
of the master and slave devices. Large
ground loop currents can cause data
errors. See the accompanying text for a
discussion of this issue.
7. Vary the connector wiring as needed to
accommodate third-party RTU slave
devices.
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
SD(A)
RD(A’)
1
2
3
4
5
6
7
8
9
12
13
10
11
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
END CONNECTOR
SLAVE CONNECTORS
120
120
2. Terminate the SD signal pair in both end
connectors with a 120 ohm, ¼ watt
resistor in the connector shell.
Any high-quality shielded twisted-pair cable with two pairs is suitable for short cable runs
(up to about 15 meters). Longer runs require a cable with a nominal impedance of 120
ohms. Use a cable designed for RS-485 transmission such as Belden2 9842 or equivalent.
2 Belden is a trademark of Belden Technologies Inc.
GFK-2220B 5
Grounding and Ground Loops
Proper grounding of the cable shield requires careful planning of the network and its
power wiring. To avoid data errors from intermittent electrical noise, it is vital to ground
the cable shield to the SHLD (shield) pin of every device on the network. Unfortunately,
this introduces at least N-1 ground loops, where N is the number of devices on the
network. Each ground loop path comprises the shield and drain wire on the cable segment
between two devices and a ground return path. The return paths start at the frame ground
point of one device, pass through its ground conductor to the common ground, and then
pass through the ground conductor of the other device to its frame ground point.
Ground loop currents must be kept within acceptable limits by careful grounding.
Otherwise, common-mode noise induced on the data pair by the ground loop currents can
cause data errors.
When designing ground wiring, consider these requirements:
1. There must be one common ground point in the system with an extremely low
impedance path to earth.
2. The conductor from the frame ground point of each device to the common ground
must have extremely low impedance.
3. The recommended frame ground wire sizes, lengths and proper wiring practices must
be observed in designing the connections between frame ground points and the
common ground.
4. The data cable and ground wire routing must be physically isolated from other wiring
that could couple noise onto the data cable or ground wiring.
5. If disconnecting the cable shield from the SHLD pin on any device reduces data
errors, the network has a ground loop issue. Some older versions of GE Fanuc
manuals recommend connecting cable shields at one end only to eliminate ground
loop currents. This is no longer a recommended practice. When a shield is grounded
at only one end, the network’s susceptibility to intermittent data errors from
electromagnetic interference (EMI) is increased significantly. These errors may not
be immediately apparent and often result in substantial post-installation costs for
diagnosis and remediation.
If data errors caused by ground loops cannot be avoided (for example, because the cable
run is too long for all devices to use a common ground point), add one or more optically
isolated RS-485 repeaters to the network. Partition the network into segments so that each
segment has a common ground. Isolate the segments with repeaters such as the BLACK
BOX model IC158A: http://www.blackbox.com/. See the repeater manufacturer’s data
sheet for details. The figure on the previous page shows a typical 4-wire network without
repeaters.
BLACK BOX is a registered trademark of Black Box Corporation.
6 Modbus RTU Master Communications - December 2003 GFK-2220B
Four-Wire Connection Using Master RS-232 Port
The master may also use an RS-232 port that is connected through an RS-232/RS-442 or
RS-232/RS-485 converter. For example, the mini-converter provided in the GE Fanuc
IC690ACC901 Cable and Miniconverter accessory may be used. This device is powered
from power pins in the 15-pin RS-485 connectors on GE Fanuc PLCs. The power and
ground pins should be connected to just one slave device as shown below.
Here again, both signal pairs must be terminated at both ends by appropriate resistors.
The transmitter in the mini-converter is always enabled and acts as a line terminator on the
signal pair connected to its SD pins. The other end of the same pair is terminated by the
resistive terminator (RT pin) build into the end port. The other signal pair is terminated by
a 120-ohm, ¼ watt resistor in the connector shell at each end.
If the end device lacks a built-in terminator, a second 120-ohm, ¼ watt resistor must be
wired across the RD signal pair inside the connector shell.
120
END CONNECTOR
15-PIN SIDE OF
MINICONVERTER FOR
RS-232 MODBUS RTU
MASTER
Notes:
1. Attach the Modbus RTU master device
through its RS-232 port and mini-
converter at the left-hand connector. All
other devices are RS-485 slaves.
2. Terminate the RD pair at the mini-
converter with a 120 ohm, ¼ watt resistor
in the connector shell. The mini-
converter has an internal jumper between
pins 9 and 10.
4. Connect the Resistive Termination (RT)
pin only at the slave on the far end of the
cable. All others have RT unconnected.
5. Jumper connections between CTS and
RTS are optional. No GE Fanuc 15-pin
RS-485 ports that support Modbus
currently require them.
6. One connector is shown between the end
devices. Additional connectors may be
added up to a total of 8.
7. There are ground loops through the
SHLD connections and frame ground
connections of the master and slave
devices. See the accompanying text
for a discussion of this issue.
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
SD(A)
SD(B)
RD(A’)
RD(B’)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
12
13
10
11
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SLAVE CONNECTORS
120
3. Terminate the SD pair at the end of the
cable farthest from the mini-converter
with a 120 ohm, ¼ watt resistor in the
connector shell.
The number of slave ports that RS-442 and RS-485 masters can drive is somewhat less
than the theoretical values in the two specifications. In practice, masters with RS-422
ports can drive six or seven slaves, while RS-485 masters can drive about 15 to 18 RS-485
slaves. The exact number will vary with the cable length and the locations of slaves on
the cable. For additional slaves, add one or more RS-485 repeaters to the network (for
example, BLACK BOX models IC155A and IC158A). See the repeater manufacturer’s
data sheet for details.
GFK-2220B 7
Two-Wire (2-Wire)
Because only one device at a time can transmit data, Modbus RTU supports networks
using just one data pair. Two-wire operation offers the advantage that cable cost is lower.
Any device on a 2-wire network may be configured as the master.
On a 2-wire network, the Send Data (SD) and Receive Data (RD) pairs of all devices are
connected in parallel to a single pair of wires. Both ends of the pair must be terminated
with 120-ohm resistors. All devices must be RS-485-compatible in order to disable their
transmitters except when transmitting. All devices must disable their receivers while
transmitting. Note that the GE Fanuc IC690ACC901 mini-converter does not meet these
requirements.
The signal pair is terminated at both ends by the resistive terminators (RT pin) build into
the end ports. If either end device lacks a built-in terminator, a 120-ohm, ¼ watt resistor
must be wired across the signal pair inside the connector shell.
Any high-quality shielded twisted-pair cable is suitable for short cable runs (up to about
15 meters). Longer runs require a cable with a nominal impedance of 120 ohms. Use a
cable designed for RS-485 transmission such as Belden 3105A or equivalent.
Serial ports on all devices should be configured for Flow Control NONE.
Typical Two-Wire Connection
Notes:
1. Connectors on the cable ends have
the Resistive Termination (RT) pin
connected. All others have RT
unconnected.
2. One connector is shown between the
end devices. Additional connectors
may be added up to a total of 31.
3. Attach all connectors to 15-pin RS-485
ports on GE Fanuc CPU modules.
One Modbus RTU master device may
be attached at any connector. All
other devices are slaves.
4. Jumper connections between CTS and
RTS are optional. No GE Fanuc 15-pin
RS-485 ports that support Modbus RTU
currently require them.
5. There are ground loops through the
SHLD connections and frame ground
connections of the master and slave
devices. See the accompanying text
for a discussion of this issue.
6. Vary the connector wiring as needed to
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SHLD
N/C
N/C
N/C
+5VDC
RTS(A)
SG
CTS(B’)
RT
RD(A’)
RD(B’)
SD(A)
SD(B)
RTS(B)
CTS(A’)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
END CONNECTOR
END CONNECTOR
accommodate third-party RTU slave
devices.
RS-485 repeaters can also be used on 2-wire networks.
Point-to-Point
When the network has only one slave device, a point-to-point connection between the
master and slave is used. The cable connection may be either RS-232 or RS-422/485.
Serial ports on both devices should be configured for Flow Control NONE.
8 Modbus RTU Master Communications - December 2003 GFK-2220B
COMMREQ Function Block Format
Modbus RTU Master communications use standard COMMREQ function blocks to
o
本文档为【GE PLC ModBus 通讯手册】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。