12-06-2017 11:56 PM
oh, thanks.
12-06-2017 11:58 PM
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
12-07-2017 06:18 AM
@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).
12-07-2017 09:57 AM
Hmm, the six hour link not working. Could you send me again? Thank you.
12-07-2017 12:07 PM
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".
12-07-2017 02:22 PM
@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.
12-07-2017 05:33 PM
thanks for your help!
12-07-2017 05:34 PM
thank you!