05-22-2019 07:35 AM - edited 05-22-2019 07:36 AM
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.
05-22-2019 08:13 AM - last edited on 01-11-2025 02:54 PM by Content Cleaner
If it does what you expect, then it is probably good enough.
Channel wires are made to communicate between loops: https://www.ni.com/en/support/documentation/supplemental/16/channel-wires.html
05-22-2019 08:36 AM
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