LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make Sure States are Appended (not Inserted) to QMH

Hi all,

 

I just wanted to see how other people take care that QMH messages that are meant to be run sequentially only get messages added after them, and not inserted in between them. My curiosity was prompted by several of drjdpowell's posts and videos.

 

 - Perhaps this could be taken care of by being careful of when I enqueue messages, but it's easy to come back to code in a month and forget the careful timing considerations, or to pass it off to a co-worker who is not aware of them, so I would rather this be taken care of by the QMH architecture.

 

- One choice is to have two queues (or more generally two message streams). One that executes local messages, and another that executes external messages only when there are no more local messages.

temp1.PNG

The JKI state machine does this where the internal messages are on the states string and the external messages come through the event structure. The DQMH does this where the internal messages are on the queue and the external messages come through the event structure.

 

- Another choice is to make sure messages are enqueued at only one place at a time using a DVR or Action Engine. I would prefer the DVR route because sometimes I want to enqueue a single message and other times an array of messages, so the action engine would have many inputs.

Temp2.PNG

I hope to hear some thoughts on what considerations you take when working with QMHs. Thank you,

 

Gregory

Message 1 of 2
(1,118 Views)

Just came across a great blog post by James McNally which addresses this and other issues. For those interested:

https://devs.wiresmithtech.com/blog/qmhs-hidden-secret/

Message 2 of 2
(1,058 Views)