From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate watefall plot with Ni-DaQ

Solved!
Go to solution

@layman93 wrote:

...

How do I fix that, since for the express assistant the parameters are the same with N samples and 12800 Hz as the sampling rate?

I tried replacing the for loop with a while loop and stop control, but it still doesn't work. 

 

Also, It seems that data is not transferred through the inner loop for the waterfall plot generator as seen

...

How can I make this acquisition fast and generate the waterfall? 

 

 


Hi, @layman93,

I may misunderstand what you're trying to do, but it looks like your inner loop is holding up your outer loop.

Since the DAQ Assistant is in the outer loop, it will collect a new set of data each time the outer loop runs.

1 outer loop execution = 1 set of data

 

As such, your inner loop is running the FFT and averaging it on the same set of data, repeated "No of samples needed" times, which doesn't seem right to me. You might check if you really need the inner loop.

(To be clear, when I say inner loop, I'm referring to the for loop that is around the FFT Spectrum function. I don't know about the smaller for loop that is next to it, and the while loop that's outside the DAQ Assistant is needed for continuous data collection. 😊)

 

 

-joeorbob

P.S. It looks like you're trying to use "Insert Into Array" to append elements to the end of an array. If so, I believe you can just leave the index unwired - its default behavior is to append to the end of the array.

Message 11 of 17
(1,107 Views)

Hello joeorbob,

 

Thank you for the response. I agree with your point and as per that, I have removed the inner loop which was performing the FFT.

 

However the problem still remains, the waterfall plot is still not generated.

 

I have attached the rectified VI 2015 V.

 

For some reason, the data is not coming out of the loop that creates the x and y matrix.

 

Can someone help me with this?

 

 

0 Kudos
Message 12 of 17
(1,101 Views)

Have you heard about shift registers?

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

 

You are inserting a set of data into an empty array on every iteration.  Whatever you inserted in one iteration of the loop gets thrown away because you go back to the data at the tunnel (an empty array) and insert the next iteration into that.

 

You should not be using Insert Into Array when putting data to the end of an array, (or beginning).  Use Build Array in those situation.  Insert Into Array should be used only when you will be or might putting data into the middle of an array.

Message 13 of 17
(1,073 Views)

Hello

 

 

 

0 Kudos
Message 14 of 17
(1,052 Views)
Solution
Accepted by topic author layman93

Hi, layman93,

 

The shift register on the While Loop seems right, but I think the For Loop should have been left as it was.

 

 

 

If I understand what you're looking for, you want a 3D plot of your power spectrum graph, showing the result over time.

Does that sound right?

 

If so, you need to get some form of timestamp associated with each row in your 2D Magnitudes array.

I've attached a (2015) VI that I think accomplishes the task. Please look over it and try to understand how I coded it.

 

***NOTE***

I'm not a LabVIEW expert - Someone much more experienced (e.g. @RavensFan) should check to make sure this VI is doing what I think it's doing.

Also, if your requirements are different than what I've explained, this VI will *not* help.

Message 15 of 17
(1,038 Views)

Joe's  (or is it Bob's?  😉)  modified VI looks like it is doing what I think it should.

 

Layman93, try it out and see if this is what you are looking for or at least close to it.  Report back if anything is not quite what you are expecting.

 

 

 

 

Message 16 of 17
(1,033 Views)

Hello

 

0 Kudos
Message 17 of 17
(1,018 Views)