# E17 Endianness

### Definition

Sets the **byte order** for multi-byte data during RX (flow meter response) transmission. Options: **Big Endian**, **Little Endian**, **Register Swap**, or **Byte & Register Swap**.\
Default: **Big Endian**.

This setting **does not affect** Modbus ID, function code, CRC, or single-byte data.

For example, when returning flow and flow rate data, the flow value (e.g., 1000 decimal = 0x00007A44) is still sent **before** the flow rate. However, the **order of the four bytes representing 1000** changes depending on the selected format.\
(The diagram below shows each diamond representing one byte.)

<div align="left"><figure><img src="https://docs.lorric.com/qr/~gitbook/image?url=https%3A%2F%2F598628291-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYbqXsfQyaXKmr6mxssGy%252Fuploads%252F8TXvmhXtzoghnGW9QkSG%252Fendianness.png%3Falt%3Dmedia%26token%3D8a6429b8-4cba-4a83-9797-d4939920d866&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=b61a042d&#x26;sv=2" alt=""><figcaption></figcaption></figure></div>

Example

The following shows an example of using **Function Code 04** to request the flow meter to return **instantaneous flow (FS + value)** and **totalized flow (TF + value)**.\
(Each diamond in the diagram below represents one byte.)

<div align="left"><figure><img src="https://docs.lorric.com/qr/~gitbook/image?url=https%3A%2F%2F598628291-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FYbqXsfQyaXKmr6mxssGy%252Fuploads%252FuzspcU5ExoovvCdjSGQ1%252Fendian_example.png%3Falt%3Dmedia%26token%3Decb4d649-01d6-45e7-ba7b-6be3f5a1cd89&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=fe7f93e0&#x26;sv=2" alt=""><figcaption></figcaption></figure></div>

* **First row:** Command sent from the Master. This is **not affected** by this setting. For details, refer to **Modbus Function Code 04**.
* **Second row:** Response from the flow meter with **Big Endian** configured. From left to right, bytes **0x01–0x08** and **CRC1–CRC2** are **not data** and are unaffected by this setting. The order of **instantaneous flow (FS + value)** and **totalized flow (TF + value)** in the response is also unchanged.
  * Because Big Endian is selected, the four bytes of instantaneous flow (**FS3 → FS0**) are sent starting with **FS3**.
  * The four bytes of totalized flow (**TF3 → TF0**) are sent starting with **TF3**.
* **Third row:** Response from the flow meter with **Little Endian** configured. From left to right, bytes **0x01–0x08** and **CRC1–CRC2** are **not data** and are unaffected by this setting. The order of **instantaneous flow (FS + value)** and **totalized flow (TF + value)** in the response is also unchanged.
  * Because Little Endian is selected, the four bytes of instantaneous flow (**FS0 → FS3**) are sent starting with **FS0**.
  * The four bytes of totalized flow (**TF0 → TF3**) are sent starting with **TF0**.

#### Modbus Converter for different formats

{% embed url="<https://codepen.io/philo_lorric/pen/BagqoRj>" %}

#### **Byte Order Explanation**

Assume a **32-bit value** is composed of 4 bytes (**A = most significant byte, D = least significant byte**) and stored in **two 16-bit registers**. ($$\mathbf{Reg1 = A B}$$, $$\mathbf{Reg2 = C D}$$)。

| **Type**          | **Transmission Order (Hex)** |
| ----------------- | ---------------------------- |
| Big Endian        | $$\mathbf{A~~B~~C\~D}$$      |
| Little Endian     | $$\mathbf{D~~C~~B\~A}$$      |
| Mid Big Endian    | $$\mathbf{C~~D~~A\~B}$$      |
| Mid Little Endian | $$\mathbf{B~~A~~D\~C}$$      |

### Notes

1. E17 Endianness can be modified via RS485.
2. The setting must match exactly with the Master’s configuration.
3. For details, see the [RS485 and Modbus RTU](broken://pages/b85c0d01a25eb3e3bc2f56ebe3f6f8ea98b1e18a) Settings section.

### Operation Procedure

<details>

<summary><strong>Button Functions</strong> <em>(Click to Expand)</em></summary>

The main unit has **four buttons**. The **bottom line (Line 3)** of the LCD displays the current function of each button. Under normal operation, the button functions are as follows:

* <img src="/files/bdd75120acea6361d128fd3deec06f1a8277e667" alt="" data-size="line"> **Blue Button:** Leftmost button: Return, exit, or save settings.
* Gray Direction Buttons:
  * <img src="/files/2e37e572251371c6020ab6d9e11c1fcdd5ef0369" alt="" data-size="line"> **Left Gray:** Previous Page, decrease value, or select item
  * <img src="/files/50a67ff5744401e217d5b9e838da3f7909be732f" alt="" data-size="line"> **Right Gray:** Next Page, increase value, or select item
* <img src="/files/uJJ6BEZ4sukIlwQaHrUB" alt="" data-size="line"> **Orange Button:** Rightmost button: Enter settings, edit, or confirm selection

{% hint style="danger" %}
**Do not hold buttons for extended periods to avoid damage.**
{% endhint %}

{% hint style="info" %}
Button functions may change depending on the operation context to improve usability or prevent accidental presses
{% endhint %}

</details>

```
E17 Endianness Setting Steps
• From the main screen (green backlight), 
  press Orange Button (Setup) to enter settings (orange backlight).
• Use Gray Arrow Buttons to select E. Commute, press Orange Button (Enter).
• Use Gray Arrow Buttons to select E17 Endianness , press Orange Button (Enter).
• Use Gray Arrow Buttons to choose the options. 
• Press Orange Button (Set) to confirm.
• Press Blue Button (ESC) to return to the main screen (green backlight).
```

### E17 Options, RS485 Values, Read/Write Commands, and Formats

| Opitons              | Description          | RS-485 Value |
| -------------------- | -------------------- | ------------ |
| Big Endian (Default) |                      | 0            |
| Little Endian        |                      | 1            |
| Mid Big Endian       | Register Swap        | 2            |
| Mid Little Endian    | Byte & Register Swap | 3            |


---

# 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.lorric.com/qr/fp-as310-english-v5/parameters/e-commute/e-commute-fp-as310r/e17-endianness.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.
