LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Excel

Solved!
Go to solution

I am using LabVIEW7.1 and am trying to write to excel. The issue is the source is a 1D array of cluster of 3 elements. Not sure where to begin on tackling this. It will be coming from the input to "mag" graph. The top most wire on the FFT[Mag-Phase] tab.

 

Thanks,

SparkEE

phase.JPG

0 Kudos
Message 1 of 24
(4,003 Views)

Hi SparkEE

 

There are several ways to export data from LabVIEW to Excel, to start understanding the idea of the architechture you could start taking a look at the examples provided by LabVIEW using the NI Example Finder which you can access from Help> Example Finder> Excel - Write.vi

 

Also, other source that you could use as a guide is the following document, it contains different methods that you could use to export data into excel and its corresponding requirements

 

http://www.ni.com/newsletter/51339/en/

Regards,

Sil.VI
0 Kudos
Message 2 of 24
(3,950 Views)

Thx Jimenez for helping out. Unfortunately, some of those methods are not available in LabVIEW 7.1.

I'm not sure how convert "1D array of cluster of 3 elements" into something usuable without losing data.

0 Kudos
Message 3 of 24
(3,941 Views)

as far as I remember the content of the output cluster is two scalars and a numeric array, so you should be able to unbundle each one of them and form a bigger array out of them in the end

or you can write each cluster to a separate worksheet

 

the report generation toolkit has tools for worksheet insertion as well

__________________
Engage! using LV2015
Message 4 of 24
(3,909 Views)

If there's a cluster, I'd assume there's an Unbundle.  Granted, I'm not using ~10 year old software.  But, clusters are worked with by using bundling/unbundling.  I'd expect that was the case from the start.

 

If you're needing to find help, it might be better to work with a version of the software that more people use.  Do you have access to the newer versions?

 

Is there a Write to Spreadsheet VI available to you?  You can use this to write a csv file and open that in Excel.

0 Kudos
Message 5 of 24
(3,896 Views)

Hey thanks for all the feed back. I've previously tried the unbudle feature but it doesn't work. When I click create at the mag output off the "FFT.VI" it wants me to create an array. Maybe I am overthinking this. Like Jean said, a cluster is 2 scalars and a numeric array but that cluster is an array. That's where I get confused.

 

Any feedback is welcome and I will keep thinking of solutions.

1D array of cluster of 3 elements.bmp

0 Kudos
Message 6 of 24
(3,829 Views)

as you have an array of waveforms going in, you have an array of the clusters coming out

so first you need to index the arrays (for example by an autoindexing for loop) and then you can unbundle

__________________
Engage! using LV2015
Message 7 of 24
(3,818 Views)

That sounds like it could work, I will give that a try shortly. I've been messing around with an "array to cluster, then "unbundle by name" to the cluster and then write the magnitudes. I've tried putting it in the "case structure" and in the "while loop". both gave me errors with my sampling frequecy in my "gain and phase" VI. Does it need to go outside the "while loop"?

 

To implement Jean said, where would be the best place to place this "for loop"? 

Thx guys. Posting on the forum makes me see thing a bit clearer

0 Kudos
Message 8 of 24
(3,811 Views)

So i've tried indexing, then the unbundle. the data that comes into excel says "data could not load completely" and there are a bunch of zeroes.

Is there a better way of getting the data from both signals to excel, have 1 column be the magnitude, the 2nd column be the frequency its at?a total of 4 columns and to know which is which.

 

I simplified the code a little and will add everything back later. My priority is to just be able to read the data in excel.

Write.PNG

0 Kudos
Message 9 of 24
(3,745 Views)

as a simple solution, here it is, unfortunately I cannot backsave it to 7.1, so here it is as a snippet, so you can copy it

I use the report generation toolkit for exporting proper excel data. In this example f0 and df go into the first column of the excel file under each other then a column of magnitudes, then the second f0 and df and then magnitudes

If you go on with save to spearsheet, you need to use arrays, so you will end up a bunch of useless zeros.

 

Of course it could be refined a bit more, bit it is a starting point

 

report.png

__________________
Engage! using LV2015
Message 10 of 24
(3,720 Views)