george seifert Posted January 10, 2013 Report Posted January 10, 2013 I'm sending data via a queue to my main VI in which I only care about the latest data. Currently I have the queue setup for a max size of 1 so sometimes I get an overflow in the transmitting VI. I'm wondering if this is a reasonable way to setup the queue. Or is it better to make the queue size bigger so the queue doesn't overflow and read all the data in the queue in my main VI and only use the last element? George Quote
Jordan Kuehn Posted January 10, 2013 Report Posted January 10, 2013 If you use the lossy enqueue and then preview the queue element it should perform like you are expecting. Quote
george seifert Posted January 10, 2013 Author Report Posted January 10, 2013 Thanks. I am using the lossy enque element (figured that out the hard way a while ago) and it does work. I'm just wondering if that's the "right" way to do it. I suppose it probably is since there is a VI that purposely discards data to make room for new data. Quote
jzoller Posted January 10, 2013 Report Posted January 10, 2013 You might consider using a notifier instead. http://zone.ni.com/reference/en-XX/help/371361J-01/glang/notification_vis/ JZ Quote
george seifert Posted January 10, 2013 Author Report Posted January 10, 2013 I never thought much about notifiers and didn't see much use for them, but my situation seems like it might be a perfect fit. Thanks. Quote
Ton Plomp Posted January 10, 2013 Report Posted January 10, 2013 Well the difference between a queue and a notifier is that notifier data is available after read, but you can get event like behavriou upon update. Ton Quote
crossrulz Posted January 10, 2013 Report Posted January 10, 2013 If you only care about the latest data, a notifier is the guy you want. A queue is for lossless data transfer. A notifier is for lossy data transfer. Quote
Ton Plomp Posted January 11, 2013 Report Posted January 11, 2013 Well not really an event, but you can wait until new data is available (just like queue). Ton Quote
mje Posted January 11, 2013 Report Posted January 11, 2013 Notifiers are also event-like in that you can have a one to many broadcast: multiple tasks can be waiting on notification from the same refnum. Quote
drjdpowell Posted January 12, 2013 Report Posted January 12, 2013 Notifiers are also event-like in that you can have a one to many broadcast: multiple tasks can be waiting on notification from the same refnum. And one can have a single task waiting on multiple notifiers, which is also event like and something one can’t do with queues (though, unlike with the event structure, the notifiers all need to have the same datatype). 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.