Modbus Reference Number Examples

Note: Direct Cell Access is only available on In-Sight vision systems using In-Sight firmware 4.x.x, and is not available on In-Sight vision systems running In-Sight firmware 5.1.0 and later. Refer to Firmware Versions for a complete list of models and supported firmware versions.

To reference a cell within the In-Sight spreadsheet from a Modbus device, the cell must be converted to a 2-byte Modbus Reference Number, as follows:

  • High 6 bits (Bits 11 to 15) = Column (A-Z)
  • Low 10 bits (Bits 0 to 10) = Row (0-399)

Example 1

To reference cell G273, the Reference Number would be converted as follows:

  1. Convert the cell's column and row to a decimal number.

    G = 06 {A = 0, B = 1, C = 2, ..., X = 23, Y = 24, Z = 25}

    273 = 273

  2. Convert the decimal numbers to binary (read right-to-left)

    Note: If the binary number is not 6 bits long for the column or 10 bits long for the row, the remaining bits in the final data byte must be filled with zeros (toward the high order end of the byte).

    G = 06 = 000110 (6 bits)

    273 = 273 = 0100010001 (10 bits)

    Bit

    15

    14

    13

    12

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

     

    0

    0

    0

    1

    1

    0

    0

    1

    0

    0

    0

    1

    0

    0

    0

    1

  3. This forms a 16-bit word, which is split into two 8-bit values.

    00011001 00010001

  4. Convert these two 8-bit values to their decimal equivalent.

    00011001 = 25

    00010001 = 17

  5. You now have the high byte (25 decimal) and the low byte (17 decimal) reference number.

Example 2

To reference cell N23, the Reference Number would be converted as follows:

  1. Convert the cell's column and row to a decimal number.

    N = 13

    23 = 23

  2. Convert the decimal numbers to binary (read right-to-left).

    N = 13 = 001101

    23 = 23 = 0000010111

    Bit

    15

    14

    13

    12

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

     

    0

    0

    1

    1

    0

    1

    0

    0

    0

    0

    0

    1

    0

    1

    1

    1

  3. This forms a 16-bit word, which is split into two 8-bit values.

    00110100 00010111

  4. Convert these two 8-bit values to their decimal equivalent.

    00110100 = 52

    00010111 = 23

  5. You now have the high byte (52 decimal) and the low byte (23 decimal) reference number.

Example 3

To reference cell Z399, the Reference Number would be converted as follows:

  1. Convert the cell's column and row to a decimal number.

    Z = 25

    399 = 399

  2. Convert the decimal numbers to binary (read right-to-left)

    N = 25 = 011001

    399 = 399 = 0110001111

    Bit

    15

    14

    13

    12

    11

    10

    9

    8

    7

    6

    5

    4

    3

    2

    1

    0

     

    0

    1

    1

    0

    0

    1

    0

    1

    1

    0

    0

    0

    1

    1

    1

    1

  3. This forms a 16-bit word, which is split into two 8-bit values.

    01100101 10001111

  4. Convert these two 8-bit values to their decimal equivalent.

    01100101 = 101

    10001111 = 143

  5. You now have the high byte (101 decimal) and the low byte (143 decimal) reference number.