02-19-2007 11:50 AM
02-19-2007 12:26 PM
Your suggestion near the end is a valid one. The basic queue functionality only allows dequeuing the first or last element (although you don't necessarily need a second queue. You can simply pop the element back into the queue at either end right after dequeuing it).
Another option is to use the Preview Queue Elements along with the Flush Queue to be able to get an array of all the elements, but that seems like abusing the concept of the queue. Note that to get the elements, you need to wire T into the Return Elements terminal.
02-19-2007 12:46 PM
02-19-2007 12:49 PM
Thanks for the reply tst! I tried (unsuccessfully) to simply dequeue the element and then feed it back into the beginning of the queue but after thinking about it I abandoned the idea because wouldn't I have to use a second queue if I wanted the ability to skip more than one process?
I think the idea of not using another queue only works when there is only 1 process that can be "forced to wait" at a time. I did a rather poor job explaining it, but the situation can occur where a process can't be run until another process is run to free up the resource. So if I wanted to go 1,2,3,4 but 1 can't go, and 2 also can't go yet, if I just feed it back into the queue, the program just keeps trying 1 and 2, which neither will work until 3 moves. I pretty much just want to make sure my thought process isn't flawed here. Thanks again for the help, especially help coming from the Legendary tst!
-- Matt
02-19-2007 12:56 PM
Why not just enqueue the element at the end of the queue?
Also, if your processes have certain dependencies, you may wish to think a bit more about how you will structure this. It's quite possible that you can find a much better architecture for doing this.
As tbob said, if you don't need serious speed or have a lot of elements, you can simply emulate the queue functionality yourself using LV2 global or even single-element queues globals. ![]()
02-19-2007 01:04 PM
02-19-2007 01:55 PM
02-19-2007 02:39 PM
02-19-2007 03:08 PM
I don't currently think I am currently using a state machine, at least not intentionally. I'll read up on them tonight. I've posted a few times to get help on this program and people have been gracious enough to keep me moving in the right direction. It's the same one from my "Barrels of LabVIEW" post a few weeks ago.
I basically can have up to 5 different "sequences", with each sequence moving a barrel around 40 different tanks to soak in each for a given period of time. The arm moves around thanks to it being able to use a photoeye to "count" reflectors on the tanks to know its current position. The part that has been the bane of my LabVIEW existence is that the barrels all share the same tanks and only one barrel is allowed in a tank at a time. I've tried using harsh words and yelling at the robot lift when it drops a barrel into a tank that is already occupied...but apparently negative re-inforcement does not work on robots.
-- Matt
02-19-2007 03:55 PM