LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple elements queue

Hii,

In our program we are filling a queue with data from *.tdms file (each 40 samples are entered to the queue (as element))all the time until stop button is pushed.
when 10 secs are passed we want all the data from the queue to analyze and plot. It seems we get when using "get queue status" (which gives as an output all elements in the current status) we get all the elements and 1D waveform, when plotting it it plots each element in different color (that is one problem), and we cannot analyze it (for example finding threshold, averaging or whatever (second problem) , because it is not waveform.

trying to solve this problem we have searched much in NI forums but found nothing.

We need your help urgently!

 

 

0 Kudos
Message 1 of 16
(4,352 Views)

Hi Hanan,

 

cleaning up a block diagram is not your favorite task, isn't it? 😄

 

Well, GetQueueStatus isn't the preferred way to read ("Dequeue") queue elements: you get back an array of cluster of elements. You have to re-sort your elements to get back your (probably intended) array of elements...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(4,347 Views)

Indeed, the get q stauts returns an array of element, in your case an array of waveform and when you feed this into a waveform graph it give one plot per element in the array, which of course doent help you.

 

So you need to concatenate all the waveform chunks, there is a VI for that in the waveform palette, here's one way of doing it :

 

Clipboard01.png

 

hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 16
(4,342 Views)

GerdW , Thanks for your quick response.

 

How should we do so?

And if you have a better way to get back our data from these elements (we will need to get back a waveform with size of "#elements x 40 samples"), please share it with us.

 

Thanks in advance,

Hanan

0 Kudos
Message 4 of 16
(4,339 Views)

Yes we thought about that, but we don`t want to "dequeue" the elemnts, we want to keep them.

0 Kudos
Message 5 of 16
(4,335 Views)

Hi Hanan,

 

when you don't want to use Dequeue you should use TiTou's suggestion just with the array you get from GetQueueStatus...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(4,331 Views)

Yep, just mix you code and my example, feed the 1D array of waveform you can from the get Q statue to index on the for loop and you're done.

 

Good luck


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 7 of 16
(4,325 Views)

Hi again.

 

But the suggested example uses "dequeue", and we don`t want that.

Please find attached an example we have modified to explain our problem.

 

In the example you can see both graphs : the white one  (the result of using dequeue) is the needed result, the second graph (full of colors) is what we get when we don`t use dequeue (1D of waveform instead of waveform).

 

Thanks,

Hanan

 

0 Kudos
Message 8 of 16
(4,316 Views)

Hi Hanan,

 

we told you to get rid of that Dequeue function...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 16
(4,310 Views)

Oh maybe you ment that the problem can be solved by deleting the :"dequeue" from the loop?

because in that way it works.

 

Thanks for your help team (in israel and in the USA)

 

Hanan 🙂

0 Kudos
Message 10 of 16
(4,305 Views)