06-13-2012 12:05 PM
@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.
06-13-2012 12:12 PM
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.
06-13-2012 12:46 PM
@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.
06-13-2012 01:01 PM - edited 06-13-2012 01:02 PM
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.
06-13-2012 01:01 PM - edited 06-13-2012 01:02 PM
deleted
06-13-2012 01:01 PM - edited 06-13-2012 01:01 PM
what the heck it posted 3 times and i only hit the button once
06-13-2012 01:03 PM
Thanks! That is very helpful.