Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Swap Words Function

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Owning Palette: Data Manipulation Functions

Requires: Base Development System

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.

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.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit