LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading binary file

Hello, I am trying to read a binary file which has 3 arrays of data which will be plotted to a waveform graph, the program also takes a regular text file which it reads perfectly but I am having trouble with the binary files. I have provided my binary file and my text file so you can see what the data is supposed to look like. Ive changed the file formats so they can be uploaded here but the original text file is a .dat file and the binary file is a .d01 file. Any help would be greatly appreciated. 

0 Kudos
Message 1 of 4
(344 Views)

A binary file is just a collection of bytes. What they mean depends on how it was written. Who wrote the binary file and how?

 

We need to know the file structure. a *.d01 extension is not very common and there are many possibilities.

 

0 Kudos
Message 2 of 4
(337 Views)

@altenbach wrote:

A binary file is just a collection of bytes. What they mean depends on how it was written. Who wrote the binary file and how?

 

We need to know the file structure. a *.d01 extension is not very common and there are many possibilities.


And any developer could have written a program that stores whatever binary data he fancies into a file and chosen to use the *.d01 extension. That list is not even not exhaustive but just a small selection of possible formats using that extension.

 

So yes, without knowing who created that file, there is almost no way to usefully decode it. And if it was some random application written by some lab technician or similar, it is pretty much mandatory to see the source code of that application to be able to meaningfully decode that file.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 4
(270 Views)

From the text version, each row contains three floating point values and the second two values form a complex number (RE, IM). so most likely these are 32 or 64bit floating point components, but we still don't know the byte order. Even guessing all possible combinations, there are no obvious stretches/offsets that translate into reasonable values.

 

There is also a text header that does not seem to be encoded in pain text anywhere in the binary file, so it is either missing or compressed, for example.

 

If this files is written by a LabVIEW application, we would need to see the code. If it is from a well-known third party application, tell us the name of it.

0 Kudos
Message 4 of 4
(245 Views)