08-03-2012 06:12 PM
08-03-2012 06:28 PM
@pierroil wrote:
Thanks. So just a get Notifier status would do. I'll put it in the DAQ loop. The data handling loop is an interesting idea by the way. I'll keep it in mind.
Make sure you're clear on the difference between "Get Notifier Status" and "Wait on Notification." You may want to use Wait on Notification with a 0 (or small) timeout instead of Get Notifier Status.
08-03-2012 06:30 PM
08-03-2012 06:35 PM
If you only care about determining when the value in the notifier changes, then it makes more sense to use Wait on Notification. If it times out, there was a new notification; if it doesn't, then keep doing what you were doing. Calling Get Notifier Status repeatedly is basically equivalent to polling a global variable. Wait on Notification also lets you use it as a timing mechanism (the timeout value) so there's no need for a separate loop timer.
08-03-2012 06:38 PM
08-03-2012 06:39 PM
08-03-2012 06:41 PM
If it times out, there is no new notification.
I don't see any problem with using a notifier even if you only intend to put in one notification, as a way to start a separate section of code after some parameters are set. In the message that started the thread you were asking about sending separate Start and Stop commands, which is also a fine use of a notifier and Wait on Notification.
08-09-2012 08:20 AM - edited 08-09-2012 08:20 AM
Here's what I ended up with by the way.
If it times out, then the next state will simply be the last one - i.e. if I was in acquisition mode, I will continue to acquire data. If I was in idle mode, I will continue to be in idle mode. At any moment, shoudl a notification come in, the mode can change. I chose this architecture since I cannot have an exterior signal constantly sending this notification - or if I did, it would be over engineering this. Unless of course... there is a better way to do this...
--
Thanks for your help!
08-09-2012 10:36 AM
So I just found out that the wait on Notification function will repeat a message for ever...
Lovely.
08-09-2012 10:39 AM
@pierroil wrote:
So I just found out that the wait on Notification function will repeat a message for ever...
Lovely.
No, it won't... could you be more specific about what you're seeing? Wait on Notification returns a default value if it times out. However, if you constantly send the same notification, that's still treated as a new notification even though the content is the same.