766  Modbus Modes and Timing Analysis

Comparing RTU, TCP, and ASCII modes with performance analysis and timing calculations

animation
modbus
industrial
protocols

766.1 Learning Objectives

By the end of this chapter, you will be able to:

  1. Compare the characteristics of Modbus RTU, TCP, and ASCII modes
  2. Calculate timing parameters for serial communication (character time, T1.5, T3.5)
  3. Estimate throughput and protocol efficiency for different configurations
  4. Select the appropriate Modbus mode for specific industrial applications

766.2 Introduction

Modbus supports three transmission modes, each optimized for different physical layers and use cases. Understanding the timing characteristics and trade-offs of each mode is essential for designing reliable industrial communication systems. This chapter provides interactive tools for analyzing timing and comparing mode characteristics.

Think of the three modes like different ways to send a letter:

  • RTU (Remote Terminal Unit): Like sending a telegram - fast, compact, but needs precise timing
  • TCP/IP: Like sending an email - works over networks, reliable, but needs internet infrastructure
  • ASCII: Like sending a letter with words spelled out - slower but human-readable

Each has its place depending on your β€œpostal system” (physical network)!

766.3 Mode Comparison

766.4 Timing and Performance

766.5 Key Timing Concepts

NoteRTU Timing Requirements

T1.5 (Inter-character timeout): Maximum gap between characters in a frame. If exceeded, the frame is considered incomplete.

T3.5 (Inter-frame timeout): Minimum silence before a new frame can start. This marks frame boundaries.

At 9600 baud with 11 bits per character: - Character time = 11/9600 = 1.146 ms - T1.5 = 1.719 ms - T3.5 = 4.010 ms

For baud rates > 19200, fixed times are used: T1.5 = 750 us, T3.5 = 1.75 ms

766.6 Mode Selection Guide

TipWhen to Use Each Mode

Use Modbus RTU when: - You need maximum efficiency on serial links - Equipment supports RS-485 multi-drop - Timing can be precisely controlled - Standard industrial automation applications

Use Modbus TCP when: - Connecting over Ethernet/IP networks - Long distances or multiple buildings - Integration with IT infrastructure - High-speed polling requirements

Use Modbus ASCII when: - Debugging serial communication issues - Equipment only supports ASCII mode - Timing tolerances are loose - Human-readable traffic is important

766.7 Key Takeaways

TipSummary
  1. Modbus is the most widely used industrial protocol - Simple, robust, and well-supported by virtually all industrial equipment vendors.

  2. Three modes for different needs:

    • RTU: Most efficient, binary format, requires precise timing
    • TCP: Modern networks, higher speed, easier integration with IT systems
    • ASCII: Human-readable, good for debugging, slower
  3. Four register types cover all data:

    • Coils (bits, R/W) and Discrete Inputs (bits, R)
    • Holding Registers (16-bit, R/W) and Input Registers (16-bit, R)
  4. Error handling is built-in: CRC-16/LRC checksums and exception responses provide reliable error detection.

  5. Master-slave architecture is simple but requires polling - no event-driven notifications.

766.8 Knowledge Check

NoteQuick Quiz: Mode Selection

Question: You need to connect a SCADA system to 50 PLCs across 3 buildings with a maximum distance of 500 meters. Which Modbus mode is most appropriate?

  1. Modbus RTU over RS-485
  2. Modbus TCP over Ethernet
  3. Modbus ASCII over RS-232
  4. Any mode would work equally well

b) Modbus TCP over Ethernet - For 50 devices across multiple buildings, Ethernet is the best choice because: - RS-485 is limited to 32 devices without repeaters - RS-485 has a 1200m maximum distance limit - TCP/IP can be routed between buildings - Ethernet switches can easily support 50+ devices

766.9 Summary

  • RTU: Binary framing, CRC-16 checksum, most efficient, timing-critical
  • TCP: MBAP header, no CRC (TCP provides reliability), routable, scalable
  • ASCII: Hex-encoded, LRC checksum, human-readable, 2x frame size
  • Timing formulas: Character time = 11/baud, T1.5 = 1.5 * char time, T3.5 = 3.5 * char time
  • Protocol efficiency: Data bytes / total frame size (typically 40-80% depending on message size)

766.10 What’s Next

Continue exploring industrial protocols:

This simulator is built with Observable JavaScript (OJS) and D3.js. Key features:

  • Real CRC-16 calculation: Uses the Modbus polynomial (0xA001) with proper bit reflection
  • LRC calculation: Two’s complement checksum for ASCII mode
  • Frame generation: Dynamically builds correct request/response frames for all function codes
  • MBAP header: Proper TCP framing with transaction ID and unit identifier
  • Exception simulation: Demonstrates all common exception codes

The visualization updates reactively as you change parameters, providing immediate feedback on frame structure and timing.