08-11-2015 10:55 AM
i am working in a real time application. i have 3 tasks. i want to enqueue them and have at the dequeue VI only the information providing to the most priority tasks. please, how can i do.i tried for a long time ago but i cannot do it and i don't speak english very much so, an example will help me very much. thanks.
08-11-2015 01:07 PM
As you know, elements are removed from a Queue ("dequeued") in the order they were put on the Queue. If you have a loop looking at the Queue and trying to dequeue from it, whatever is "first" will be the next thing to be dequeued.
The concept of "priority" is interesting -- how do you decide on a priority? How does the Queue (which is just a wire with data, after all) distinguish between High and Low priority requests?
One technique that might work (but think carefully about this) is to use "Enqueue at Other End". For example, if I have operation A, B, and C on the Queue, and while doing Operation A I discover an error that makes me want to do Operation Q (for Quit) next instead of B (which is "next"), I can Enqueue Operation Q "at the opposite end" so the Queue looks like Q, B, C, and will do Q next (which, one hopes, flushes the Queue and exits).
Bob Schor
08-11-2015 01:41 PM
It sounds like you're looking for a Priority Queue, and I found these. I cannot test them on a Real Time system.
08-11-2015 03:02 PM
OK you don't speak English much--
To be honest you're english is better than my Mandarin. Show what you have done.