11-24-2005 09:36 AM
11-24-2005 09:59 AM
11-24-2005 02:28 PM
Many application CAN read plain binary data if you tell them the binary format and data type. One complication under Windows is the fact that LabVIEW writes big-endian binary format, while most other W32 programs are little-endian. You need to reverse the bytes in each DBL.
Unfortunately my matlab knowledge is limited, but you should be able to read it with the right commands. Good luck! 🙂
11-25-2005 10:58 AM
12-15-2005 11:09 AM
Yes, the problem is most likely with the endian, LabView was developed for the Mac, as such it reads big endian (or little endian, i get them mixed up), and Intel machines are the opposite (or course). I have had this problem repeatedly. I have written a small program which will correct the endian, I have attached it. You will have to put this endian swap program inside a for loop and swap every single word.
You can rewite the program for signed intergers and floats too.
Please let me know if this works for you.
Chris
08-03-2012 05:26 PM
Thanks for this post, I was trying to import data into matlab and was getting garbage, turns out it was the endianness. Here's what I used in matlab to read an array of double that I wrote using the 'write to binary file' VI.
example for a 1D array of 5 elements of double type
fid = fopen('c:\test.dat','r','b');
f = fread(fid, [5],'double',0,'b')
it's the 'b' parameter that specifies to read the file as big endian
Thanks!