| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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? ?? ????? yahoo1.jpg: http://forums.ni.com/attachments/ni/...5/1/yahoo1.jpg |
|
#2
| |||
| |||
| 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 |
|
#3
| |||
| |||
| 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? |
|
#4
| |||
| |||
| Hi labmaster, use the "-1" option. I´m not sure why you need a useless event. Send only the events you need. Mike |
|
#5
| |||
| |||
| 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. |
|
#6
| |||
| |||
| 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. |
|
#7
| |||
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.