LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usage of "get queue status".vi

I want to show the current status (busy indicator) of my program (producer/consumer routine).
In consumer routine, I checked the current queue status by # element in queue in "get queue status.vi".
I anticipate "non-zero" value in the number of queue when one or more event was happened.
(As you know in the attachment, I force to insert a time-consuming code for 2 sec to stay in the same iteration number.)
 
Strangely, as you can see the values,  I can't check the event (only 0 of # element at an event) although the event value was passed to consumer routine.
What should I check to realize my purpose?


메시지가 07-29-2008 02:05 AM에 labmaster에 의해 편집되었음
0 Kudos
Message 1 of 7
(3,691 Views)

Hi labmaster,

how many time elapsed between read the status and receive the element? It could be that you read the status and nothing is in there, but your dequeue function has a timeout of -1 so it will wait til it receives the next message.

Mike

Message 2 of 7
(3,685 Views)
Thank you, MikeS81 ,
 
I understand what you mean.
 
Anyway, I don't want to use timeout option in the consumer routine.
 
Therefore, I send a useless event before the main event.
Is it strange?
0 Kudos
Message 3 of 7
(3,673 Views)

Hi labmaster,

use the "-1" option. I´m not sure why you need a useless event. Send only the events you need.

Mike

Message 4 of 7
(3,671 Views)
Why don't you want to use a timeout in the consumer loop? As it is, the code will only work if there is a timeout so that the consumer loop spins around so you can catch the element having been placed in the queue.
Message 5 of 7
(3,646 Views)
Auctually, the timeout option was not success in my trials.
When I set to 20 ms or 200 ms, get queue status.vi was not catch the queue state.
 
 
0 Kudos
Message 6 of 7
(3,630 Views)


labmaster wrote:
Auctually, the timeout option was not success in my trials.
When I set to 20 ms or 200 ms, get queue status.vi was not catch the queue state.

Hi labmaster,
if you use a timeout, then "get queue status.vi" get nothing because there is no message. Why do you need the status check? If you really need it, you can use a parallel loop in which you read the status of the queue.
 
Mike
Message 7 of 7
(3,617 Views)