Modbus_RTU.pdf
(
473 KB
)
Pobierz
Modbus RTU Communications, GFK-2220C
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:
Supported Products
Mode of Operation
COMMREQs
Time Constraints
Serial Connections
Multidrop Connections
Drivers and Receivers
Cable
Grounding
Connector Wiring
Four-Wire
Two-Wire
Point-to-Point
COMMREQ Function Block Format
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
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.
GFK-2220B
1
Overview
Standards
COMMREQ Function Block Parameters
Initialize RTU Master Port: 65520 (FFF0)
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.0
1
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
.
2
Modbus RTU Master Communications - December 2003
GFK-2220B
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.
GFK-2220B
3
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
Notes:
1.
Connectors on the cable ends have the
Resistive Termination (RT) pin connected.
All others have RT unconnected.
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
1
SHLD
4
N/C
5
+5VDC
6
RTS(A)
2.
Terminate the SD signal pair in both end
connectors with a 120 ohm, ¼ watt
resistor in the connector shell.
7
SG
8
CTS(B’)
9
RT
10
RD(A’)
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
11
RD(B’)
SD(B)
12
SD(A)
13
SD(B)
14
RTS(B)
RD(B’)
RTS(B)
15
CTS(A’)
CTS(A’)
120
SLAVE CONNECTORS
MODBUS RTU MASTER
(END CONNECTOR)
1
SHLD
4
N/C
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.
5
+5VDC
6
RTS(A)
7
SG
8
CTS(B’)
9
RT
10
RD(A’)
11
RD(B’)
12
SD(A)
13
SD(B)
14
RTS(B)
120
15
CTS(A’)
END CONNECTOR
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 Belden
2
9842 or equivalent.
2
Belden is a trademark of Belden Technologies Inc
.
4
Modbus RTU Master Communications - December 2003
GFK-2220B
2
N/C
3
N/C
2
N/C
3
N/C
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
.
GFK-2220B
5
Plik z chomika:
darekisap
Inne pliki z tego folderu:
adresowanie zmiennych w Modbus Master.pdf
(122 KB)
DASMBSerial.pdf
(283 KB)
modbus tcp.pdf
(1003 KB)
Modbus_RTU.pdf
(473 KB)
konfiguracjaFSGateway.pdf
(415 KB)
Inne foldery tego chomika:
Intouch
InTouch 10
Zgłoś jeśli
naruszono regulamin