LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab int16 and labview int16

I used labview 7.0 to create a int16 binary file by the "Write to I16 file.vi". When I try to read this file as int16 type in Matlab 7.0, it seems like the value was timed by a factor of 256. For example, a value of 5 in labview int16 file would become 5x256=1280 in matlab. The problem now is if the data value in labview int16 file is greater than 128, than the data value in matlab would exceed 128*256=32768. Do I need to do any data type change before reading this file in matlab?
Thanks a bunch!

Julian
0 Kudos
Message 1 of 3
(3,272 Views)
Big Endian vs Little Endian. Use the 'Swap Bytes' function (Advanced pallette>>Data Manipulation).

0x0005=0d0005 is being read as 0x0500=0d1280

and you may want to take a look at Writing Binary Files with LabVIEW That Can Be Read by Other Applications

Message Edited by Donald on 04-25-2005 03:11 PM

=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 2 of 3
(3,261 Views)
Thanks a lot, Donald!
0 Kudos
Message 3 of 3
(3,251 Views)