LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Only the first Spectrum sampled gets passed through to While Loop Tunnel

Solved!
Go to solution

Hello Everyone,

I work at a dental equipment manufacturer. I'm attempting to come up with a test for scaler shafts. If you tap the shaft, under controlled conditions, good ones make a different sound than bad ones. So we want to evaluate the spectrum in order to have a reliable repeatable test rather than just playing by ear, as it were.

I'm trying to send this spectral data to an excel spreadsheet. I can't use simply  "Export Data to Excel" (via the graph of the power spectrum), since I want to send the data to an xl "template" that already has formulas built in. I'm having trouble just getting the data to any spreadsheet, though. I'm pretty new at this. Could someone please help?

 

Thanks,

Evidental

0 Kudos
Message 1 of 18
(3,356 Views)

Hi there, would you mind saving for LV 2012 or earlier?

 

Save For Previous.png

0 Kudos
Message 2 of 18
(3,318 Views)

Hi Gregory,

Here's the VI saved as 2012, with some caveats. I used "Write To Measurement File" to save in Excel, but that wouldn't compile in 2012, so I just removed it.

There were some warnings, though, even after that:

Warnings.pngI've attached it, such as it is...

 

Thanks,

Dave

0 Kudos
Message 3 of 18
(3,313 Views)

Ok, I see you are converting to the dynamic data type, and I would avoid doing that. It will be easier to troubleshoot when you don't have mysterious things going on under the hood.

 

Also, have you taken a look at the report generation toolkit? It allows you to open an Excel sheet as a template and write to it, working with actual Excel files.

0 Kudos
Message 4 of 18
(3,310 Views)

You have an Index Array right after the loop, so you are only logging the first capture.  If you just want the last spectrum, as one of the comments in the VI implies, then right-click on the output tunnel and select Tunnel Mode->Last Value.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 18
(3,308 Views)

Hi crossrulz,

I actually started off using 'Last Value' as the tunnel mode, since that's the default for a While loop, but got nothing, not even a bunch of zeroes, just a blank spreadsheet.

Thanks,

Evidental

 

0 Kudos
Message 6 of 18
(3,300 Views)

Hi Gregory,

"Write To Measurement File" seems to require the dynamic type. I have looked at the report generation toolkit - even had a 30 day evaluation, but didn't get a chance to use it before expiration.

Thanks,

EviDental

 

0 Kudos
Message 7 of 18
(3,295 Views)

Hi crossrulz,

Just an addition to my previous reply -

If you run this, with Last Value selected, you'll see that 'appended array' and even 'Power Spectrum Cluster' are empty. It's as though the array is getting cleared, but I'm not clearing it.

Thanks,

EviDental

0 Kudos
Message 8 of 18
(3,293 Views)

You are indexing your Power Spectrum Cluster (array) every iteration. If the iteration count is greater than the array size - 1, you will get a the default data for that cluster.

 

Capture.PNG

0 Kudos
Message 9 of 18
(3,289 Views)

Hi Gregory,

That sure sounds reasonable. I tried this, however:

 

Index-Screenshot.png

 

thinking that if I exceeded 1999, I would see the first entry at the output (just as if I'd used Auto-indexing), but there's nothing - zero, zip, nada...

Thanks,

EviDental

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 10 of 18
(3,282 Views)