08-18-2008 12:26 PM
"Use local variables to ... pass data between block diagram structures that you cannot connect with a wire" (LabVIEW 7 Express User Manual: Local Variables).
I would like to pass some data around between block diagram structures. However, there is no need to change or display the value on the front panel at runtime.
Basically, I would like the functionality of a local variable without the front panel object requirement. What is the best way to achieve this?
08-18-2008 12:51 PM
Look up Functional Global Variable, LV2 style global variable, or Action Engine on the forums.
You use a subVI that is set to non-reentrant. They contain a while loop that has a true constant wired to the stop terminal so that it only runs once. It uses an uninitialized shift register between calls to store the data. In its simplest form, it will have a case structure inside with Get and Set cases to return the data or set a new value.
08-18-2008 02:08 PM
If you right-click on the object in the Front Panel, go to Advanced>>Hide Indicator it will hide the indicator from the front panel.
Hope this helps.
--Brad
08-18-2008 08:46 PM
Yes, that will work to an extent, but the main problem remains from the Local Variable is that you have very little control over exactly when it updates unless you start putting other structures around it. In addition, with a Local Variable all you can do is store a bit of data. With a Functional Global or action engine you can perform other operations inside the storage function. For example, say you want a variable that automatically initializes itself by reading data from a ini file or a database. Or say you want a function that can automatically provide persistent storage of values that you send to it.
Functional globals are much better - and more powerful way of managing things.
Mike...