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

Functional Global Variable vs. Shared Variable

$
0
0

So I find myself dealing with a real-time application that uses functional globals (It is a QSM Queued State Machine architecture). A bit new to them, but from what I understand (from my reading about them) is that they are useful in applications where you are writing to these variables simultaneously  from many .vi's, which we are in this case. The shift register action in the loop, effectively locks down the variable from reading or writing, untill either of those operations is complete. It helps to prevent a race condition. However, for most of my Labview time (around 4 years or so) I was always told to use shared variables for everything. If nothing else, it is easy to see that you now have a list of variables in project explorer. I thought that I read that there is a setting with shared variables that effectively makes them like a global variable. So when this setting is used, is there any real difference? Thanks....

 

Dan


Viewing all articles
Browse latest Browse all 66767

Trending Articles



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