01-11-2013 02:54 PM
I am working on a queued state machine setup. I am using a type def with all of my possible states in it as the elements of my queue. At the start of my program the queue needs to initialize with a specific order as shown in the snippet below. However, when I run the code and probe the queue at the end, I end up with 0 entries in my queue. Am I missing something? This is my first time working with queues in labview.
Solved! Go to Solution.
01-11-2013 03:00 PM
Is another process dequeuing in parallel? How are you checking to see how many items are in the queue?
Just as a convenience, it would be better to create an array of the tasks and enqueue inside of a FOR loop. Be sure to use a shift register on the error and the queue reference.
01-11-2013 03:23 PM - edited 01-11-2013 03:24 PM
You could create an Array constant of all those enums set in that order. Wrap the Enqueue in a For Loop and feed the array constant in with auto-indexing on the tunnel. Use shift registers on the queue reference wire and the error wire for identical functionality. Less diagram space.
EDIT: I see that is what Crossrulz suggested by the time I had posted this.
So attached is the image.
01-11-2013 03:23 PM
If you are probing the queue out wire that is a reference to the queue and not the queue itself.
For testing purposes use the Get Queue Status VI and probe the # elements in queue output.
01-14-2013 09:17 AM
Don,
It looks like you were right. I was probing directly off of the queue itself, rather than using the get queue status vi. I tried that and it looks like my queue is being built properly. So now I just need to figure out which downstream process is not working correctly.
Thanks,