LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture Question / Chained Loops

Solved!
Go to solution
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.
0 Kudos
Message 11 of 25
(886 Views)

@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.

0 Kudos
Message 12 of 25
(882 Views)
Why?
0 Kudos
Message 13 of 25
(880 Views)

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.

0 Kudos
Message 14 of 25
(878 Views)
Wait on notification. If it time out then I have no new command right? I only send DAQ signal ON once.
0 Kudos
Message 15 of 25
(876 Views)
Well I'm sending a command like 'ACQUIRE' and only once. So then what to use?
0 Kudos
Message 16 of 25
(873 Views)
Solution
Accepted by topic author pierroil

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.

Message 17 of 25
(871 Views)

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!

Acquisition.png

0 Kudos
Message 18 of 25
(841 Views)

So I just found out that the wait on Notification function will repeat a message for ever...

Lovely.

 

0 Kudos
Message 19 of 25
(832 Views)

@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.

0 Kudos
Message 20 of 25
(830 Views)