LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer Architecture update UI

Solved!
Go to solution

Hi!

I've been working on a UI using the Producer/Consumer Architecture for a while now. I've found many helpful solutions and learned a lot from previously asked questions, but I can't figure out one thing. What is the best way to communicate between the consumer loop and the front panel? So far, I've seen property nodes and local variables (admittedly the latter only in my code, I guess it's not the way to go) and on the other hand, I've seen Producer/Consumer examples where the loops are in SubVIs, so the block diagram is not cluttered, which I don't know how to realize with property nodes. So, my question is, how do I update Front Panel Elements with the data from the Consumer Loop?

Kind regards,

Erik

 

0 Kudos
Message 1 of 2
(834 Views)
Solution
Accepted by erikson_99

@erikson_99 wrote:

What is the best way to communicate between the consumer loop and the front panel?


As always, it depends. But you can e.g. have 1 or several update-states that you queue up to your consumer, so your consumer queues up stuff for itself. (If you only have a couple of indicators that need updating you might have one case for each, otherwise some general one is better).

You can also "send it back" to the Event loop by using a User Event. It fits the logic of "Let the Event structure handle all of the UI".

But, as you mention, if it's not too much stuff it might be easier to write to the indicators directly in the consumer.

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

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 2
(809 Views)