LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing messages between loops (Consumer - Producer)

All,

I am needing some assistance or really, conformation of what I am doing is right or if there is a better way of communicating between two loops, specifically the Consumer/Producer loop with an Event Structure.

 

I am using a queue to pass messages (MessageID + Data in variant form via a cluster) from the UI (top) loop to the Data Processing (bottom) loop. If I need to send a message back loop back up to the UI Loop, I am using User Events (with the same Message ID/Data cluster). As of now, this is not time sensitive data...the loop will process it as the state is in the Wait state and all other messages are handled.

 

Is this the proper way or is there a better, more efficient way? I was thinking of using notifiers but, investigating that solution, didn't seem like a good fit.

 

Your thoughts are much appreciated.

0 Kudos
Message 1 of 3
(2,169 Views)

If it does what you expect, then it is probably good enough. 

 

Channel wires are made to communicate between loops: http://www.ni.com/product-documentation/53423/en/

Certified LabVIEW Architect
0 Kudos
Message 2 of 3
(2,145 Views)

That solution is good. The only downside is that you'll need to filter both event recievers, which may or may not be a problem.

A version is to simply create 2 event threads and have a "from UI events" and "to UI events".

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(2,141 Views)