From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-27-2014 04:37 AM
Hi everyone,
ı have two consumer loop and I use only one obtain queue. I want to get the same data at these consumer loops.How can ı solve this proplem.
Thanks.
Solved! Go to Solution.
08-27-2014 04:47 AM
Use the "Preview Queue" primitive to check the data and dequeue it in any of the loop or in the producer itself. Otherwise the element will not be removed and you will be always seeing the element (not reading) in one end and keep building the queue in the producer at the other end.
08-27-2014 05:09 AM
You can not dequeue at two different places from the same queue.
if you have two consumer loops use 2 queue each for one loop.
and do not use more than one event structure in a single block diagram.
You need to follow some basis and think about architecture.
08-27-2014 05:34 AM
Thanks for your advice.I tried Preview Queue but it gets the data only one time , if I change the data from producer loop it doesn't get the data again.Therefore I will use two different queue.
Why I shouldn't use more than one event structure in a single block diagram?Can you explain?
08-27-2014 05:44 AM
http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/caveatsrecmndtnsevnts/
and from image you have attached how do you plan to stop your program.
08-27-2014 06:07 AM
I use property node value signaling and I can stop the program.
08-27-2014 06:23 AM
OK , Did you read anything about design architecture in LabVIEW.
Three event structure on the same block diagram may lead to gui Lockup.
If someone press Boolean 2 or Boolean 3 , that loop will stop leaving the other loops running.
Then again if suppose loop 2 is running some task inside an event case and if you remove the lock front panel checkmark , it wont run the new event case until it completes.
these are few from my side i am sure you will get lot more problems if you continue in that way.
PS : No need to use wait in while loop containing event strututre , you have left timeout terminal which means timeout is -1 . so the loop would not execute until any event happens.
You should use producer consumer architecture.
08-27-2014 06:41 AM
I'm not even seeing the point of the event structures in your consumer loops. When you have no data in the queue, the Dequeue Element functions will sleep, using no CPU resources. They will output something when there is data.
As was said, if you want two consumer loops, use two queues.
08-27-2014 06:43 AM
I didn't use three event structure in one block diagram before but you're right,it will be problem. I consider to your advices. Thanks