LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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



altenbach wrote:
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).


Sorry, typo!! Of course I meant:
 
  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. I16 data starting at position 29. This needs to be reshaped to 2D according to (point 2).


Message Edited by altenbach on 11-20-2007 10:01 AM
0 Kudos
Message 11 of 22
(1,580 Views)
Wow, that's awesome!  Thank you!

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 12 of 22
(1,565 Views)

hello altenbach

I work with Dawn R and am trying to get some files converted. As I am a novice in Labview, I was wondering if you could give me some guidance as far as finding some of the parts you used in this diagram provied in the functions palette. Thank you,

rosie

0 Kudos
Message 13 of 22
(1,551 Views)

What is your LabVIEW version? The icons of some of these functions have changed over the years....

In this particular case, we have (left to right):

  1. read from binary file (Just read the file as one long string, doesn't really matter how. In older version, this was done slightly differently).
  2. String subset (string palette)
  3. typecast (make sure the type is of the correct representation)
  4. index array (aray palette)
  5. reshape array (array palette)

If you are talking about data files from a DAWN light scattering instrument (Wyatt), it will be probably not that simple unless things have changed dramatically with the new software (which I haven't really tried yet). Have you approached Wyatt for a detailed file specification? Is it public?

0 Kudos
Message 14 of 22
(1,545 Views)
thanks altenbach, I will try these steps. I was referring to the member Dawn R that I work with, the one who sent the A.10.txt file. I was just wondering how you implemeted the file in Lab view and what was entailed in the diagram. thanks
0 Kudos
Message 15 of 22
(1,540 Views)

Hello Altenbach, Thank you very much for your help, your example worked well for all my A1*.* files however I have 40 other directories I am trying to convert. The VI reads the other files however does not import them and display them. What  generically do I need to change or look at to have a successful reading for other files? i've included another example, what do I need to consider and how do I calculate when the data starts for the VI?

Thank you

rosie

0 Kudos
Message 16 of 22
(1,505 Views)
It looks to me like the "****" is a separator, indicating the end of the variable sized text header.
 
Maybe you can just dynamically get the subset boundaries by looking for positions relative to ****
 
Here's a simple way using "match pattern"
 
 


Message Edited by altenbach on 11-27-2007 12:30 PM
Download All
0 Kudos
Message 17 of 22
(1,497 Views)
Thank you so much Altenbach, your example worked for the files and has helped me greatly! Now that I learned what to look for I am trying to output the data to text or ASCII files to read the data as columns of data. I see in the functions palette a "write to text" function and a "write to spreadsheet" function, and when I try either of those, it will not work. More specifically it will not let me connect the output to the control. What control can I use or what can I do to achieve an ASCII file of data in columns?
 
Thank you
 
Rosie
0 Kudos
Message 18 of 22
(1,474 Views)


RosieT wrote:
More specifically it will not let me connect the output to the control.
What output to what control????
 
Just wire the 2D array to the "2D data" input of "write to spreadsheet file". What kind of problems do you have?
0 Kudos
Message 19 of 22
(1,469 Views)
Thanks Altenbach, when I connect the 2D array to the 2D data input to the "write to spreadsheet", it connects with no errors. However, nothing seems to be happening. I dont see any data to a spreadsheet. Also when I try to connect the 2D data to the input of "write to text" it does not like it. What can I do to read it in a speadsheet?
 
Thanks
 
 
0 Kudos
Message 20 of 22
(1,449 Views)