Table of Contents
Endianness
Endianness (also called byte order) matters when interpreting raw binary data, especially when splitting or reassembling multi-byte numbers. It describes the order in which bytes within a word data type are placed.
Endianness is primarily expressed as big-endian (BE) or little-endian (LE).
Little Endian
Little Endian systems store the least significant byte (LSB) of a multi-byte value at the lowest memory address.
[low-order byte] [high-order byte]
Used by: x86 / x86-64 (Intel, AMD), ARM (default mode on almost all consumer devices), RISC-V, VAX, Alpha
Big Endian
Big Endian systems store the most significant byte (MSB) at the lowest memory address.
[high-order byte] [low-order byte]
Used by: Motorola 68000 family (classic Macs, Amiga, early embedded), IBM POWER / PowerPC (older Macs, some embedded + servers), SPARC (can also operate bi-endian depending on model), Mainframes (e.g., IBM zSeries)
Byte Order in LabVIEW
LabVIEW uses Big Endian format for its binary numbers, while most Windows programs use Little Endian format. LabVIEW uses Big Endian, because that is what the MacOS uses, and LabVIEW was created first for the Macintosh.
Source
Converting an SGL to Two U16 in LabVIEW
LabVIEW offers two approaches to convert a 32‑bit single-precision float (SGL) into two 16‑bit unsigned integers (U16).
Type-casting an SGL to a U16[2] array correctly preserves all 32 bits, but the order of the two U16 elements reflects the system’s endianness, whereas the Split Numbers method (after type-casting to U32) always returns the high and low halves consistently, independent of endianness.
Using Type Cast to U16 Array
-
Place a Type Cast node.
-
Wire the SGL value into the input.
-
Create a U16[2] array constant and wire it to the “type” input.
-
The output array contains two U16 values representing the binary memory of the SGL.
Behavior: *The resulting order of the two U16 values depends on the memory layout (endianness) of the system.* For example, on a little-endian machine, the first U16 will represent the lower two bytes of the SGL.
Using the Split Numbers Function
The Split Numbers function always outputs:
-
hi(x) – the numerically high‑order half of the input value
-
lo(x) – the numerically low‑order half
Even though the system may store values differently internally, Split Numbers always gives consistent high/low order results.
Procedure:
-
Type cast the SGL to a U32 (not directly to U16).
-
Wire the resulting U32 into the Split Numbers function.
-
The output terminals provide high-order 16 bits (hi) and low-order 16 bits (lo)
-
Assemble the two U16 values depending on desired endianness:
-
For little endian output: wire lo first and hi second into a Build Array node.
-
For big endian output: wire hi first and lo second into a Build Array node.
This method is independent of system endianness and provides predictable, portable results.
vice versa
Summary
-
Type Cast U16[2] reflects the actual memory layout → endianness‑dependent.
-
Split Numbers consistently returns high/low numeric halves → endianness‑independent.
-
For portable or protocol-stable data exchange, Split Numbers is recommended.
Bit Order
The endianness or byte order is not to be confused with the bit order!
Bit order is about the order in which bits are shifted out, usually on a serial line (SPI, I²C, UART, CAN, etc.), or interpreted inside a byte. There are two main variants:
LSb-first (least significant bit first)
Common in:
-
SPI (configurable)
-
Some UART implementations
-
Many microcontrollers
Example (byte 0b1101_0011):
1 → 1 → 0 → 0 → 1 → 0 → 1 → 1
MSb-first (most significant bit first)
Common in:
-
Ethernet
-
USB
-
CAN
-
I²C
-
Most network protocols
Example (byte 0b1101_0011):
1 → 1 → 0 → 1 → 0 → 0 → 1 → 1


