12-11-2014 03:17 PM
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
Solved! Go to Solution.
12-12-2014
01:46 PM
- last edited on
12-10-2024
06:14 PM
by
Content Cleaner
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/
12-12-2014 02:01 PM
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.
12-12-2014 05:57 PM - edited 12-12-2014 05:58 PM
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
12-12-2014 07:18 PM
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.
12-15-2014 12:45 PM
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.
12-15-2014 02:28 PM
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
12-15-2014 02:46 PM
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
12-19-2014 09:47 AM
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.
12-19-2014 01:43 PM
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