Black Box LES431A manual Modbus Help Modbus ASCII/RTU Basics, Hints and Tips

Page 52

Chapter 7: Modbus Help

7. Modbus Help

7.1 Modbus ASCII/RTU Basics

The Modbus protocol emerged in the mid-1970s as an early protocol for linking terminals with Modicon PLCs using a master/slave (sometimes called a master/client) relationship. A simple, open, message-based protocol, it caught on quickly and became a

de facto standard in the industry. It supports asynchronous point-to-point and multidrop communications and can be used with a variety of serial interfaces (RS-232, RS-422, RS-485, modems, etc.).

The original Modbus specification included two possible transmission modes: ASCII and RTU. Modbus RTU mode is the most common implementation, using binary coding and CRC error-checking. Modbus ASCII messages mode, though somewhat more readable because it uses ASCII characters, is less efficient and uses less effective LRC error checking. ASCII mode uses ASCII characters to begin and end messages, whereas RTU uses time gaps (3.5 character times) of silence for framing. The two modes are incompatible, so a device configured for ASCII mode cannot communicate with one using RTU.

All Modbus communications are initiated by Modbus masters using a polling query/response format. The master can send broadcast messages (using a slave address of 0), which all slaves accept, but do not reply to. More commonly, the master polls individual slaves sequentially. In each poll, it sends a message containing a device address, followed by a function code, any data that may be required, and an error check field. The addressed slave responds with a similar message structure. Typically, it repeats back its address and the function code, and then sends a field indicating the number of bytes of data it is sending, followed by the data and the error check field.

Slave addresses can range from 1 to 247. Function codes include several common ones typically used in all applications and additional ones that may be implemented in specific cases. Common function codes include: Read Coil Status (01), Read Input Status (02), Read Holding Registers (03), and Read Input Registers (04).

When a master sends a message to a slave, it expects to receive a valid response within a certain length of time. If the slave does not receive the message, or if the slave receives the message but an error is detected, it does not respond. If the slave cannot respond appropriately for some other reason (e.g. it does not recognize the function code), it will return a message containing an exception response.

7.2 Hints and Tips

A few simple suggestions that may assist you if your system is experiencing problems include:

Slowing down the polling rate may be helpful if power cycling doesn’t cure the problem.

A common misperception is that every serial network must terminate with a resistor. While this was true of early serial network configurations, it’s typically the wrong answer—contact Black Box Technical Support at 724-746-5500 or info@blackbox.com and verify if you’re an exception.

A sometimes difficult problem is the difference in grounding voltage between various network locations. Stray voltage from lightning or other sources may also find its way onto the network. These conditions make isolation necessary in many settings.

Page 52

724-746-5500 blackbox.com

Image 52
Contents Modbus Hardened Serial Server Trademarks Used in this Manual Trademarks Used in this ManualFCC and IC RFI Statements NOM Statement Table of Contents Specifications SpecificationsSpecifications Dimensional Diagrams Features OverviewOverview Introduction What‘s IncludedLES431A front and back panels Modbus Hardened Serial Server Configuration Software LES431A componentsInstallation and Initial Setup Installation and Initial Setup Connecting the Power Supply1 RS-232 2 RS-422Connecting Modbus Hardened Serial Servers to a Network Modbus Hardened Serial Server Configuration ConnectionsModbus License Acceptance Screen Installation and Initial Setup Software Installing screen 10. Installation Complete screen Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup See the General Settings screen in Figure Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup Installation and Initial Setup 29. Type IP Address 31. Web properties screen Installation and Initial Setup Null-modem Cable Modbus Hardened Serial Server LES431A 35. Serial Port Selection Reloading Factory Defaults 36. Direct IP ConnectionUpgrading the Modbus Hardened Serial Server Firmware Upgrading the Modbus Hardened Serial Server FirmwareDownloading Firmware Files Uploading the Firmware to the Modbus Hardened Serial Server Diagnostics DiagnosticsTesting a Modbus Hardened Serial Server Connection Testing a Modbus Hardened Serial Server connection Application Examples Application ExamplesEthernet Master and Serial Slaves Application Examples Application Examples Modbus ID routing Modbus priority Serial and Ethernet Masters, Serial and Ethernet Slaves Port 1 ModbusModbus Slave ID routing Serial Masters, IP Slaves 11. Port 1 Serial12. Port 1 Modbus Identical Hard-Coded Slaves Identical Production LinesModbus Help Modbus ASCII/RTU Basics Modbus HelpHints and Tips Appendix a Default Modbus Hardened Serial Server Settings Appendix A. Default Modbus Hardened Serial Server SettingsAppendix B. Connector Pinouts DB9 M Connector Appendix B Connector PinoutsTerminal Block Standard Ethernet Cable RJ-45 Pinout Appendix C Glossary Appendix C. GlossaryBlackbox.com Blackbox.com Blackbox.com Black Box Tech Support FREE! Live /7