LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export/write text file from waveform graph

I think part of the problem is that default values are used at the outputs of some of the case structures when you should be passing the previous values through. The empty file may result from Enable/Disable 8 being False. That will put default values on the Output Waveform which is written to the file. Do you really want to write Resultant Waveform to the file so that you get all 8? A modified version is attached. I do not have your instruments so I have not done any testing.

Lynn
Message 11 of 20
(2,126 Views)

Thanks for your help.

Could you point out where I have made the mistake for Enable/Disable 8 being false? (Is it possible to create a single file for each increment of aggressor as well?)

Yes, I would like to display and save the 8 waveforms in a single text file. Speaking of writing a text file, how can I add a 'header' so that a user can make a correlation between x,y data columns and a number of sources that are enabled?
 
Best,
0 Kudos
Message 12 of 20
(2,117 Views)
I have added some comments and changed the write to file.

If the Aggressor8 Disable button is false, the last element of the booelan array will be false. The For loop in the 'run' case autoindexes the boolean array. The waveform output (in your version, mine is changed) is the value of the last iteration. If the last element of the boolean is false, the waveform output is the default value. The default value of a waveform is t0 = 0, dt = 1 and Y[] = empty array.

To write a header create a text string with the header you want and use the Write Characters to File.vi to create the file and write the header. Wire the file path to the path input on your modified write to spreadsheet VI (rather than an empty path because you wish to append to a now existing file). Be sure the header has the correct cell and row separator characters (such as tab and carriage return) to format the data like a spreadsheet. Make a little test VI to see if it works as you expect.

Lynn
Message 13 of 20
(2,112 Views)
Thank you very much for your kind explanation.
 
1. In regard to the header question, how can I put a header info for each enabled aggressor? I am thinking of something like to the attached file as a format.
 
2. is it possible that I can add a time-stamp option, so that the file will include the time/date display when the text file is created?
 
0 Kudos
Message 14 of 20
(2,097 Views)
Here is one way to put info about each enabled aggressor into a header. You can create almost any kind of format you want. It just depends on how much time you want to spend wiring it up. I added the time stamp also.

Looking at your program again, I would possibly add a "setup" case where I would put all the header formatting, create the file, and perhaps put the instrument initializations there as well.

Lynn
Message 15 of 20
(2,090 Views)
Per your suggestion, I have added "set up" case after the "run" case. (is this the correct sequential place for the case?)
 
Could you explain what do you mean by putting the instrument initializations into the "set up" case?
0 Kudos
Message 16 of 20
(2,075 Views)

1. I still cannot disable those aggressor instruments that are not enabled (after Enable/Disable 8 being selected as true state). By the way, do I have to set this specific setting (Enable/Disable8) to a true state in order for the test and write a text file?

2. It looks like the "Write File" button tried to create a file, but I did not find any content inside. (how can I add a .txt tension for writing a test result?). No waveforms on the plot...

 

 

 

Download All
0 Kudos
Message 17 of 20
(2,058 Views)

1. Does this mean that I have to make 'True' state for Aggressor8 all the time? (for testing?) How can I correct this so that it does not have to be..it would be difficult to assume that a test user to enable the particular aggressor for any given instance for testing.

2. How can I make sure that I can show waveforms on the scope (in VI)? The resultant waveform in the "Run" case does not show any plots after testing.

3. 'Write File' does write a header, but not in a correct format. How can I attach spreadsheet file format when a file is created (.xls)?

Thank yoU!

0 Kudos
Message 18 of 20
(2,043 Views)
I still have not figured out above issues....
Can anyone provide some advices to solve?
 
 
0 Kudos
Message 19 of 20
(2,024 Views)

Since I don't have the hardware you are using, I could not run the VI. If you could provide a simpler VI that does not need any hardware, it will be easier to help you out. As for the format of the header, you  can change the way you are constructing the data string (location of \n, \t etc) to change the way header looks.

Hope this helps,

Ankita

0 Kudos
Message 20 of 20
(1,999 Views)