LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to output a waveform to a file

the waveform is a cluster with 3 elements,while the write to spreadsheet.vi only accept 2-d array,how can i do ?thanks a lot!
0 Kudos
Message 1 of 7
(3,713 Views)
Three elements are initial time(t0), time increment (dt) and measured data. Use waveform components function to get array of data from the waveform and save it to a file.
0 Kudos
Message 2 of 7
(3,712 Views)
i am sorry,that doesn't work,waveform components function did not accept the cluster with 3 elements,what can i do?thanks!
0 Kudos
Message 3 of 7
(3,712 Views)
I am also sorry - but what are you trying to do? Waveform components function accepts waveforms, not clusters. What kind of data you want to save in a file? A waveform? There is functions to write waveforms to file in waveform palette.
0 Kudos
Message 4 of 7
(3,712 Views)
actually,the cluster is the output of the"read from osilloscope.VI"so it is composed of t0,deltat,data,so i can not wire it to any waveform function.thanks a lot!
0 Kudos
Message 5 of 7
(3,712 Views)
If it a cluster and not an actual waveform type, you can create one by first unbundling the clust and then wire the elements to the Build Waveform function and then use all of the regular waveform functions including Write Waveform to File or Export Waveform to Spreadsheet File. Where did the "read from oscilloscpe" function come from. I don't think it's part of the regular LabVIEW distribution so maybe you could attach it so someone could see what's the problem.
0 Kudos
Message 6 of 7
(3,712 Views)
Hi,
may be this will be the easy solution for you:
1. Unbundle your cluster into three elements t0-dt-data array with "unbundle" function from cluster palette.
2. Build these numbers into 1D array with "Build array" function from array palette.
3. Save this 1D array with "Write to spreadsheet.vi"

In this case you just need to remember that first two numbers in the file are t0 and dt.

Another solution is to create a "time" array t[i]=t0+dt*i in the loop with i changing from 0 to N-1, where N is the size of "data array" in your waveform. Then you can build these "time" and "data" arrays into 2D array and save it to a two-column spreadsheet file.

Good luck.

oleg Chutko.
0 Kudos
Message 7 of 7
(3,712 Views)