MODBUS Address Table

A range of 128 kbytes is allowed for the access via MODBUS, i.e., the segments line 0 and line 1 of the addressable flag area (%M area) can be accessed. Thus, the complete address range 0000hex up to FFFFhex is available for MODBUS.

The availability of the segments depends on the CPU. The size of the %M area can be found in the technical data of the CPUs and in the target system settings.

Inputs and outputs cannot be directly accessed using MODBUS.

Address assignment (bit accesses)

The address assignment for bit accesses is done according to the following table:

MODBUS address

Byte

BYTE

Bit (byte-oriented)

BOOL

Word

WORD

Double word

DWORD

HEX DEC
Line 0
0000 0 %MB0.0 %MX0.0.0 %MW0.0 %MD0.0
0001 1 %MX0.0.1
0002 2 %MX0.0.2
0003 3 %MX0.0.3
0004 4 %MX0.0.4
0005 5 %MX0.0.5
0006 6 %MX0.0.6
0007 7 %MX0.0.7
0008 8 %MB0.1 %MX0.1.0
0009 9 %MX0.1.1
000A 10 %MX0.1.2
000B 11 %MX0.1.3
000C 12 %MX0.1.4
000D 13 %MX0.1.5
000E 14 %MX0.1.6
000F 15 %MX0.1.7
0010 16 %MB0.2 %MX0.2.0 %MW0.1
0011 17 %MX0.2.1
0012 18 %MX0.2.2
0013 19 %MX0.2.3
0014 20 %MX0.2.4
0015 21 %MX0.2.5
0016 22 %MX0.2.6
0017 23 %MX0.2.7
0018 24 %MB0.3 %MX0.3.0
0019 25 %MX0.3.1
001A 26 %MX0.3.2
001B 27 %MX0.3.3
001C 28 %MX0.3.4
001D 29 %MX0.3.5
001E 30 %MX0.3.6
001F 31 %MX0.3.7
0020 32 %MB0.4 %MX0.4.0 %MW0.2 %MD0.1
0021 33 %MX0.4.1
0022 34 %MX0.4.2
0FFF 4095 %MB0.511 %MX0.511.7 %MW0.255 %MD0.127
1000 4096 %MB0.512 %MX0.512.0 %MW0.256 %MD0.128
7FFF 32767 %MB0.4095 %MX0.4095.7 %MW0.2047 %MD0.1023
8000 32768 %MB0.4096 %MX0.4096.0 %MW0.2048 %MD0.1024
FFFF 65535 %MB0.8191 %MX0.8191.7 %MW0.4095 %MD0.2047

Calculation of the bit variable from the \ hexadecimal address:

Formula:
  Bit variable (BOOL) := %MX0.BYTE.BIT
where: DEC Decimal address  
  BYTE DEC / 8  
  BIT DEC mod 8 (Modulo division)

Examples:

  • Address hexadecimal = 16#2002

    DEC := 8194

    BYTE := 8194 / 8 := 1024

    BIT := 8194 mod 8 := 2

    Bit variable: %MX0.1024.2

  • Address hexadecimal = 16#3016

    DEC := 12310

    BYTE := 12310 / 8 := 1538,75 -> 1538

    BIT := 12310 mod 8 := 6

    Bit variable: %MX0.1538.6

  • Address hexadecimal = 16#55AA

    DEC := 21930

    BYTE := 21930 / 8 := 2741,25 -> 2741

    BIT := 21930 mod 8 := 2

    Bit variable: %MX0.2741.2

Calculation of the hexadecimal address from the bit variable:

Examples:

  • Bit variable := %MX0.515.4

    DEC := 515 * 8 + 4 := 4124

    Address hex := 16#101C

  • Bit variable := %MX0.3.3

    DEC := 3 * 8 + 3 := 27

    Address hex := 16#001B

  • Bit variable := %MX0.6666.2

    DEC := 6666 * 8 + 2 := 53330

    Address hex := 16#D052