LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing/reading a waveform to/from a file

How do I write a wavefrom (from the Formula.vi) to a file? The file has to be of type that I can reread back into Labview or Matlab for analysis (post processing). On the same note. How do I read from the file created above. The example shipped with Labview 6.0 doesn't work.
0 Kudos
Message 1 of 7
(3,989 Views)
Here is a small example of writing and reading waveform data to a file. The example generates and saves new data, or will read data that was saved to file from a previous run. (Note: the file will be C:\test.dat)

Hope this helps.
0 Kudos
Message 2 of 7
(3,989 Views)
Steve,
When I come out of the Formual.vi (shipped wih LABView)I have a brown cluster wire. I tried to substitute it for the data wire you are using to write to the external file. This doesn't seem to work with yourRead/Write vi.
0 Kudos
Message 3 of 7
(3,989 Views)
Steve,
Played this some more and got it to work. Thanks !
0 Kudos
Message 4 of 7
(3,989 Views)
If you are using waveforms (the brown cluster wire), you'll need to use the Waveform File I/O vi's. Steve W's example uses arrays. Attached is a modified version that saves and reads a waveform data type. If you want to read it with other programs, use the Export Waveforms to Spreadsheet File.vi. This will save it in a format readable by Matlab, Excel, etc.

~Tim
0 Kudos
Message 5 of 7
(3,989 Views)
Great. Sorry about the mix up with the waveform data type, I had confused the .vi you were talking about with another one.
0 Kudos
Message 6 of 7
(3,989 Views)
The program you wrote reads the first waveform in record but for my application I need to read from all waveforms in record because my waveform is composed of data from three channels. When I try to modify your program I get an error when trying to take the data out of the loop. How do I read all my waveforms?
0 Kudos
Message 7 of 7
(3,989 Views)