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

modifying same variable in different loops

$
0
0

Hello Everyone,

 

I am using an event-controlled producer/consumer architecture where both loops run processes acting on a common variable.

To be more specific, I intend to modify a Picture Indicator both in the consumer and producer loops. Therefore I need to share this variable between the two loops.

I thought the best way for that was to use the Picture Indicator as part of a Functional Global Variable:
1/ Initialization of the FGV, which is a cluster containing the Picture Indicator

2/ In both loops, the Picture Indicator latest value is extracted from the FGV using a "Read" action

3/ The Picture Indicator value is wired through different processes that might change it partially or totally

4/ Finally, in both loops the Picture Indicator updated values are wired as input of the FGV.

 

Above is the ideal case, I would have expected to work. However this is not working, and what I actually implemented is:

a) In the producer loop, the Picture Indicator is updated through a shift register, and at the same time the new value is stored in the FGV

b) In the consumer loop, the Picture Indicator is retrieved from the FGV, and its updated value is stored in the FGV (as in the ideal case)

 

Then I don't why this is not working. I use other FGVs in my VI, and that are modified by both loops, but THEY work..

 

My VI is really big, so I can't take a picture of it. Then I provide you with simplified scheme of what is my current architecture, and the one I target. I hope it helps.

 

Thank you.

 

Florian

 

 

 

 


Viewing all articles
Browse latest Browse all 69315

Trending Articles



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