LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

QMH Example project un-named queues?

Solved!
Go to solution

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

0 Kudos
Message 1 of 18
(1,680 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 18
(1,670 Views)

I guess your forum experience didn't include noticing how often responders ask for actual code instead of pictures of fragments of code?  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 18
(1,666 Views)

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.

0 Kudos
Message 4 of 18
(1,651 Views)

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?

0 Kudos
Message 5 of 18
(1,644 Views)

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

0 Kudos
Message 6 of 18
(1,637 Views)

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.

0 Kudos
Message 7 of 18
(1,637 Views)

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

0 Kudos
Message 8 of 18
(1,627 Views)

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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 9 of 18
(1,602 Views)

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

 

 

0 Kudos
Message 10 of 18
(1,572 Views)