LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing multiple waveforms to file (including time data)

Hi,
 
I'm having troubles in writing 4 different waveforms along with the time data to a file (VI attached). Even though the four waveforms are the same in this VI, I'd actually create different waveforms. But they will have the same time data (i.e. dt and t0). Right now I can only write 1 waveform to the file. Is there a way to actually write them all to 1 file?
 
I tried using Write To Measurment File Express VI. This does give me the time data along with the four Y data as well. However, the column widths for all the data aren't the same (as you can see when you run this VI).
 
Thanks in advance.


Message Edited by imperial-aero on 03-01-2008 05:53 PM
0 Kudos
Message 1 of 9
(8,169 Views)

I don't understand at all your comments. You create a single waveform and then make an array with 4 elements from it. Each waveform in the array will be identical. Then you do a save of the waveform array and the results have a single time column (by your selection) and 4 columns of data that are identical. Each column is one of the waveforms. Everything that you have created is in the file. Even if you had 4 different waveforms, you would need to specify separate time columns in the Write to Measurement File. It also doesn't make any sense to record each waveform since each are the same.

The file created by the Write to Spreadsheet are correct as well. You create a column of time data and a single column of Y data inside the while loop. You pass that out and write it and that is what is inside the text file.

0 Kudos
Message 2 of 9
(8,160 Views)
Sorry, I wasn't clear  in my earlier post.
 
I've left the waveforms identical on purpose, I'll change them later once I figure this out (but they'll only change in magnitude and phase, so they should have the same t0 and dt, i.e. a single time column should be sufficient for the four different waveforms).
 
Right now I know that I obtain 1 column in the file becase I selected 1 waveform. But I want to find how I could select four waveforms together with their time information and save them in a single text file.
 
The Write Measurment to File does exactly this (four columns for the waveforms and 1 for the time), but due to the formatting of the VI, (for my particular case) it doesn't have uniform column widths throughout the file. You will observe this when you open the saved file.
 
So I want to be able to either,
 
1) Use the Write to Spreadsheet VI to save four waveforms with their time info

OR
 
2) Change the formatting of the Write Measurement to File so that the saved file has uniform column widths.
 
Thank you.
 
0 Kudos
Message 3 of 9
(8,157 Views)
Sorry, I don't see what you mean by different column widths. The file created by the Write to Spreadsheet file looks just like the one created by the Write to Measurement File. Each column is separated with a tab. Do you want a negative number to have the same number of characters as a positive number?
 
If you want to use the Write to Spreadsheet file to save 4 channels of data, you just have to add the additional channels and time infor like you are doing with the single channel and time info for it. It would be a 2D array with more columns.
0 Kudos
Message 4 of 9
(8,147 Views)

Thank you for the help Dennis. I've now set up the file that has more columns (picture attached). I've got the column width problem with this file as well. I've attached a picture to show you what I mean. 

I realise that they are different because of the negative sign associated with some of the numbers. So, I guess what I really want is that both the negative and positive numbers to have the same number of characters. But this would mean that the negative numbers will have less significant figures wouldn't it? And also, how will I go about achieving this?

Cheers.

 

Download All
0 Kudos
Message 5 of 9
(8,138 Views)
Hi searching in the web i found Imperial with a problem like mine, I'm working with a NI4350 TBX68T and 12 diferent waves that i must record i develop my own appreciation of what the Vi shoul work, but it doesn't work as i imagene, if someone could help thanks.

BSTRGDS
0 Kudos
Message 6 of 9
(8,045 Views)
I forgot to mention that i'm using labview 6, so It doesn't support the MAX to create a DAQ tool
0 Kudos
Message 7 of 9
(8,040 Views)
The LVM format is tab delimited, there is a single tab character between each element in a row. So whether or not the columns visually lineup depends on what you open them with. Excell or any other spreadsheet program (and most any program that can do data analysis) should handle tab delimited files in the expected manner. Notepad looks funny because the negative sign makes the numbers line up on the next tab separation (which I think are every four spaces in notepad).

Matt W
0 Kudos
Message 8 of 9
(8,021 Views)

What about using TMDS?  I just looked at this thread very quickly and didn't see where you mentionned constraints, such as the ability to read the file from a text editor.. or using Excel (although Dennis does talk about it).  😉



Message Edited by JoeLabView on 03-12-2008 10:08 PM
0 Kudos
Message 9 of 9
(8,019 Views)