LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a subvi

I like Johnsold's explanation.  Very nice (and short).
 

krispiekream wrote:

Queue is also often used to get rid of local variables by transferring data through wires right?


Not really...  Because if you never code using Locals, then they don't replace them.  Locals are Locals... Humm...  How do I say this...  You can't compare the two..  A Local is a copy or the variable and takes or gives the value depending on how it is manipulated.
 
A queue is entirely a different thing.  What gets passed over the wire is the reference to the particular queue.  The actual data is pointed to in memory.  There is a buffer that holds the data which is typically accessed like a FIFO.  I won't go into the details for saying "typically".  You'll gain an understanding of queues and notifiers by using them.
 
Further to Jonhsold's comment about not using the destroy queue error to stop the consumer loop.  I agree with that.  I typically OR the error status, along with some info from the queue which is the running status of the top loop (stop), along with any other conditions I want to trap with the bottom queue.  If I do trap conditions that stop the bottom loop, I send a notifier to the top loop to stop it as well. 
 
<< I wanted to make my post short... oh well...>>
Message 41 of 41
(731 Views)