# 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](https://docs.lorric.com/qr/fu-es-echosense-instruction-manual/communication/rs485-setup) Settings section.

### Operation Procedure

<details>

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

When the main screen is displayed in **green backlight**, the four buttons function as follows:

* <img src="https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2FRnX1fMK1ja5FUx043ZYc%2Fimage?alt=media&#x26;token=f31dd577-ba27-4369-af8b-25ce9afcd1f9" alt="" data-size="line"> **Blue Button (leftmost):** Return, exit, or save settings.
* Gray Direction Buttons:
  * <img src="https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2FR48KXgI2flteQ78PYH8a%2Fimage?alt=media&#x26;token=b5b4ab82-6f88-44c6-8b85-181c7bde6fe9" alt="" data-size="line"> **Left Gray:** Previous Page, decrease value, or select item
  * <img src="https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2FVWLxHCjTZgj8Y3CXUn6X%2Fimage?alt=media&#x26;token=35556f59-f963-4b03-8db1-34f2953ddb58" alt="" data-size="line"> **Right Gray:** Next Page, increase value, or select item
* <img src="https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2F0lsHAW4cWIphk6mKtEoK%2Fbutton-orange.png?alt=media&#x26;token=9168c231-821c-4895-9194-0cf61b2fd06a" alt="" data-size="line"> **Orange Button (rightmost):** 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).
```

<figure><img src="https://4028902321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSBz5Tlpy8GCIkK4ygkgZ%2Fuploads%2Fik6fEfDtD5txQrX7HGRe%2Ffu-es-E17-en.png?alt=media&#x26;token=95ac678f-0e51-4fc2-a81e-dd253e873f82" alt="" width="563"><figcaption></figcaption></figure>

### 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            |

> Refer to the [Read/Write Memory List](https://docs.lorric.com/qr/fu-es-echosense-instruction-manual/communication/modbus-rtu-protocol/read-write-memory-ram) for the Modbus command format. This parameter uses the Int16 data format.
