LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
cirrusio

Default queue element

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

I find this difficult to believe that this has not been suggested before, but a search of the Idea Exchange has come up null.  And maybe there is a reason why this has not been implemented of which someone can enlighten me, but...

 

Is there anyway we can get a default queue element that is used when a dequeue element times out.  I have found that in several recent projects, I end up with queued state machines that look like this:

 

21287i411EB0AE3D475742

 

where I use a select to define a default queue value.  It would reduce some of the code bloat if we had a default value available (that was not necessarily the types default value) such as what you might find in the RT FIFO:

 

21289i3962134D47D34E02

 

But, maybe I am missing something?

 

Matt

13 Comments
cirrusio
Active Participant

Hmmmmm....not at all!  I use some of these state type-def's in different VIs for which the default is not necessarily the same (for a networked application, maybe wait is a default while on a desktop acquire is the default).  This doesn't mean that I have multiple default values in the same VI (that is rather meaningless), but multiple defaults across different applications.  Hence the reason I suggested it.  (And I have seen other applications not developed by myself where they use something similar to what I show in the top image).

 

Now, this still doesn't seem to answer the question - if this was not of any value, then why was this same technique used for the RT FIFO (where I do use the default value on time out)?  And again, it seems that you may run into some real problems with updating a type def but then forgetting to update the application thus potentially throwing your app into a bad state - not specifying explicitly the state you desire is bad programming practice.  Those are my two cents.  As for the type-def default - I don't fully understand specifying the default for a constant, both the how or why (the how seems to be a real crux).  But, I will let you guys battle that one out...

 

Cheers, Matt

AristosQueue (NI)
NI Employee (retired)

> if this was not of any value, then why was this same technique

> used for the RT FIFO (where I do use the default value on time out)?

 

My argument is that it should not have been.

 

Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.