LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about global data in LV express

In a previous version of labview (5) I shared global data through the use of subVI dedicated to storing data. (I discovered this method from an NI article) This 'dataVI' made use uninitalized shift registers of a single iteration while loop to store the data. Messages were sent to the dataVI by other VIs to request either to read or write that data. These requests were processed by a case structure within the dataVIs while loop.

This system addressed several of the downfalls of global variables. But I was wondering if there is a 'better' way of doing this in LV express.
0 Kudos
Message 1 of 2
(2,508 Views)
There is no better way to avoid those pesky globals than the good old uninitialized shift register. There is, however, a better name. We like to call them "functional globals" these days. It souds better than the old name, "LabVIEW 2 style global".

In fact, the method is a sort of stepping stone to GOOP (Graphical Object Oriented Programming). You can think of your functional global subVI as a data object with read and write methods. Sometimes I like to include an Init case as well. For configuration data, you can build Save and Load cases in which you can put more subVIs to read and write INI files and such.

So, if someone out there thinks of a "better way" I'd love to hear about it too! Until then, I'll keep cranking out my functional globals
.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
Message 2 of 2
(2,507 Views)