12-15-2017 08:32 AM
I have an application in which I have a Producer Loop, which gives me data and apends this to a queue. The queue elements are then read in a separate consumer loop, since the analysis of the data is rather long. The producer Loop only enqueues every 0.05 seconds or so (as this is the time it takes to make a measurement).
The problem I have is that I have user controls which are required for the analysis, e.g. an Offset value. The user can change this value and the upated value is then applied in the analysis.
What is the best architecture for this?
I was thinking that instead of the present 2 loops, I add a third loop which handles User Events.
But then how do I get the new values into the consumer loop? Another queue? Wouldn't this affect timing? Another alternative would be to put all the controls in the already existing Producer Loop a,d bundle everything into a cluster (controls and data) and add that to the queue. This seems messy though.
Any experiences?
Solved! Go to Solution.
12-15-2017 09:25 AM
having three loops is not a bad idea, so
producer, processing/consumer, display/consumer
the information transfer between all of these is the part where it depends on personal preference, i think.
you have globals and local variables (both with the problem of race conditions)
action engines / funtional globals,
notifiers, queues and user events
i like the user events, because its mostly the same as queues, but you can act on them with event structure (and therefor also handle UI events)
have a look at the example, hope that helps
12-15-2017 09:57 AM
Have you got a LabVIEW 15 version of this example...?
12-15-2017 09:59 AM - edited 12-15-2017 10:00 AM
here you go
12-17-2017 10:24 PM
@dougbockILT wrote:
The problem I have is that I have user controls which are required for the analysis, e.g. an Offset value. The user can change this value and the upated value is then applied in the analysis.
Are those values only needed for the analysis? If so, just put the terminals in the consumer loop and read them off directly.