01-17-2023 01:54 AM
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
Solved! Go to Solution.
01-17-2023 03:05 AM
@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.