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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer loop

Solved!
Go to solution

Hello *E* I took a look at your VI, and could not understand why you had the enums wired to the obtain queue, enqueue element, or deque element. These VIs should store the data you want the consumer loop to manipulate. I made some changes to this VI and you can find it attached below. 

 

Regards,

 

Izzy O.

Applications Engineer

National Instruments 

0 Kudos
Message 11 of 26
(1,536 Views)

izzy. O

Thank you very much for your reply!

0 Kudos
Message 12 of 26
(1,524 Views)

Can you please resend me the VI example in 2011 version or lower please?

0 Kudos
Message 13 of 26
(1,512 Views)
0 Kudos
Message 14 of 26
(1,507 Views)
thanks for the reply and down converting the file. Can you please give me a little explaination on how to get the data from the top producer loop to the bottom loop? I dont fully understand this example. It reads the data in like i would like but i need to know were to place the formulas in the bottom consumer loop as it it transfered to the bottom loop. So as it is reading the file line by line first row. Will down the calculation as it comes off the queue then apend down thru thw rows
0 Kudos
Message 15 of 26
(1,490 Views)
Solution
Accepted by topic author *E*

If you wire the output from the Dequeue Element node in the lower loop you will get the row of data that the upper loop posted. The queue is used to pass data from one loop to another. One or more loops can post (enqueue) data to the queue. Only one loop should remove (dequeue) data from the queue.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 16 of 26
(1,484 Views)
Thank you for the explaination.
0 Kudos
Message 17 of 26
(1,476 Views)
Mark i got it working thanks again to all that help! One more question i'm able to read in all data from spreadsheet with -1 or using the iteration from the top while loop in the producer loop. At the bottom consumer is there a way to have all the data put on the enqueue then when it is dequeueing. It read row by row using some type of iteration ? Right now the top loop reads all the data and the bottom loop dequeue output element out displays the first row only . I would like it to shift down thru each row one at a time if possible?
0 Kudos
Message 18 of 26
(1,463 Views)
Thanks never mind i figured it out.
0 Kudos
Message 19 of 26
(1,460 Views)

In the producer loop I am able to read in the whole spread sheet at one time. Then the data is passed in to an index array  then the out put is enqueued. Then it is dequeued at the bottom. Is there a way to make all the data available to the consumer loop soon after it is read in from the producer loop? right now im only able to read it in row by row as it is enqueued by the index array. I would like all rows and columns be available at the same time as a block  instead of row 1 then row 2 then row 3 etc. The reason being is the data in the file will be time stamped and over written so it need to all be available at the same time. I think the problem may be that its read in as a 2 D array and going in the enqueue as a 1 D array therefore its dequeue as a 1 D array.

0 Kudos
Message 20 of 26
(1,421 Views)