LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is QMH obsolete? Am I wasteing my time?

Solved!
Go to solution

@johntrich1971 wrote:

I agree that learning the QMH is worthwhile. I have found my own variations of it to be adequate for most applications. You will find people who swear that lots of different design patterns are best (DQMH, JKI State Machine, Actor Framework, just as a few examples). All of these are good design patterns, but the tool does really need to fit the task. You don't generally need a sledge hammer to drive a nail. 


Just a note to any new LabVIEW programmers reading, but I personally would very strongly advise against ever using the NI "QMH"/"Producer Consumer"/"Continuous Measurement and Logging" templates.  I would advise against even looking at them.  The "JKI State Machine" is a much better design to be introduced to.

 

I would even (more weakly) warn against the DQMH, due to its use of the NI QMH design internally.  Though with the DQMH one can divide a complex application into multiple simpler DQMH modules, which limits the possible problems.

0 Kudos
Message 21 of 99
(2,028 Views)

@RTSLVU wrote:

Unlike Queues, Channel Wires follow the standard Data Flow paradigm (Input on the left and output on the right). 

 


Channel wires also break the standard data flow paradigm. Their whole purpose is to transmit data from one loop to another while both loops are still running. You may have a visual connection, but a well written messaging application will have visual cues that could be followed as easily as wires which are running backward on the screen. That's just my take on it.

 


@RTSLVU wrote:

Also With Channel Wires I don't have to pass the Queue around with shift (NOT bleep) registers and pass it through every single state of my state machine whether I am operating on the Queue or not. If I need to read or write a Channel in that state I do it, if I don't then I can ignore the Channel Wire in that state.


Why would you have to pass the queue around with shift registers? The queue reference doesn't change. I create all of my queues prior to entering the main loops. They do tend to be on a single shift register since they're generally saved in an object with other stuff that may change in the loop, but if the queues were the only thing of interest there is no need for a shift register.

 

@drjdpowell wrote:


Just a note to any new LabVIEW programmers reading, but I personally would very strongly advise against ever using the NI "QMH"/"Producer Consumer"/"Continuous Measurement and Logging" templates.  I would advise against even looking at them.  The "JKI State Machine" is a much better design to be introduced to.

 

I would even (more weakly) warn against the DQMH, due to its use of the NI QMH design internally.  Though with the DQMH one can divide a complex application into multiple simpler DQMH modules, which limits the possible problems.


I don't disagree with this. Honestly I'm not even sure what the NI shipping examples look like. 

0 Kudos
Message 22 of 99
(2,012 Views)


Why would you have to pass the queue around with shift registers? The queue reference doesn't change. I create all of my queues prior to entering the main loops. They do tend to be on a single shift register since they're generally saved in an object with other stuff that may change in the loop, but if the queues were the only thing of interest there is no need for a shift register.

 

 


Honestly I have asked myself that same question. But anytime I posted some code like this without those Shift Registers people would come out of the woodwork to tell me I MUST put Shift Registers on the Queue in my loops.

 

ExampleExample

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 23 of 99
(1,998 Views)

@RTSLVU wrote:


Why would you have to pass the queue around with shift registers? The queue reference doesn't change. I create all of my queues prior to entering the main loops. They do tend to be on a single shift register since they're generally saved in an object with other stuff that may change in the loop, but if the queues were the only thing of interest there is no need for a shift register.

 

 


Honestly I have asked myself that same question. But anytime I posted some code like this without those Shift Registers people would come out of the woodwork to tell me I MUST put Shift Registers on the Queue in my loops.

 

ExampleExample


Not sure who was saying this, but in your simple example there is absolutely no need for the shift register. Try it and you will see that it works just fine.

0 Kudos
Message 24 of 99
(1,993 Views)

Save your queue references in an action engine/global/whatever and you don't really need queue reference wires anywhere except going from your action engine/global/whatever to the queue functions.  (As long as you actually update the action engine/global/whatever after you create it, but before you actually use it.)

 

I guess shift registers were left over from the shipping examples.  I used to keep them in a shift register a long time ago, then I found out it just didn't matter.

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 25 of 99
(1,985 Views)

@drjdpowell wrote:

@joerg.hampel wrote:

Personally, I am confident that DQMH is a very good choice - actually, I'm sure it's the best, but that's just me 😉


Ah, but Messenger Library is the bestest 😉


I would beg to differ. Our publish/subscribe messaging system is the bestest of the bestest.

 

Many years ago before DQMH and Actor Framework I designed a network based messaging system which has proven to be quite flexible and robust. It has been in heavy use for about 15 years now. It is built around multiple classes. It takes a little bit of effort to fully grasp how everything works but if someone is simply using it the framework it isn't much more complex then using queues. Everything has been packaged up very cleanly. It has gotten some refactoring over the years to improve it. Probably the biggest draw back is a central message broker. However in very large systems you can actually deploy multiple message brokers and keep some of the messaging more localized while still allowing messages to be broadcast much more widely. I am in the process of adding in support for TLS on the underlying messaging channels. One very niece thing about this system is that the system can be used in a multi-language environment. We have had Python modules tap into the system and send/receive messages.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 26 of 99
(1,953 Views)

Fortune favors the prepared mind

I've used QMH as a quick way to knock out a quick tool. I agree with some previous comments that the "Continuous Measurement and Logging" is not a great example. I've never, ever, turned that into something functional.

 

In my programming you'll find a mix of different techniques as the situation requires. Learning it is good because options are appreciated when solving problems.

0 Kudos
Message 27 of 99
(1,946 Views)

Also to consider, and not at all trivial, is that with the plain vanilla QMH, you will greatly increase the chances that some knowledgeable in LabVIEW, especially formally trained, will instantly recognize the pattern and can concentrate on what you coded, not how you coded it.

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.
Message 28 of 99
(1,931 Views)

@billko wrote:

Also to consider, and not at all trivial, is that with the plain vanilla QMH, you will greatly increase the chances that some knowledgeable in LabVIEW, especially formally trained, will instantly recognize the pattern and can concentrate on what you coded, not how you coded it.


This is why I really wish NI would introduce new templates to replace the current ones.  Standardisation is great, but it should be on a simple but decent design.

Message 29 of 99
(1,910 Views)

@Mark_Yedinak wrote:

@drjdpowell wrote:

@joerg.hampel wrote:

Personally, I am confident that DQMH is a very good choice - actually, I'm sure it's the best, but that's just me 😉


Ah, but Messenger Library is the bestest 😉


I would beg to differ. Our publish/subscribe messaging system is the bestest of the bestest.

 

Many years ago before DQMH and Actor Framework I designed a network based messaging system which has proven to be quite flexible and robust.


Hey, I called "bestest".  You can't bestest my bestest!

 

But seriously, have you made your framework public?  With good documentation?  To a new user a framework that isn't available, or has insufficient documentation,  effectively doesn't exist.

0 Kudos
Message 30 of 99
(1,903 Views)