LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between Channeled Message Handler and Queued Messange Handler concepts


@Sheetak01_ wrote:

Hi Bob

where did you get this program? i tried to find them because i am taking the Core 2 and i don't have access to these programs.


This looks like it might be a modified version of the "Channeled Message Handler" project template. If it's not, then even still you can probably get something out of looking at it.  If you open LabVIEW, and go to the "File...-> Create project" menu option, it should be one of the templates listed.  It should give you this or something very close to it:

 

Kyle97330_0-1757032132644.png

 

0 Kudos
Message 11 of 12
(109 Views)

In the CMH illustrated in Kyle's last response, note three sub-VIs shown on the lower Message Handling Loop, the one on the left "accepting" the (pink) Messenger Channel Wire and the two on the right "emitting" the Channel Wire.  I make my own Icons for these, calling the first "Read Msg", the second "Send Msg", and the third (sitting between the Case and While loops) "Handle Error".  The change I make is to give the Error Handler a Messenger input.  The Error Handler works as follows:

  1. Read the incoming Message, with a TimeOut of 1 (ms).  We use the "Timed Out?" input to decide if there is an incoming message.
  2. A Case Statement with the Error Line on the Case Selector.
  3. In the "No Error" case:
    • If "Timed Out?" is False, there was a Message, so re-create the Messenger Channel and pass it on.
    • Otherwise, simply exit;
  4. An Error is detected.  In this case, I build a call to the "Handle Error" state, passing in the Error Line and the incoming "Message" (which might be empty) as the Messenger "Argument" in case it was a "recoverable" Error that the Error Handler could simply "do next".

Bob Schor 

0 Kudos
Message 12 of 12
(93 Views)