LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export/write text file from waveform graph

Is there a simple way to do this? how should I obtain X and Y points to export into a text file?
Maybe I need to create a create Text file button in the front panel.
 
 
0 Kudos
Message 1 of 20
(8,608 Views)
The easiest way is use either Export Waveforms to Spreadsheet File (Waveform File I/O palette) or the Write LabVIEW Measurement File (File I/O palette). Unless you modify the code of either, your format options are limited but might be enough. If all you want is x and y data, then you can use Write to Spreadsheet File. You will have to create a X array but that is simple. Your waveform datatype has t0, dt, and a Y array. To create your X array, you can use a for loop with t0 as the first element, increment by dt, and wire the Y array to the for loop to create an array of the correct size. 
Message 2 of 20
(8,600 Views)
First of all, thanks for your helpful suggestions.
I am trying to export x and y data of the crosstalk waveform (math channel 1) into a text file (*.txt)
I suppose that it not that complex, but I cannot figure out how to do this after bringing out the
'write to the spreadsheet file.vi'
 
Do I have to create string formats for x and y data?
Where should this be placed to make sure that the text file prompt will come up after all the tests are completed?
 
???
 
0 Kudos
Message 3 of 20
(8,580 Views)

Just by looking at the Write to Spreadsheet File function, you should see that the inputs are either a 1D or 2D array of numerics - not strings. A 2D array will give you multiple rows and columns. As I said, you already have a Y array. Create the X array and append the two to get a 2D array.

Remember that LabVIEW is a dataflow language. If you wire the measurement values to the Write to Spreadsheet, by definition, the Write To Spreadsheet will not execute until all of the data is present.

Message 4 of 20
(8,575 Views)

By the way, in which VI should I make this for loop to create X array?

How can I access to t0, dt and Y array in the output waveform?

0 Kudos
Message 5 of 20
(8,544 Views)
You would need to create your x array after the data has been acquired and before your save itSmiley Wink. You access the data by using the Get Waveform Components function. This is on the Waveform palette.
Message 6 of 20
(8,542 Views)
I wonder if this will prompt for a correct text file with each increment of enabled hp8133(??) (and write correct text file?)
 
Did I connect to the correct waveform for the waveform elemenets?
0 Kudos
Message 7 of 20
(8,532 Views)
You connected the Get Waveform Components to an empty front panel control. My picture was merely to illustrate how to use it. If you want to create a separate file for each graph, then put the file write inside a for loop and connect it to the waveform array. You would then have to use a unique file name for each write. If you want to save all results to a single file, set the append to true. Otherwise you'll overwrite the previous file. Unless you have a valid path, including file name, you'll get an error. If you want to provide a starting path and then specify a specific file name, you can modify the Write to Spreadsheet function. If you look inside, there is an input to Open/Create/Replace File that is called Start Path. You can add a control to this and wire in a start path and then you leave the file path empty so that it prompts for a specific file name.
Message 8 of 20
(8,525 Views)
1. My intention is to write a single file that will display multiple waveforms and save a text file with X, Y data for (1, 2, N enabled) aggressors.
 
2. I have a modified the Write to Spreadsheet file function and re-compiled the library file.
    It might be necessary to prompt a user to save for a specific file name rather than update each time after running the test automatically.
 
3. Do you think that the application will go thru the entire program with each aggressor activated?
   For example, if 3 (HP8133s) are enabled, then the appl will activate the 1st (enabled) aggressor and generate the plot and repeat until all 3 are enabled?
 
0 Kudos
Message 9 of 20
(8,513 Views)

I have tried to run the VI and found out a few things.

1. the program did not 'disable' those aggressors that were not enabled.

2. I was prompted to save the test results, but the file did not have any content.

Is there something that I may have missed???

0 Kudos
Message 10 of 20
(8,493 Views)