03-31-2010 07:31 PM
Hi,
In LabVIEW how would I know the number of times that an element has been enqueued and/or dequeued ?
Thanks
dphan128
Solved! Go to Solution.
03-31-2010 07:34 PM
I don't understand your question.
Any given element in the queue is enqueued only once. And it can be dequeued only once.
04-01-2010 12:48 AM
You have to maintain count in a numeric variable. Increment it every time you enqueue/de-queue.
04-01-2010 02:49 AM
04-01-2010 10:22 AM
What I meant was that I enqueued the same element into queue more than one time thru a For Loop. The element is an instruction that carries a different parameter each time. So I want to know when the last instruction was executed or how many times has it been dequeued so I can signal an ending.
Thanks
04-01-2010 10:28 AM
Make one of the parameters a count of how many times it has been enqueued. You will have to keep track of the count separately and pass it in as a parameter. You could also include a timestamp as a parameter to tell when it has been enqueued. If you only can pass one parameter, make it a cluster with the elements being your normal parameter, count, and timestamp. You should write an enque subvi that takes care of incrementing the count and updating the timestamp. Then call the subvi instead of the normal enque function.