LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save plots from Agilent E4446A spectrum analyzer

Solved!
Go to solution

In this particular case I don't think the Export VI will give you what you want, since you are dealing with frequencies. The Export Waveforms VI will try to convert the frequencies into time values, so your first column will have "values" like "3/6/1910  16:40:00." for a frequency. You could ignore this column if you want, but I think you're better off using the Write to Spreadsheet File so you get the numbers as you expect them. An alternative is to make a copy of the Export VI (saving it under a different name and in your folder hierarchy) and modify to eliminate the time formatting. 

0 Kudos
Message 11 of 18
(1,440 Views)

Hi Dennis.  Please take a look at the picture I attached.  LabView will not run as long as t0 is not fed with time stamp.  I can't use time stamp at this case because my x-axis is frequency.  I'm sweeping a circuit from 1GHz to 5GHz, so frequency is important while time is irrelevant here. 

 

Man this is so frustrating.  The program is able to let you right click the waveform window on the front panel and export the plot as excel spreadsheet, but it is difficult to program the same thing to so it automatically.  I attached the original driver here.  It could be useful for diagnostic.

 

 

errors.PNG

0 Kudos
Message 12 of 18
(1,432 Views)

First, you don't even have to show the t0 input but smercurio_fc is correct about the time column. It is the Write to Measurement File that writes relative values to that column so the first column would be df. With a simple for loop and the dt (actually df) value from the cluste, you can easily create an array of dt values. With that array and the y array, you can pass a 2d array to the Writ Spreadsheet File.

Message 13 of 18
(1,427 Views)

@wyattmengy wrote:

Man this is so frustrating. 


For the specific error that you're talking about there's a function that will let you convert a number to a timestamp. It's in the Numeric palette and the Time palette.

 

However ... why don't you just do what I showed you in reply #4? Like I said, that will give you the start freq as the first line, the delta freq in the second line, and the measured values as the remainder of the lines.

 

If you want two columns then take the start freq and delta and wire that into the Ramp Pattern VI to get yourself the array of X values. Take that output and wire that into a Build Array along with the Y array from the driver VI, and you've got a 2D array where the 1st column is the frequency and the second is the spectrum data. You're making this way more difficult than it is.

0 Kudos
Message 14 of 18
(1,421 Views)

Hi Smercuri.  You are right, I feel that I'm making this task overly complicated.  Actually I tried your idea the first, but I couldn't figure out how to build the 2D array.  Now with your help, I did, sort of.  I connected the things as in the picture below.  Amazingly, I got 2 columns of data saved in a .txt file!  But there is a problem, I still couldn't get the x-axis right.  The first column (the x-axis) in the .txt file is all zeros, but it should really be the frequencies from 2GHz to 4GHz.

 

What's wrong in here?

 

 

try2.PNG

0 Kudos
Message 15 of 18
(1,413 Views)
Solution
Accepted by wyattmengy

You didn't provide a value for the end. How is it supposed to know when to end? Thus, the Ramp Pattern generates nothing.

 

You could use the "By Samples" mode. A little bit of arithmetic should give you your X values:

Message 16 of 18
(1,411 Views)

Thanks a lot smercurio!  It finally works right! 

 

I just got another side question.  Is there a way to let the program save data onto a new tab in an excel spreadsheet, or create and save in the new file, whenever the program loops back onto this saving function?  I'm going to sweep the circuit through a series of frequencies, I have the loop setup and running, it just need to be able to store the data onto a new tab or file for every new measurement.

 

Once again, thanks a lot man!

0 Kudos
Message 17 of 18
(1,402 Views)

You don't understand the Write to Spreadsheet File function. It does not create native Excel files. It creates text files - commonly either tab or comma separated data. So, creating a new tab is simply not possible. Creating a new file each time is possible and automatic file naming has been a frequent topic. Do a search and see what you can come up with.

0 Kudos
Message 18 of 18
(1,392 Views)