I need to read data saved by another application into LabVIEW. The
other app's data is apparently saved in a byte order for direct easy
reading into C programs. It seems LabVIEW must swap the byte order.
Most of the data and header info parameters are INT32. I can
successfully read them in using Read File with Unsigned Long byte
stream type and swap the byte order to obtain a graph that appears the
same as when the data is read instead into the other app. However,
the one header parameter value that is type float (4 byte) is
incorrect as reported by LabVIEW.
Its raw 4 byte unsigned long value in the array returned by Read File
before swapping when passed to a numeric indicator of binary format is
0100101010010001000101010011110
1
LabVIEW interprets this as 1251022080.00 when displayed as a Single.
After byte swapping, it is 1024823616.00. Its value should be
0.036516.
The bytes are swapped using Split Number to give two 16 bit words,
Swap Bytes to rotate each of those, then Join Number to recombine
them. Join Number's inputs are wired to "cross over" and swap the 16
bit words. So ABCD gets split into AB and CD. Swap Byte gives BA and
DC. These are crossed over (hi word and low word wires re-arranged)
to give DC and BA. These are Joined to give DCBA.
I've tried not swapping it, and just swapping its two 16 bit words,
and swapping the two bytes within each of the two words but none give
the correct value. I tried using a Single as the byte stream type
when reading the data. I tried using 8 bit unsigned byte stream type
also and combining the bytes in different orders. Does LabVIEW
require byte swapping differently for Unsigned Long values compared to
Single ?
Steve