# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

oh, thanks.

Message 11 of 18
(504 Views)

## Re: Very simple questions about Queue and De-queue. Vi attached.

ok, but why only A is the right way?  and BC all are wrong?  In the scene of data flow， how it works in my case?　thank you

Message 12 of 18
(504 Views)

## Re: Very simple questions about Queue and De-queue. Vi attached.

@sunson29 wrote:

ok, but why only A is the right way?  and BC all are wrong?  In the scene of data flow， how it works in my case?　thank you

DATA FLOW!!!

If you have a wire come out of loop X and to loop Y, loop Y cannot run until loop X has completed.  In B and C, you have this scenario.  In A, the data dependency from the queue reference is only from the Obtain Queue.  Therefore X and Y can run in parallel (no data dependency between them).

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 18
(496 Views)

## Re: Very simple questions about Queue and De-queue. Vi attached.

Hmm, the six hour link not working. Could you send me again?  Thank you.

Message 14 of 18
(485 Views)

## Re: Very simple questions about Queue and De-queue. Vi attached.

I mean, the wire of A is still outside of bottom loop, right?

No. Tunnels are input or output. In your A case it it an input for both loops. All the other cases it is an output from the B loop.

oh, btw, the first time I do the queue, I use C style, because I thought dequeue should be after queue, so, the wire should be out after queue.  but, this is wrong. I think the answer will be the same as the question above. Thank you.

I think you are getting hung on on how queues work. Normally you are correct in thinking that data needs to be written to a wire before you want to read it. Queues are specifically designed to communicate data between two loops and work a little different. The dequeue element will not return data until enqueue element has put data into the queue. That's why the dequeue element has a wait timer. If you set it to -1 it will not do anything until the enqueue element function puts data into the queue. Think of the wire more like a reference than "by value".

Message 15 of 18
(475 Views)

## Re: Very simple questions about Queue and De-queue. Vi attached.

@sunson29 wrote:

Hmm, the six hour link not working. Could you send me again?  Thank you.

Sorry.  It looks like NI took down that page.  I don't know if it exists under another URL link, or is just gone.

Here is another link you can look at.

How to Learn LV

Message 16 of 18
(458 Views)