# 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-lt-english-v1/communication/rs485-modbus-rtu) Settings section.

### Operation Procedure

<details>

<summary><strong>Button Functions (Click to Expand)</strong></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="https://content.gitbook.com/content/i4ECt41Kyy9211OWazj4/blobs/BZuNjMgY75LH0onY5NtL/image" alt="" data-size="line"> **Blue Button -** Leftmost button: Return, exit, or save settings.

Gray Arrow Buttons:

* <img src="https://content.gitbook.com/content/i4ECt41Kyy9211OWazj4/blobs/Br88VpmnPLAPdutxVdZb/image" alt="" data-size="line"> **Left Gray Button:** Page up, increase value, or select item
* <img src="https://content.gitbook.com/content/i4ECt41Kyy9211OWazj4/blobs/3Dzp8nuxmHsaZ7LqBscw/image" alt="" data-size="line"> **Right Gray Button:** Page down, decrease value, or select item
* <img src="https://content.gitbook.com/content/i4ECt41Kyy9211OWazj4/blobs/sq6fX6r39JE0Au2hahAR/image" 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).
```

<figure><img src="https://3404778090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi4ECt41Kyy9211OWazj4%2Fuploads%2FZC0syOXrWKyA8o2XUVg4%2FFU-LT-E17-en.png?alt=media&#x26;token=f8b57995-528f-47df-a2f8-4627837493f2" alt="" width="375"><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-lt-english-v1/communication/modbus-rtu-protocol/read-write-memory-ram) for the Modbus command format. This parameter uses the Int16 data format.
