LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting XY Graph to Excel Spreadsheet

I am testing fabricated transistors via GPIB. I have a Keithley power supply biasing the Drain/Source and an Agilent Power Supply biasing the Gate/Source. I am new to LabVIEW. My program is fully functional, but I am trying to export the data to an excel spreadsheet and I'm having quite a bit of complications. The XY graph is taking in a 1-D array of cluster. I've converted to complex to save complications during the plotting, with the help from a previous forum. Basically I would like to export the data to an excel spreadsheet with one column with the biasing voltages across the drain/source and multiple columns for the current across the drain/source w/different biasing voltages applied. I'm getting "NaN' values in my spreadsheet and it's only giving me values for the first iteration. I've attached a text file of the current spreadsheet along with my end goal. Ideally, I would like to place headers in there as well. I've attached my VI as well. Any help would be much appreciated! 

0 Kudos
Message 1 of 18
(7,571 Views)

Also, this is a picture of my current waveform, if needed. Thank you in advance for any help that you can give. 

 

~jdamato3

0 Kudos
Message 2 of 18
(7,570 Views)

In your inner while loop, you have a weird combination of having a feedback node on your 1-D array of clusters that winds up feeding a shift register.  So it seems to me you are always feeding stale data from the feedback node into the shift register, which is what is getting used in the next iteration.

Message 3 of 18
(7,563 Views)

I just took the feedback node out and it runs substantially smoother. Thank you for the help!

0 Kudos
Message 4 of 18
(7,559 Views)

Again, sorry about that new post, I just didn't want to ask an irrelevant question to this thread. I'm having general problems on where exactly to place my write to spreadsheet function in order to obtain all of my data values. I originally had it in the inner loop, but it would prompt me every iteration to save. Now I have it in the outer loop and I'm not getting anything. Also, I'm having a difficult time converting from a 1-D cluster array of single complex to a format that can be accepted by the write to spreadsheet function. 

0 Kudos
Message 5 of 18
(7,522 Views)

Turn on Context Help and hover the Write to Spreadsheet file function.

 

You'll notice there is an input called File path and its default value is to call the File Dialog.  If you don't want to be asked the filename everytime that subVI executes, then you need to wire a file path constant into that input.

 

Look at the input called Append to File.  Its default value is False which causes it to create a new file.  Wire a True Boolean constant there and the data will be appended to the end of the file on every iteration.

 

If you want to send the X and Y data from the complex data type to the file, then you need to extract the array out of the imaginary side of the complex data type as well, rebuild it into a 2-D array with the real data part, and send the 2-D array to the Write to Spreadsheet File.  Your whole data type there seems unnecessarily complicated, and I'm not sure what each level of that structure is supposed to represent.  I'm also not sure if the logic in the way you are building the arrays make sense.

 

I would recommend using a producer consumer architecture that passes each new set of data from this loop to another consumer loop by way of a queue.  That consumer loop will be the one to write the data to the file.

Message 6 of 18
(7,511 Views)

Thank you for your help. I'm attempting to use the producer/consumer method and following the Obtain Queue vi, I'm getting a mismatch of data types, "you have connected a scalar type to an array of that type. The type of the source is queue refnum and the type of teh sink is 1-D array of cluster of 1 element". Also, should I continue to use shift registers for graphing purposes?

0 Kudos
Message 7 of 18
(7,507 Views)

Ok, so I implemented the producer/consumer architecture, as suggested. I'm still having problems obtaining the data from the 1-D cluster array. Sorry to continue to bother you with this, but I've been stuck on this for days. Still no luck :(. I've attached my updated vi if needed. Thank you again for all of your help. 

0 Kudos
Message 8 of 18
(7,499 Views)

The button for "write to spreadsheet" needs to be inside the while loop else it will never get read except at the start of the program.

 

(BTW: (1) What's up with all these local variables (Measurement, voltage, current) while the terminal sits outside disconnected? Delete these locals and connect the terminals in their place. (2) What's up with these extra tunnels to nowhere in the in place structure?)

Message 9 of 18
(7,495 Views)

Another problem is that your consumer loop won't actually run until the producer loop has finished.  You wired a boolean from the producer to the consumer that creates a data dependency meaning the consumer can't start until the producer has finished.

 

Get rid of that wire so that the loops will be allowed to run in parallel.

Message 10 of 18
(7,483 Views)