Micromod MODBUS RTU Communications Guide

MODBUS™ RTU Communications Guide
for use with MODCELL, MOD 30ML and Commander Products
MODBUS RTU

CONTENTS

Page
OVERVIEW ......................................................................................................................................................... 1
HARDWARE REQUIREMENTS.......................................................................................................................... 2
SERIAL INTERFACE CONSIDERATIONS .................................................................................................... 2
CABLE REQUIREMENTS .............................................................................................................................. 2
COMMUNICATIONS MODE........................................................................................................................... 2
RS-232 INTERFACE....................................................................................................................................... 3
RS-422 INTERFACE....................................................................................................................................... 3
RS-485 INTERFACE....................................................................................................................................... 3
BIAS RESISTORS................................................................................................................ ..........................3
TERMINATION RESISTORS ......................................................................................................................... 3
SOFTWARE BASICS.......................................................................................................................................... 5
MASTER/SLAVE RELATIONSHIP................................................................................................................. 5
MESSAGE RESPONSE TIMES ..................................................................................................................... 5
INSTRUMENT RESPONSE TIMES TO HOST COMMANDS........................................................................ 5
SOFTWARE DRIVERS................................................................................................................................... 6
MODBUS WITH MODCELL MLP AND MOD30ML.............................................................................................7
STANDARD PROTOCOL...............................................................................................................................7
EXTENDED PROTOCOL............................................................................................................................... 7
MOD 30ML COMMUNICATION CHANNELS................................................................................................. 7
USING ML AND CL BLOCKS:............................................................................................................................. 8
DIRECTING DATA WITH ML AND CL BLOCKS............................................................................................ 8
BLOCK CONNECTIONS................................................................................................................................ 9
USING MODBUS MODULES:........................................................................................................................... 10
MODULE LOCATION................................................................................................................................... 10
THE RS-485’S TERM (MASTER/SLAVE) SWITCH..................................................................................... 10
THE COM DEFAULTS SWITCH .................................................................................................................. 10
THE HIGH AND LOW SWITCHES............................................................................................................... 10
MODBUS MASTER........................................................................................................................................... 12
MASTER REQUIREMENTS......................................................................................................................... 12
DATA CONVERSION ................................................................................................................................... 12
SCALER BLOCK........................................................................................................................................... 12
INPUT CONVERT BLOCK ........................................................................................................................... 13
OUTPUT CONVERT BLOCK ....................................................................................................................... 13
MODBUS WITH COMMANDER SERIES INSTRUMENTS .............................................................................. 14
SCALING ANALOG VALUES....................................................................................................................... 14
COMMUNICATIONS CONFIGURATION..................................................................................................... 14
CONNECTION WITHIN THE NETWORK .................................................................................................... 14
HOST CONFIGURATION EXAMPLES............................................................................................................. 15
MODBUS WITH FIX AND COMMANDER 150............................................................................................. 15
MODBUS WITH FIX AND COMMANDER 300............................................................................................. 16
MODBUS WITH INTOUCH AND COMMANDER 300.................................................................................. 17
MODCELL MLP WITH TCP QUICKPANEL.................................................................................................. 18
PLC & Protocols........................................................................................................................................ 18
Tags .......................................................................................................................................................... 18
Addressing ................................................................................................................................................ 18
Scaling....................................................................................................................................................... 19
MOD30ML AND MODCELL MLP REFERENCE TABLES................................................................................ 20
WIRE CONNECTIONS...................................................................................................................................... 22
MODBUS MODULE TROUBLESHOOTING WITH MOD30ML AND MODCELL MLP..................................... 23
GLOSSARY....................................................................................................................................................... 25
i
MODBUS RTU
CONTENTS
TABLES
Page
Table 1. Cable Requirements .............................................................................................................................2
Table 2. Instrument Response Times.................................................................................................................5
Table 3. Software Drivers....................................................................................................................................6
Table 4. MOD30ML and Modcell MLP Port Numbers.......................................................................................10
Table 5. Integer Conversion - Signed to Unsigned...........................................................................................12
Table 6. MODBUS with FIX and Commander 150............................................................................................15
Table 7. MODBUS with FIX and Commander 300............................................................................................16
Table 8. MODBUS with InTouch and Commander 300....................................................................................17
Table 9. Wiring for RS-485 Full Duplex.............................................................................................................18
Table 10. TCP QuickPanel Addressing.............................................................................................................18
Table 11. MOD30ML and Modcell Multiloop Processor to Host Device or PC Sample Configuration Entries .20
Table 12. MODBUS Reference Information for MOD30 ML and Modcell Communications.............................21
Table 13. Wire Connections for RS-232 Devices..............................................................................................22
Table 14. Wire Connections for RS-485 (4 or 5-Wire) Devices ........................................................................22
Table 15. Wire Connections for RS-485 (2 or 3-Wire) Devices ........................................................................22
FIGURES
Page
Figure 1. RS-485 Biasing and Termination.........................................................................................................4
Figure 2. Extended and Standard MODBUS Lists..............................................................................................8
Figure 3. Block Connections...............................................................................................................................9
Figure 4. Module Switches................................................................................................................................11
ii
MODBUS RTU
COMUNICATIONS GUIDE

