LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading binary data

I have a file with 41 channels in it... every chn is 4 byte. So I want to
make a VI reading every 41x4 bytes put it in an array and write to ASCII
text file.

I am very new to LabView.

Can anyone point me to an example?

I was searching here http://www.ni.com/devzone/dev_exchange/ex_search.htm
but could not understand which one might be an example for me?

TIA
0 Kudos
Message 1 of 3
(2,705 Views)
For reading binary, there's one example called Read Binary File that reads a file of DBLs. You can modify this to read whatever you want. If your data is integers, wire an I32 constant to the byte stream type input of the Read File function. If your data is floating point, replace with a SGL constant. Both I32 and SGL are 32 bits so you'll have to know what the files were saved as. There are also a couple of functions on the File I/O>Binary File VIs palette that you should look at. They are Read From I16 File and Read From SGL File. They can also be modified and saved as different names. What you have to do is find the subVI that has the File Read function in it and change the byte stream type to match the format of your data.

Once you've read the data, t
hen the easiest way to save it as text is the Write to Spreadsheet File function on the File I/O palette.

If you have problems, it would help if you could attach a file with sample data and details on how the file was created.
0 Kudos
Message 2 of 3
(2,705 Views)
On 2004-02-22 03:39:44 +0100, "Volvo" said:

> I have a file with 41 channels in it... every chn is 4 byte. So I want to
> make a VI reading every 41x4 bytes put it in an array and write to ASCII
> text file.
>
> I am very new to LabView.
>
> Can anyone point me to an example?
>
> I was searching here http://www.ni.com/devzone/dev_exchange/ex_search.htm
> but could not understand which one might be an example for me?
>
> TIA

Any text-delimiters in the channel-file?

You want to read out a file and later write to a different file?
0 Kudos
Message 3 of 3
(2,705 Views)