09-24-2020 11:55 AM
I'm spending so slow time at the office to familiarize myself with QMH architecture and the continuous acquisition and logging example has me a bit baffled. The Main VI block diagram has multiple loops, particularly an 'acquisition' loop that dumps dated into a named queue, and a data display loop that pulls data from an un-named queue. I dont get it. How does the VI know where to get the data? I've attached a snip to highlight my confusion.
Thanks in advance. With the forum and experience, I'm learning that if there is something I need LV to do, there is already a way to do it, the trick is just learning the correct methods to do it!
C
Solved! Go to Solution.
09-24-2020 12:23 PM
1. Your image is pointing to a Notifier, which is different from a Queue. A Notifier is meant for 1 to N communication and only holds the latest value. A Queue is meant for N to 1 communication and holds a history of values so every value can be processed.
2. I don't believe in using named queues or notifiers. I have ran into way too many issues with other processes using the same name and messing up the data going in and out of the queue. You use the queue or notifier reference wire to write and read to/from the queue or notifier.
09-24-2020 12:26 PM
I guess your forum experience didn't include noticing how often responders ask for actual code instead of pictures of fragments of code? 😉
09-24-2020 12:48 PM - edited 09-24-2020 12:48 PM
In the capture that you show I do not see any named queues? What makes you think that the queues are named? And as others have pointed out you have pointed out two notifiers and one queue in your code, none of which appear to be named.
09-24-2020 12:54 PM
Thanks for your quick response. Now the inevitable follow-up...
1. Your image is pointing to a Notifier, which is different from a Queue. A Notifier is meant for 1 to N communication and only holds the latest value. A Queue is meant for N to 1 communication and holds a history of values so every value can be processed.
OK, 1 to N makes a little sense, but this app (it is the 'Continuous Measurement and Logging' project template that comes with LV example programs) has three named Queues, how does the notifier know to take data from the Acquisition queue, and not the UI or Logging queues?
If you don't name queues, how does a common message like 'initialize' land in the correct loop?
09-24-2020 01:03 PM
@CDC1 wrote:
Thanks for your quick response. Now the inevitable follow-up...
1. Your image is pointing to a Notifier, which is different from a Queue. A Notifier is meant for 1 to N communication and only holds the latest value. A Queue is meant for N to 1 communication and holds a history of values so every value can be processed.
OK, 1 to N makes a little sense, but this app (it is the 'Continuous Measurement and Logging' project template that comes with LV example programs) has three named Queues, how does the notifier know to take data from the Acquisition queue, and not the UI or Logging queues?
If you don't name queues, how does a common message like 'initialize' land in the correct loop?
Can you please point out where there are any named queues? The queues in that subvi are passed in from the calling vi. They could be either named or unnamed.
09-24-2020 01:03 PM
I see now that in the top panel, the data is dumped into a Notifier named with an input named 'Data Notifier'. In the bottom panel the data is pulled from a a queue (for the logging loop) and a notifier (for the display loop) with only a constant input. The output of the notifier is sent to the Data Display Loop. Still confused on how it knows what data to pull from where.
09-24-2020 01:09 PM - edited 09-24-2020 01:12 PM
@CDC1 wrote:
I see now that in the top panel, the data is dumped into a Notifier named with an input named 'Data Notifier'. In the bottom panel the data is pulled from a a queue (for the logging loop) and a notifier (for the display loop) with only a constant input. The output of the notifier is sent to the Data Display Loop. Still confused on how it knows what data to pull from where.
That is not the output of the notifier - it is the notifier reference. You can use that notifier reference anywhere that you want to read that notifier. That notifier is unnamed, and I believe is also passed to the Data Notifier input of the Aquire.vi loop.
09-24-2020 01:20 PM
@CDC1 wrote:
OK, 1 to N makes a little sense, but this app (it is the 'Continuous Measurement and Logging' project template that comes with LV example programs) has three named Queues, how does the notifier know to take data from the Acquisition queue, and not the UI or Logging queues?
If you don't name queues, how does a common message like 'initialize' land in the correct loop?
1 to N means that one loop/process/machine/etc. writes the data and there are N number of loops/processes/machines/etc. reads from it.
The Acquisition loop is sending the data via the Notifier. Any other loop can get the data using the Wait For Notification. All you need is the reference to the Notification.
Again, instead of naming the queues, you directly wire the reference wire wherever it needs to go for writing and reading. Maybe these simple examples will help you understand.
09-24-2020 03:58 PM
Thanks for the examples, but i must be dense. In your notifier example, the Obtain, Send, and Wait-on are all tied together with a refnum wire, in my example (NI's example) the Send notifier is in a sub vi (with no reference out) and the Obtain is in the main.vi (with no reference in). I just dont see the connection between the Send notifier in the sub panel, and the Obtain notifier in the main panel (whose only input is a constant data type).