OVERVIEW

MODBUS RTU is a non-proprietary serial communications protocol that is widely used in the process control industry. The protocol was developed by Modicon for PLC communications and later released for public use. This protocol is available in all major Human Machine Interface (HMI) software packages and terminals. Many of the major controller and PLC manufacturers also offer MODBUS protocol as a standard or optional protocol in their instrumentation.
The hardware over which MODBUS RTU communications are performed is not defined by the protocol. MODBUS RTU is supported on RS-232, RS-422, RS-485, Ethernet and other electrical standards.
It should be noted that MODBUS RTU, MODBUS ASCII and MODBUS Plus are unique communication formats, and are not compatible with each other. This document will discuss MODBUS RTU only.
1
MODBUS RTU
COMUNICATIONS GUIDE

HARDWARE REQUIREMENTS

SERIAL INTERFACE CONSIDERATIONS
The Modbus protocol communicates with the instrumentation by means of an industry standard serial interface. This interface may be RS-232, RS-422 or RS-485. Some systems may also support the protocol over other busses or networks, such as Ethernet.
An RS-232 interface allows only two devices to be connected together. RS-422 supports 1 driver and up to 10 receivers on a single network. For bi-directional communications, special tri-state circuitry is provided on the drivers of some instrumentation, allowing 10 driver/receiver pairs. RS-485 supports up to 32 driver/receiver pairs. With special hardware, the RS-422 and RS-485 limits can be expanded to allow as many as 248 devices on a single network. Each device on a network must have a unique address, which may be soft­configured or set with switches. Address zero is reserved for broadcast messages from the host to all slaves. All devices on a network must also be configured with the same parameters, such as baud rate and parity.
In designing the communication architecture, one should consider communications performance when deciding how many devices to connect to a host port. Generally, nearly twice the performance can be achieved by splitting the devices from one port, onto two ports.
CABLE REQUIREMENTS
The type of wire to use is usually specified by the hardware manufacturer and will vary with required length. Wire with twisted pairs and an overall shield is used most often. The shield is tied to earth ground or chassis, and typically at one end only. The shield is not to be used as a signal common or ground. The table below lists typical cable recommendations.
Table 1. Cable Requirements
RS-232
Up to 15m (50ft) virtually any standard shielded twisted pair with drain
(Beldon 9502 or equivalent)
RS-422 and RS-485
Up to 6m (20ft) virtually any standard shielded or twisted pair Up to 300m (1000ft) 24 AWG twisted pair with overall foil shield with drain wire
(Beldon 9841 for 2-wire and 9502 for 4-wire or equiv.)
Up to 1200m (4000ft) 24 AWG twisted pair with foil shield and drain wire on each pair
(Beldon 9841 for 2-wire and 9729 for 4-wire or equiv.)
COMMUNICATIONS MODE
Communications can take place in full or half-duplex mode. The communications hardware must be able to support whatever mode the software is using. Half-duplex hardware shares the same lines for transmit and receive, whereas, full-duplex hardware has dedicated transmit and receive lines. MODBUS protocol uses half-duplex communications, regardless of the hardware. Full-duplex hardware is more widely supported by software drivers and devices, than half-duplex.
2
MODBUS RTU
COMUNICATIONS GUIDE
RS-232 INTERFACE
An RS-232 interface is rated for distances up to 15 meters (50 feet). At least three wires are required for an RS-232 interface. Wires are required for Transmit, Receive and Signal Ground. Some devices support additional wires for communication handshaking. RS-232 hardware is a full-duplex configuration, having separate Transmit and Receive lines.
RS-422 INTERFACE
An RS-422 interface requires at least four wires. Two wires each are used for Transmit and Receive. A fifth wire is usually required for Signal Ground, when connecting non-isolated devices together. Handshaking lines may also be supported by some hardware. This interface is full-duplex, allowing use of the same software drivers as for RS-232. The differential drivers allow for distances up to 1200 meters (4000 feet). The receivers of an RS-422 device are always enabled. For multi-drop operation, drivers must capable of tri-state operation.
RS-485 INTERFACE
An RS-485 interface requires at least two wires. In a two-wire configuration, the same pair of wires is used for Transmit and Receive. The two-wire configuration utilizes half-duplex communications. A four-wire configuration functions much like an RS-422 system, except the Transmit driver circuits are always taken off­line or tri-stated, when not in use. This tri-state feature reduces the load on the network, allowing more devices, without the need of special hardware. A fifth wire is usually required for Signal Ground, when connecting non-isolated devices together. Additional wires for handshaking may also be supported by some hardware. This interface also uses differential drivers, supporting distances up to 1200 meters (4000 feet).
BIAS RESISTORS
RS-422 and RS-485 networks often require bias, or pull-up and pull-down resistors. These resistors are used to stabilize the network. By definition, in a MODBUS RTU network, it is the responsibility of the Master to provide this function. Functionally, any device on the network may provide the bias stabilization. Biasing may also be installed external to the devices, with the appropriate resistors and power supply. If the Master is not the device providing this function, careful consideration must be given to the consequences of that device failing. If the Master is providing this function, and it fails, there would be no communications anyway. In some systems, bias resistors may be installed on two slaves, offering redundant biasing. This feature is available with MOD30ML and Modcell MLP modules (TERM switch). Some systems may function without these stabilizing resistors, but may be more susceptible to communication errors. Though the pull-up and pull­down resistors are the same, the value of these resistors varies from device to device. The actual recommended resistance may be calculated, and varies with the number of devices on the bus. Commander series instruments use 1.8KΩ, while MOD30ML and Modcell use 560Ω. The pull-up resistor is connected from the positive communication line to +5Vdc. The pull-down resistor is connected from the negative communication line to the power supply common.
TERMINATION RESISTORS
Termination resistors are often used to reduce reflections on the network. This problem occurs most with long wires and high baud rates. Due to variations in wire and equipment, whether or not to use these terminators is usually determined by system testing. The general rule is to add them only if needed. The resistors are typically 120Ω, and installed across the Transmit and Receive wire pairs. Normally, one resistor is installed at each end of each pair of wires. For two-wire installations, one resistor would be installed at each end. If bias stabilization resistors are not installed, use of these terminations will probably drown the signal, preventing communications.
3
MODBUS RTU
COMUNICATIONS GUIDE
2-Wire Configuration
4-Wire Configuration
Figure 1. RS-485 Biasing and Termination
4
MODBUS RTU
COMUNICATIONS GUIDE

