LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

QMH Continuous Measurement and Logging Sample Confusion

Hi Guys,

 

I have a general question regarding the Sample Project "Continuous Measurement and Logging" using the Queued Massage Handler.

Why does the producer Loop send a Message first to the Message Handler Loop of the UI when the Button Start is pressed and after that the MHL sends a message to the Acquisition Loop. Why don't you send the Start Message to the Acquisition Loop directly from the Event Handling Loop?

Are there any best practices I should have in mind?


Thank you in advance!

Greetings from Germany
Philipp

0 Kudos
Message 1 of 4
(573 Views)

The UI Message Loop in the QMH Example is supposed to be the "Main Post Office" where all the mail comes.  It "sorts the mail", and calls on neighborhood Mail Carriers to take specific Messages (much of which it generates) to the neighborhoods "Acquisition Message Loop", "Logging Message Loop", and "Data Display Loop.  When you have five Parallel Loops running, with one designated as the "Message Handler", it is often times simpler (in the long run) to have it "deliver all of the Messages" to the other loops.  My only quibble is the clumsy way of stopping the Data Display Loop by forcing an Error condition in the Loop when the Notifier Refnum is released (which is why I prefer Tag Channel Wires).

 

Bob Schor

 

 

0 Kudos
Message 2 of 4
(536 Views)

IMHO: The QMH is a horrendous design pattern. While its theory is sound, the QMH is so tightly coupled and poorly documented that I never could figure out how to modify it for any useful purpose.

 

I ended up designing my own similar program architecture containing several independent State Machines and an EDSM to handle my GUI using Chanel Wires to communicate between them in less time than it took to figure out how to use the QMH.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(530 Views)

Yes, Channel Wires implement a Channel Message Handler (CHM -- I believe I may have been the first to call it that) which makes State Machines quite nice.  I think I posted an example somewhere on the Forums -- maybe I can find it ...  Well, here's a PNG that I posted around 3 Mar 2022.  The Pink Pipes are Messenger Channel Wires, the Message is a Cluster of "State" (an Enum with State names) and "Data" (which is a Variant, and is often empty, as not every State needs data).  "Next Show State" (this is art of a "Show" routine, so the State was called a "Show State", and "New Data" is the name of one of the States).

 

CMH Example.png

 

Bob Schor

0 Kudos
Message 4 of 4
(513 Views)