LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bundle/Unbundle through while loops (using Queues)

Hello everybody....
 
I´m trying pass data through 2 while loops using Queues...
These data are bundled (string, numeric array, numeric constant) and I need unbundle them in another while loop, but I think is necessary first to do something with data type or something like this...because de unbundle is not permited.
 
I´ve tried use Variant to Data function, but I´m not secure about its use...(it´s not familiar to me...),
 
So, if some LV Master may help me, I´ll be glad!
 
Attached an example .
 
Thank´s!
Julio Ribeiro
0 Kudos
Message 1 of 9
(4,578 Views)
Go to your valid cluster wire in the upper loop, right-click...create constant.
 
Now move that diagram constant outside the loop all the way to the left and wire it to the "element data type" input of "obtain queue".
 
The rest should fall into place.... 🙂
 
 
0 Kudos
Message 2 of 9
(4,573 Views)
Here's a quick modification, LabVIEW 8.0.
0 Kudos
Message 3 of 9
(4,562 Views)
Of course you should also place a small wait statement in the upper loop... 😉
0 Kudos
Message 4 of 9
(4,559 Views)

Yeap!

Good guys goes to heaven!...donkey guys ask for help!

Thanks a lot...

 

Julio

Julio Ribeiro
0 Kudos
Message 5 of 9
(4,559 Views)
Don't forget to use the Release Queue VI outside of the loops to release the queue resources.
0 Kudos
Message 6 of 9
(4,546 Views)

The release is necessary even queue buffer  is always 0 ? (every element enqueued, almost immediately  out)

 

Julio Ribeiro
0 Kudos
Message 7 of 9
(4,507 Views)
I can't be absolutely certain that the release queue is necessary for what you described.  A more experienced LV programmer might be able to answer.
 
But I would recommend using release queue as a matter of good programming practice.  Even if the queue is empty, some resources are being set aside in memory to manage the references to the queue.  These resources may accumulate over time if more queues are created.  These may clean themselves up when your program ends, but on the other hand, it may not clean up until Labview itself ends, or worst case, they linger until Windows gets rebooted.  I've seen numerous threads where people had problems that only went away once they completed exited Labview.
0 Kudos
Message 8 of 9
(4,500 Views)

Of course, it make sense (release memory)..

Thanks for the tip!

 

Julio Ribeiro
0 Kudos
Message 9 of 9
(4,486 Views)