Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69091

Updating front panel controls in producer consumer

$
0
0

Hi,

 

I wanted to ask for some advice.

Usually when I implement a producer consumer I use the producer to create queue elements with an enum state and pack all the data necessary to process the event in a variant.

Then the consumer does all the work. 

 

There are two areas where I feel like I might not be using the best approaches..

 

1) When I have to update a front panel control I pack a reference to that front panel control into the variant so I can access the property nodes in the consumer and update it.

I attached pictures with an example. It is simplified code where the user has to run some DAQ task while scanning some parameter. The code increases the parameter by a set amount with every run to aid the user in his scan.

Is there any better way of doing this?

 

2) When events require the same control to be wired into the variant for handling by the consumer loop I create local variables or references to that control in other events. Would it be better to have a shift register running through the producer loop that gets updated front panel values at every while loop iteration?

 

Thank you.

 


Viewing all articles
Browse latest Browse all 69091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>