# Starting Element

#### HPC

Hi ,

I have a modbus register map where in Zone 0, on top of modbus address column, it is written "Offset of 1". What does it mean?
What will be the "starting element" in Mervis for reading the status of the coil at, for example, modbus register 0x4042?

#### HPC

The first entries of this modbus map are as below:

 0 Zone : Coil Status OFFSET of 1 Parameters PLC Adress Modbus Adress Read/Write Remarks Current X0 0x0000 R High frequency pulse input High pressure protection of compressor X1 0x0001 R 0= Protection 1 = Normal Low pressure protection of compressor X2 0x0002 R 0= Protection 1 = Normal Thermal relay protection of compressor X3 0x0003 R 0= Protection 1 = Normal

#### David_2

1. Offset of 1
Usually 'offset of one' is used to explain the difference between counting starting at numeral zero and counting starting at numeral one. A one-based decimal address is one higher than its equivalent decimal zero based address. Problem is, your map is zero-based, starting at address 0x0000 for the current coil, as are most (if not all) maps with hexadecimal addresses.

Alternatively, the Holding registers in the (4)xxxx memory area are typically one-based, with the first register at (4)0001 (there is no (4)0000 register). Note that the leading numeral (4) is not part of the Modbus message, it's used only to identify memory area with Holding Registers to human beings.

But maybe it refers to the historical memory area for coils which uses the leading numeral zero to indicate the memory area for Coil register addresses, where is 0xxxx (5-digit addressing) or 0xxxxx(6 digit addressing).

Hex addresses show the zero-based address of the coil, needed for the start address in Function Code 01's operation.

If the master/client setup needed a one-based address (which I doubt), I'd expect to use (0)16451, where (0) is the memory area for coils, the indexed hex address, 0x4042 = 16450 decimal but is 16451st count from zero. Starting at one makes the 16451st register number (0)16451.

2. "Starting element" probably means "starting address" for the first coil, which is 0x4042.

#### HPC

1. Offset of 1
Usually 'offset of one' is used to explain the difference between counting starting at numeral zero and counting starting at numeral one. A one-based decimal address is one higher than its equivalent decimal zero based address. Problem is, your map is zero-based, starting at address 0x0000 for the current coil, as are most (if not all) maps with hexadecimal addresses.

Alternatively, the Holding registers in the (4)xxxx memory area are typically one-based, with the first register at (4)0001 (there is no (4)0000 register). Note that the leading numeral (4) is not part of the Modbus message, it's used only to identify memory area with Holding Registers to human beings.

But maybe it refers to the historical memory area for coils which uses the leading numeral zero to indicate the memory area for Coil register addresses, where is 0xxxx (5-digit addressing) or 0xxxxx(6 digit addressing).

Hex addresses show the zero-based address of the coil, needed for the start address in Function Code 01's operation.

If the master/client setup needed a one-based address (which I doubt), I'd expect to use (0)16450, where (0) is the memory area for coils, the indexed hex address, 0x4042 = 16450 decimal, and starting at one makes the 16450th register number (0)16451.

2. "Starting element" probably means "starting address" for the first coil, which is 0x4042.
Thanks alot.