LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting XY Graph to Excel Spreadsheet


Ravens Fan wrote:

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


There is also a blue wire that needs to go.

0 Kudos
Message 11 of 18
(2,444 Views)

Thank you very much for your advice. I implemented all of your suggestions and the queue appears to be working correctly. I am getting a lot of "NaN" values in my spreadsheet and my "y-coordinates" are not being written into the spreadsheet as well and I have no idea why. The y-coordinates are being passed into the queue, so I know that is not the problem. I believe it is something to do with how I'm extracting my data from the 1-D complex cluster array. I would also like to place all of the y-values into separate columns, if possible. I've attached my vi and the output txt file. 

Download All
0 Kudos
Message 12 of 18
(2,432 Views)

Ok, this is a much cleaner output file. It is outputting the same values. How would I obtain the values from each iteration instead of the same ones over and over. Also, is there anyway I can get rid of these "NaN" values and the arrays that aren't yet completed?

0 Kudos
Message 13 of 18
(2,429 Views)

With every iteration you are enqueing the entire 2D graph, which is a colossal waste of electrons. Try to enqueue only completed plots in the outer while loop, for example.

0 Kudos
Message 14 of 18
(2,423 Views)

I don't have your subVIs and hardware, so I cannot test, but try something like this:

 

(I haven't touched most of your code, but it still needs major work)

 

 

Message 15 of 18
(2,421 Views)

Looking at the code quickly once more, it is all really messed up. You are mixing really incompatible components from various past suggestions. For example, I told you how to do things "in place" and you are actually correctly initializing the cluster array, but then, inside the in-place structure, you are building (=growing) the arrays instead. That makes no sense at all.

 

You are well advised to go over the program, try to understand the various components, and make the necessary corrections.

0 Kudos
Message 16 of 18
(2,414 Views)

Ok, so I'm making some progress. I initialized the arrays and with your help, I removed all of the NaN values and formatted the data into two columns, as per the attached file. I'm trying to get just one column of voltage values and then multiple columns of current values. I've tried making a subset array, but I can't index the array. Thank you again!! 

Download All
0 Kudos
Message 17 of 18
(2,412 Views)

You are still making a complete mess of things with random code fragments that have no meaning.

 

What's the point of the "open file" near the bottom right? The "Write to spreadsheet file" includes a file open, so that function makes no sense, especially since you branch the path.

 

You cannot write successive columns to a spreadsheet file because column elements are not adjacent in the linear file. with every new element, the entire file would need to be rewritten.

If you wan to write successive 1D arrays, you need to setup a transposed file. (You can always read, transpose, and rewrite later if needed)

 

I would recommend to enqueue entire rows in the outer loop (after each new plot has completed) as a simple 1D array. You can enqueue the X array once before the loop starts and write it as the first row. The queue will have a simple 1D SGL array as type.

Message 18 of 18
(2,404 Views)