LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When Do You Name a Queue?

Solved!
Go to solution

@diarmaede wrote:

Instead of using the queue name, I rewrote my code to use a Sequence Local to pass the queue wire from one frame of my stacked sequence to the next.  Is there anything wrong with this approach?


:HEADBANG:! All your problems are lying in the fact that you have a stacked sequence structure! I would suggest a way to fix this, but without seeing the code it is difficult to give you a good answer.

Message 21 of 27
(1,418 Views)

Sorry to cause frustration.  My original question was more theoretical.  I wanted to know why a user would name a queue, just generally speaking.  All the great responses I got made me think about ways I could improve the code I was working on right now, but I was really looking for a broader answer, not a quick fix for a specific problem.  Thanks to all who helped me out in this case.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
Message 22 of 27
(1,410 Views)

@diarmaede wrote:

Sorry to cause frustration.  My original question was more theoretical.  I wanted to know why a user would name a queue, just generally speaking.  All the great responses I got made me think about ways I could improve the code I was working on right now, but I was really looking for a broader answer, not a quick fix for a specific problem.  Thanks to all who helped me out in this case.


Thanks for marking my solution, but I would suggest that what I have written there did not answer the original question. I would mark a response as an answer that is more specific to the original question you asked to help anyone that should stumble across this thread in the future.

0 Kudos
Message 23 of 27
(1,395 Views)

Here is a simple functional global approach to get you started. You can then drop this functional global anywhere you need to access your queue whether it be to get the queue reference, or enqueue an element etc. Others can probably expand on this. There are also other approaches, using things such as arrays as inputs with a for loop around the enqueue function to queue up multiple elements. If you were to create this VI you would want the action and data to be controls, not constants, but I just showed them as constants so you could see what is going on on the block diagram. I didn't name the queue here (because if coded correctly the functional global should hold on to this reference in memory), but you could name it in case for some reason you lose your queue reference, your VI would open a new ref to the correctly named queue. 

 

Message 24 of 27
(1,383 Views)

deleted

0 Kudos
Message 25 of 27
(1,383 Views)

what the heck it posted 3 times and i only hit the button once

0 Kudos
Message 26 of 27
(1,383 Views)

Thanks!  That is very helpful.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 27 of 27
(1,373 Views)