Swap Words Function
- Updated2025-01-28
- 2 minute(s) read
Swap Words Function
Swaps the high-order 16 bits and the low-order 16 bits for every long integer in data.
For example, if the input in hexadecimal format is 1234567890ABCDEF, this function swaps 1234 with 5678 and 90AB with CDEF, returning 56781234CDEF90AB. The connector pane displays the default data types for this polymorphic function.

Inputs/Outputs
![]() data is an integer, an array of integers, or a cluster containing integers that you want to word swap. In the case of a cluster that contains integers, this function swaps only the integer elements of the cluster. If you want to byte-swap floating-point or fixed-point numbers, use the Type Cast function to cast the value to a 1D array of bytes. Then use the Reverse 1D Array function and type cast it back to a floating-point or fixed-point number. Neither refnums or variants are valid inputs. Both will break the input wire.![]() word swapped is of the same data type and structure as data. |
FPGA Module Details
The following details apply when you use this object in an FPGA VI.
Single-Cycle Timed Loop | Supported. |
Usage | You cannot wire a fixed-point data type to this function. |
Timing | This function requires no clock cycles to execute because it does not include an internal register. |
Resources | This function consumes no FPGA resources because it is purely a wiring operation. |