SOFTWARE BASICS

MASTER/SLAVE RELATIONSHIP
A MODBUS RTU system consists of a Master and one or more Slave devices. Multiple Masters are not permitted on the same network. The Master is responsible for initiating all communications, therefore, no peer-to-peer capability is supported. With some hardware, it is possible to dynamically switch the device between Master and Slave modes. This capability allows multiple Masters, though not simultaneously. With special hardware, such as Phoenix Digital’s MPE Plus, having multiple Masters is possible, though it limits the communications to the basic “Standard” MODBUS commands. Using the MPE Plus will block extended MODBUS communications, including the Application Builder.
MESSAGE RESPONSE TIMES
The MODBUS RTU protocol relies on precise timing for reliable communications. The message structure is such that a 3.5 character or greater pause will be interpreted as the end of a message. The actual time varies with the baud rate. Conversely, most devices require a defined minimum amount of time between messages. Another factor to consider is that each device has its own response time. This response time can be anywhere from a few milliseconds to a few hundred milliseconds. The Host must be configured to allow adequate time for the slowest device to respond.
INSTRUMENT RESPONSE TIMES TO HOST COMMANDS
These times represent the maximum time from when the instrument receives a request from the master, to when it begins to send the response.
Table 2. Instrument Response Times
Device Max Response Time Device Max Response Time
C100 250 mSec C1900 250 mSec C150 250 mSec Modcell MLP 60 mSec * C200 250 mSec 2050R 100 mSec C300 180 mSec MOD30ML 60 mSec * C310 160 mSec MR250 125 mSec C500 125 mSec PR100 90 mSec
* NOTE: The response times for Modcell MLP and MOD30ML are for read
messages. Write messages may take longer. These instruments have a configurable Write Message Timeout parameter.
5
MODBUS RTU
COMUNICATIONS GUIDE
SOFTWARE DRIVERS
Table 3. Software Drivers
Driver Description Use With
1719S Standard MODBUS Driver PC-30 and GFW 1733S Extended MODBUS Driver PC-30 and GFW 2010S EMP 16-bit Standard and Extended MODBUS Driver FIX 5.x for Windows 3.x 2011S EMP 32-bit Standard and Extended MODBUS Driver FIX 6.x for Windows 95 and NT I/O Server Standard MODBUS GFW DDE Server Standard MODBUS Wonderware InTouch OPC Server Standard and Extended MODBUS GFW32, FIX Dynamics and
other OPC Clients MODCELL Enhanced Standard MODBUS Citect MODBUS Standard MODBUS Citect and others
6
Loading...
+ 22 hidden pages