·
Module 07Addressing & Data Meaning8 min.md

Data Types

Overview

What you'll learn

INT16, UINT16, INT32, FLOAT, word/byte order, and the encoding traps you'll hit.

Sections
11
Labs
1
Quiz
7 Qs
What you'll be able to do
  • Decode INT16, UINT16, INT32, UINT32, and IEEE-754 floats from raw registers.
  • Identify ABCD / CDAB / BADC / DCBA word-order patterns from a capture.
  • Explain why a 'valid Modbus response' can still produce the wrong number.
Why you'll need this
  • "A 'voltage' reading is 1.8 × 10⁻⁴³ — what's the word order, and what should it actually be?"
Three things people get wrong
  1. 1.
    Reading a 32-bit value as one register
    Fix 32-bit values span two consecutive registers — request quantity 2, then assemble.
  2. 2.
    Assuming little-endian like a CPU
    Fix Modbus registers are big-endian (high byte first). Word order across the two registers is vendor-specific.
  3. 3.
    Trusting tool labels like 'swap'
    Fix Different tools use 'swap' to mean different things. Verify with a register whose expected value is known.
From the field

The float that crashed an alarm system

A new gateway changed default word order from ABCD to CDAB during a firmware update. Suddenly tank levels read as denormal numbers near zero — and the low-level alarm fired continuously. Rolling back the firmware was faster than rewriting the alarm logic, but the post-mortem demanded an explicit word-order column on every row.

Cited sources

Primary sources come from protocol and standards publishers. Secondary sources provide supporting tool, vendor, or reference context.

This module is paginated — step through the sections, run the labs, then take the quiz. Progress is saved locally.

Print one-pager →