CSLUG - Central South LabVIEW User Group (UK)

Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Solved! Go to solution

low pass filter behaviour when dequeued

Afternoon,

Undertaking a big upgrade of our Dyno VIs to include details about signal quality and better noise filtering.

I've got a producer/consumer set up to try and keep the data acquisition loop nice and fast/uncluttered but I'm not sure if i am misunderstanding the use or timing of queues or if something really obvious i'm missing.

 

I've made and example vi of of the problem, and a vi of what i would expect the low-pass filter to to do in a single loop. You can clearly see the effect on the filtered signal (red dotted). Changing the dequeue timeout makes the filter work as expected but stops the power spectrum working. 

 

Simulate signal directly replacing the hardware (nothing else changed with queue etc)

 

Hopefully something obvious i'm missing with the use of queues,so any help would be greatly received.

 

Kind regards

 

Martin

0 Kudos
Message 1 of 5
(778 Views)
4 REPLIES 4
Highlighted

Re: low pass filter behaviour when dequeued

Extra info:

Slowing down the power spectrum loop helps but every time the power spectrum refreshes the filtered signal (dotted red) still drops to zero for an instant. 

 

Thanks for any help in advance

 

Kind regards

 

Martin

 

 

0 Kudos
Message 2 of 5
(775 Views)
Solution
Accepted by topic author Martin_from_Dorset
11-06-2018 06:47 AM

Re: low pass filter behaviour when dequeued

If it works it works!

 

However, not sure it is behaving quite as you anticipate.

 

There is a race between the two parallel consumer loops. This is because once an element is dequeued it is unavailable to be read elsewhere, in other words, it is removed from the queue. You would need a second queue from the second to third loop to ensure both signal processing steps receive all the data.

Nick
0 Kudos
Message 3 of 5
(769 Views)

Re: low pass filter behaviour when dequeued

Afternoon Nick,

 

Many thanks for the quick work-around: is the attached the sort of thing you had in mind.............it works (please ignore lack of error)

 

My understanding that the point of queues was to be able to pass data around parallel loops but can see the difficulties if one loop is averaging etc................thought something like the queue would just build up as with the NI example (attached).

 

Thanks for the help

 

Kind regards

 

Martin

0 Kudos
Message 4 of 5
(765 Views)

Re: low pass filter behaviour when dequeued

Hi martin,

 

Thats great - Yes, that is the kind of thing I was thinking of.

 

Queues certainly are certainly for passing data around loops.

 

I think you have it but to re-iterate: the problem is deqeueing from the same queue in two locations. Each obtain queue creates a single data structure, the two dequeues were taking data from the same place. One loop was taking some and the other taking the rest.  In the example one loop enqueues and one other dequeues. The third loop just looks at the queue size.

Nick
Message 5 of 5
(757 Views)
Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.