LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting bin files from LV 2 (on a Mac) to ASCII

Highlighted
I inherited a large number of data files that were collected on an Apple Quadra 950 using LV 2, and I need to convert them to an ASCII format.  We've tried the Read Binary Files.vi that comes with LV, and found out that (in 1993), LV was in Big Endian format, but even with that, we don't get the data we expect.  I don't have the .vi or the lab notebook this was collected on.  We have installed LV 8 on a Mac running pre-OS X.
 
Thanx!
 
Dawn R
0 Kudos
Message 1 of 22
(1,590 Views)
Highlighted
Dawn R,

I don't currently have LV2 on this computer, so I can't check things directly. I do not recall how the binary file VIs worked in those days.

You say that you do not get the results you expect. Do you have a good idea of what was recorded in the files? I still have the manuals and the original disks so I might be able to figure something out. Is there any chance you can locate a copy of the program which created the files?

If you can post a small file along with what you expect it to contain, I will take a look.

Lynn
0 Kudos
Message 2 of 22
(1,575 Views)
Highlighted

 

My colleague wrote  a tech report in which she stated that she collected 12 sets of data, sampled at 4kHz for 3 seconds with LV 2.0 on specified hardware (I have the board numbers if that would help), so I'm expecting about 144k numbers (4000 x 3 x 12).  We use the read binary, and get ~40k values (on a Mac running LV 8.2), but that defaults to the Win file order and 8bits/DBL.  What I can't find/figure out is how many bits/what format these data files were saved to.  There are several hundred data files, so I (obviously) would prefer to automate this reading.  Another (similar) tech report reports 9 columns of data, but still sampled at 4kHz for 3 seconds, so ~40k data points is not enough either way.  If you want me to, I can post a representative data file, but they are NOT small, and I'm uncomfortable parsing it.

I inherited a couple of 3.5" floppies of which one is not readable by either Mac or PC format, so I'm guessing that had the vi on it.

Thanx for helping!

0 Kudos
Message 3 of 22
(1,569 Views)
Highlighted


Dawn R wrote:
...LV was in Big Endian format,
LabVIEW is still in big endian format on any platform.
 
Easiest would be to just read the file as a string and then try to unflatten it accrding to some likely pattern. Do you know if the data is DBL or SGL or one of the integer formats? Is it one data type or does it e.g. contain a header?
 
Why don't you attach one of your files and we'll see if anything can be determined by trial and error. 🙂
 
---------------------------
See e.g.
 
 
for one way to analyze a binary file.


Message Edited by altenbach on 11-13-2007 01:39 PM

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 4 of 22
(1,569 Views)
Highlighted

Sorry it took me to long to get back.. Does it matter if I upload it from a PC or a MAC at this stage of the game? 

Thanx!

Dawn

0 Kudos
Message 5 of 22
(1,525 Views)
Highlighted


Dawn R wrote:
Does it matter if I upload it from a PC or a MAC at this stage of the game? 
No, that won't matter.

LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 6 of 22
(1,523 Views)
Highlighted
 
Here is one.  Again, either 9 or 12 (her notes are confusing) columns of data, sampled at 4kHz for 3 seconds.  Anything else I forgot?
 
This is a binary file, I had to change to extension from .bin to .txt to get it to upload.
0 Kudos
Message 7 of 22
(1,508 Views)
Highlighted
Dawn R,

The file has 312029 bytes. If the first 29 bytes represent a header, then the remaining 312000 bytes can be factored as 3 * 4000 * 26. (The first 29 bytes look like thy 26 bytes per sample does not work well for either 9 or 12 columns of data. Thirteen columns of two byte words would fit. The thirteenth column could be a timestamp or sample number. If any of these is correct, the data would likely have been stored as raw binary rather than scaled single or double representation.

I tried several combinations of these things and did not get anything which looked like an array of meaningful data. By that I mean that I did not see any patterns by row or column.

Do you know what kind of DAQ board was used to collect the data? A Lab-NB or MIO-16 family?

Lynn
0 Kudos
Message 8 of 22
(1,499 Views)
Highlighted
All is big endian. This is nice a simple! 🙂
 
You have:
  1. 21 byte text header (DATA:ADAMS 1.10\r****\r in this case)
  2. 2x I32, designating the 2D dimension of the data (13x12000 in this case)
  3. I32 data starting at position 29. This needs to be reshaped to 2D according to (point 2).

(There are only 13 plots, so disregard the legend size ;))



Message Edited by altenbach on 11-20-2007 09:42 AM

LabVIEW Champion. It all comes together in GCentral GCentral
Message 9 of 22
(1,486 Views)
Highlighted
And here's one possible diagram:
 


Message Edited by altenbach on 11-20-2007 09:53 AM

LabVIEW Champion. It all comes together in GCentral GCentral
Message 10 of 22
(1,482 Views)