# Addressing

For addressing a single value, use the following address format:

```
START_ADDRESS@DATA_TYPE, where START_ADDRESS indicates the area and the starting address of the element,
and DATA_TYPE – the data type
```

To address one of the bits of the word, you must use the following format:&#x20;

```
START_ADDRESS.BIT_INDEX, where START_ADDRESS indicates the area and the starting address
of the element, 
and BIT_INDEX – the bit number in the 16-bit word (from 0 to 15)
```

An array of values can be set using the following address format:&#x20;

```
START_ADDRESS[LENGTH]@DATA_TYPE, where START_ADDRESS specifies the area and the starting address
of the element, 
LENGTH – number of elements in the array, 
and DATA_TYPE – the data type
```

{% hint style="info" %}
Note that zero-based addressing is used for all types of data areas. This means that the addresses entered by the user are not shifted by 1 when constructing a Modbus frame
{% endhint %}

The table below maps data areas to supported address ranges, data types and access modes.&#x20;

| **Data Area**      | **Address Range** | **Data Type**                                                                                | **OPC UA Access Mode**                                 |
| ------------------ | ----------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| Output Coils       | 0 - 65535         | Boolean                                                                                      | Read/Write                                             |
| Input Coils        | 100000 - 165535   | Boolean                                                                                      | <p>Read Only,</p><p>Read/Write (in slave mode)<br></p> |
| Internal Registers | 300000 - 365535   | <p>Boolean, Byte, Word,</p><p>Int, DWord, DInt,</p><p>Float, Double, QWord, Long, String</p> | <p>Read Only,</p><p>Read/Write (in slave mode)</p>     |
| Holding Registers  | 400000 - 465535   | <p>Boolean, Byte, Word,</p><p>Int, DWord, DInt,</p><p>Float, Double, QWord, Long, String</p> | Read/Write                                             |

{% hint style="info" %}
For byte data type you must specify the byte order in the word (MSB or LSB) after the @ character, for example: 400000\@MSB&#x20;
{% endhint %}

The following are examples of available addresses:

* 400020\@INT
* 300001.14
* 300999\@FLOAT
* 400005\[10]INT
* 100035\[12]
* 000021


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/tags-and-devices/modbus-connectivity/addressing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
