usage of "get queue status".vi

This is a discussion on usage of "get queue status".vi within the labview forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-29-2008, 03:10 AM
labmaster
Guest
 
Default 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? ?? ?????


yahoo1.jpg:
http://forums.ni.com/attachments/ni/...5/1/yahoo1.jpg
Reply With Quote
  #2  
Old 07-29-2008, 03:40 AM
MikeS81
Guest
 
Default Re: usage of "get queue status".vi

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
Reply With Quote
  #3  
Old 07-29-2008, 04:10 AM
labmaster
Guest
 
Default ??: Re: usage of "get queue status".vi

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?
Reply With Quote
  #4  
Old 07-29-2008, 04:40 AM
MikeS81
Guest
 
Default Re: ??: Re: usage of "get queue status".vi

Hi labmaster,
use the "-1" option. I´m not sure why you need a useless event. Send only the events you need.
Mike
Reply With Quote
  #5  
Old 07-29-2008, 04:10 PM
smercurio_fc
Guest
 
Default Re: usage of "get queue status".vi

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.
Reply With Quote
  #6  
Old 07-29-2008, 08:40 PM
labmaster
Guest
 
Default ??: Re: usage of "get queue status".vi

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.
 
 
Reply With Quote
  #7  
Old 07-30-2008, 01:10 AM
MikeS81
Guest
 
Default Re: ??: Re: usage of "get queue status".vi

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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:48 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.