From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-21-2007 12:05 PM
09-21-2007 12:15 PM
09-21-2007 12:15 PM - edited 09-21-2007 12:15 PM
Wire up a constant of 2 to the first function.
Message Edited by Ravens Fan on 09-21-2007 01:15 PM
09-21-2007 12:29 PM - edited 09-21-2007 12:29 PM
Simply reverse the array and typecast it to a I16. Voila! 🙂
There is no need to use anything pink! 😮
Message Edited by altenbach on 09-21-2007 10:30 AM
09-21-2007 01:31 PM
😄
09-21-2007 06:46 PM
09-21-2007 08:18 PM
@jdunham wrote:
reversing the array only works with one value (admittedly that was the posed problem). But if you cast to I16 first, and then use Swap Bytes, you can convert an array of any size.
Sure, each new situation has its own optimized solution. For example if we had 4 bytes in an U8 array (little endian) and want an I32, you can no longer simply swap, but need a few more steps.
I always wondered why LabVIEW does not have a "reverse bytes" primitive in the "data manipulation" palette that would do it for any size numeric in one step (swap endian).
(Now JK will probably tell me that openg has one. 🐵
09-21-2007 09:15 PM - edited 09-21-2007 09:15 PM
@altenbach wrote:I always wondered why LabVIEW does not have a "reverse bytes" primitive in the "data manipulation" palette that would do it for any size numeric in one step (swap endian).
(Now JK will probably tell me that openg has one. 🐵
Message Edited by Jim Kring on 09-21-2007 07:15 PM
09-21-2007 09:17 PM
@altenbach wrote:
Sure, each new situation has its own optimized solution. For example if we had 4 bytes in an U8 array (little endian) and want an I32, you can no longer simply swap, but need a few more steps.
Well I had been pushing for NI to add that to the type cast function, but instead they finally added it to Flatten to String. The type cast is crazy because it reverses the endianness whether you want it to or not.
@altenbach wrote:
I always wondered why LabVIEW does not have a "reverse bytes" primitive in the "data manipulation" palette that would do it for any size numeric in one step (swap endian).
09-22-2007 02:50 PM
@Jim Kring wrote:
Want to write one?
Writing a simple one would be trivial, but what we really need Is something that handles any input (I64, SGL, U16, etc. as well as arrays and clusters of such in any topology and mix). This exceeds my programming skills. 🙂