Search code examples
tcpmodbus

Modbus TCP registers


I'm trying to read a register using pymodbus. The modbus input register I'm trying to read is 310301. Since registers need to be 65535 or below, how can I read this register?


Solution

  • 310301 looks to be an address specified in the "Modicon" notation, where the first digit indicates the Modbus table type (Holding Register, Input Register, Coil, Discrete Input).

    3xxxxx addresses are Input Registers, so try reading Input Register 10301.

    Generally, in this scheme:

    • Coils span from 000001 to 065536
    • Discrete Inputs span from 100001 to 165536
    • Input Registers span from 300001 to 365536
    • Holding Registers span from 400001 to 465536

    Sometimes you'll find manufacturers only use 5 digits to specify the address instead of 6. I find this practice deplorable because it leads to ambiguity, but what can you do...