ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

difference between notifiers and queues

Hi, I have a question about notifiers and queues. I try to do a moving average for 6 min, having data with a sampling rate of 25 us. I use a producer/ consumer architecture. The producer loop reads 3 DMA Fifos from my FPGA vi and writes them in three diferent queues. Each queue is beeing read again in three consumer loop, one for each queue. I thought this might be faster??!! If I limit my queue to a certain size than after some minutes I get a timeout error, if I say 0 ms for timeout. I wanted to make sure that nothing will get lost. If I don't limit my queue size ( -1) after 10 minutes I get a message that I don't have enough memory to operate. I also can see that that in Task manager the page file is getting bigger and bigger until 2 gb. So from this poit of view I would assume that my average calculation is to slow and data has to be stored inbetween. So my consumer loop is to slow. Well I don't have any idea how to make my code faster. I also do a cascade for the averaging and the average is beeig calculated adding the new value and subtract the oldest value in the array.

 

Than I tryed using the notifiers. As I read you can not size a notifier. But what happens if  the consumer loop is slower than the producer loop? Do I loose data? When using notifiers I don't get any error messages, like don't have enough memory . So what is the diference between notifiers and queues?

 

Has also someone any idea how to make the code faster ?

 

Thanks

0 Kudos
Message 1 of 8
(5,987 Views)

Hi elh,

a notifier has no buffer. It's like a queue with size of one, but without the full error.

You can receive a notifier on different places at the same time, this isn't possible with a queue.

 

Hope it helps.

Mike

Message Edited by MikeS81 on 06-08-2009 05:30 PM
0 Kudos
Message 2 of 8
(5,978 Views)
means that if the consumer loop is to slow, data will be lost, and no error will occur??
0 Kudos
Message 3 of 8
(5,969 Views)

Hi elh,

yes that's correct. See the attached example.

 

Mike

0 Kudos
Message 4 of 8
(5,960 Views)

Hi Mike,

 

thanks for your advice. Are there other posibilities comparing to the queues?? 

 

Irina

0 Kudos
Message 5 of 8
(5,958 Views)

In terms of functionality, a queue is similar to an array.

Think of a queue as an array, without a UI, that can only be operated on from either the front or back (unless you do a little LV magic).

Due to how it is constructed, it is faster than an array as well.

Cory K
0 Kudos
Message 6 of 8
(5,907 Views)

Hi,

 

Back to your original post.... did you know that you can do averaging on the FPGA board itself?  There is a NI shipping VI for LV FPGA that can calculate an average, RMS, etc... Maybe a suitable alternative would be to do the calculations there and spare your host computer..

 

Mike R

0 Kudos
Message 7 of 8
(5,899 Views)

Check the number of elements in the queue when running your vi, so you can see if your queue is running full.

 

Furthermore, your code looks a bit 'dirty'. From that I guess, there is still a lot of improvements that can be made to get the performance you need.

Take a look at the 'ptbypt Mean.vi' (I don't remember the exact name).

 

Felix

0 Kudos
Message 8 of 8
(5,895 Views)